iMesh Interface

Mesh

class itaps.iMesh.Mesh([options])

Return a new Mesh object with any implementation-specific optionsdefined in options.

Parameters:
  • options – Implementation-specific options string
rootSet

Return the handle of the root set for this instance. The entire mesh in this instance can be accessed from this set.

geometricDimension

Get/set the geometric dimension of mesh represented in this instance. When setting the dimension, an application should not expect this function to succeed unless the mesh database is empty (no vertices created, no files read, etc.)

defaultStorage

Return the default storage order used by this implementation.

adjTable

Return the adjacency table for this implementation. This table is a 4x4 matrix, where adjTable[i][j] represents the relative cost of retrieving adjacencies between entities of dimension i to entities of dimension j.

optimize()

Request that the mesh optimize the storage of its entities, possibly rearranging the entities and invalidating extisting handles.

Returns:True if entity handles have changed
createVtx(coords[, storage_order, out])

Create a vertex or array of vertices with the specified coordinates.

Parameters:
  • coords – Coordinates of new vertices to create
  • storage_order – Storage order of coordinates
createEnt(topo, entities)

Create a new entity with the specified lower-order topology.

Parameters:
  • topo – Topology of the entity to be created
  • entities – Array of lower order entity handles used to construct the new entity
Returns:

Tuple containing the created entity and its creation status

createEntArr(topo, entities[, out])

Create an array of new entities with the specified lower-oder topology.

Parameters:
  • topo – Topology of the entities to be created
  • entities – Array of lower order entity handles used to construct the new entities
Returns:

Tuple containing the created entities and their creation statuses

deleteEnt(entities)

Delete the specified entity or array of entities.

Parameters:
  • entities – An entity or array of entities to delete
getVtxCoords(entities[, storage_order, out])

Get coordinates of specified vertices.

Parameters:
  • entities – Entity or array of entities being queried
  • storage_order – Storage order of vertices to be returned
Returns:

If entities is a single Entity, the coordinates of the vertex. Otherwise, an array of coordinates.

setVtxCoords(entities, coords[, storage_order, out])

Set the coordinates for the specified vertex or array of vertices.

Parameters:
  • entities – Vertex handle or array of vertex handles being set
  • coords – New coordinates to assign to vertices
  • storage_order – Storage order of coordinates to be assigned
getEntType(entities[, out])

Get the entity type for the specified entities.

Parameters:
  • entities – Entity or array of entities being queried
Returns:

If entities is a single Entity, the type of the entity. Otherwise, an array of the entity types.

getEntTopo(entities[, out])

Get the entity topology for the specified entities.

Parameters:
  • entities – Entity or array of entities being queried
Returns:

If entities is a single Entity, the topology of the entity. Otherwise, an array of the entity topologies.

getEntAdj(entities, type[, out])

Get entities of the specified type adjacent to elements of entities. If entities is a single Entity, returns an array of adjacent entities. If entities is an array of entities, return an OffsetListSingle instance.

Parameters:
  • entities – Entity or array of entities being queried
  • type – Type of adjacent entities being requested
Returns:

If entities is a single Entity an array of adjacent entities. Otherwise, an OffsetListSingle instance.

getEnt2ndAdj(entities, bridge_type, type[, out])

Get “2nd order” adjacencies to an array of entities, that is, from each entity, through other entities of a specified bridge dimension, to other entities of another specified target dimension. If entities is a single Entity, returns an array of adjacent entities. If entities is an array of entities, return an OffsetListSingle instance.

Parameters:
  • entities – Entity or array of entities being queried
  • bridge_type – Type of bridge entity for 2nd order adjacencies
  • type – Type of adjacent entities being requested
Returns:

If entities is a single Entity, an array of adjacent entities. Otherwise, an OffsetListSingle instance.

createEntSet(ordered)

Create an EntitySet, either ordered or unordered. Unordered entity sets can contain a given entity or set only once.

Parameters:
  • ordered – True if the list should be ordered, false otherwise
Returns:

The newly-created EntitySet

destroyEntSet(set)

Destroy an entity set.

Parameters:
  • set – Entity set to be destroyed
createTag(name, size, type)

Create a Tag with specified name, size, and type. The tag’s size is the number of values of type type that can be held. type can be a NumPy dtype (or an object convertible to one; int and Entity are special-cased), or a single character:

Type object Type char Result
numpy.int32 'i' Integer
numpy.float64 'd' Double
Entity 'E' Entity handle
numpy.byte 'b' Binary data
Parameters:
  • name – Tag name
  • size – Size of tag in number of values
  • type – Type object or character representing the tag’s type
Returns:

The created Tag

destroyTag(tag, force)

Destroy a Tag. If force is true and entities still have values set for this tag, the tag is deleted anyway and those values disappear. Otherwise the tag is not deleted if entities still have values set for it.

Parameters:
  • tagTag to delete
  • forced – True if the tag should be deleted even if there are values set for it
getTagHandle(name)

Get the handle of an existing tag with the specified name.

Parameters:
  • name – The name of the tag to find
Returns:

The Tag with the specified name

getAllTags(entities[, out])

Get all the tags associated with a specified entity or entity set.

Parameters:
  • entities – Entity or entity set being queried
Returns:

Array of Tags associated with entities

Forwarding

In addition to the methods listed above, Mesh automatically forwards method calls to the root EntitySet. Thus,

mesh.getEntities(iBase.Type.all, iMesh.Topology.all)

is equivalent to:

mesh.rootSet.getEntities(iBase.Type.all, iMesh.Topology.all)

EntitySet

class itaps.iMesh.EntitySet(set[, instance])

Return a new set referring to the handled contained in set. If set is an itaps.iBase.EntitySet instance, instance must also be specified.

len(entset)

Return the number of entities in the entity set. Equivalent to entset.getNumOfType(iBase.Type.all).

iter(entset)

Return an iterator over the elements in the entity set. Equivalent to entset.iterate().

instance

Return the Mesh instance from which this entity set was created.

isList

Return whether this entity set is ordered.

load(filename[, options])

Load a mesh from a file, adding it to this entity set.

Parameters:
  • filename – File name from which the mesh is to be loaded
  • options – Implementation-specific options string
save(filename[, options])

Save the subset of the mesh contained in this entity set to a file.

Parameters:
  • filename – File name to which the mesh is to be saved
  • options – Implementation-specific options string
getNumOfType(type)

Get the number of entities with the specified type in this entity set.

Parameters:
  • type – Type of entity requested
Returns:

The number of entities in entity set of the requested type

getNumOfTopo(topo)

Get the number of entities with the specified topology in this entity set.

Parameters:
  • topo – Topology of entity requested
Returns:

The number of entities in the entity set of the requested topology

getEntities([type=iBase.Type.all, topo=iMesh.Topology.all, out])

Get entities of a specific type and/or topology in this entity set. All entities of a given type or topology are requested by specifying itaps.iBase.Type.all or itaps.iMesh.Topology.all, respectively.

Parameters:
  • type – Type of entities being requested
  • topo – Topology of entities being requested
Returns:

Array of entity handles from this entity set meeting the requirements of type and topo

getAdjEntIndices(type, topo, adj_type)

Given an entity set and optionally a type or topology, return a tuple containing the entities in the set of type type and topology topo, and an IndexedList containing the adjacent entities of type adj_type.

Parameters:
  • type – Type of entities being requested
  • topo – Topology of entities being requested
  • adjType – Type of adjacent entities being requested
Returns:

A tuple containing the requested entities and the adjacent entities

getNumEntSets([hops=-1])

Get the number of sets contained in this entity set. If this entity set is not the root set, hops indicates the maximum number of contained sets from this set to one of the contained sets, inclusive of this set.

Parameters:
  • hops – Maximum number of contained sets from this set to a contained set, not including itself
Returns:

Number of entity sets found

getEntSets([hops=-1, out])

Get the sets contained in this entity set. If this entity set is not the root set, hops indicates the maximum number of contained sets from this set to one of the contained sets, inclusive of this set.

Parameters:
  • hops – Maximum number of contained sets from this set to a contained set, not including itself
Returns:

Array of entity sets found

add(entities)

Add an entity, entity set, or array of entities to this entity set.

Parameters:
  • entities – The entity, entity set, or array of entities to add
remove(entities)

Remove an entity, entity set, or array of entities from this entity set.

Parameters:
  • entities – The entity, entity set, or array of entities to remove
contains(entities)

Return whether an entity, entity set, or array of entities is contained in this entity set.

Parameters:
  • entities – The entity, entity set, or array of entities to query
Returns:

If entities is an array of entities, an array of booleans corresponding to each element of entities. Otherwise, a single boolean.

isChild(set)

Return whether an entity set is a child of this entity set.

Parameters:
  • set – The entity set to query
Returns:

True if set is a child of this entity set, false otherwise

getNumChildren([hops=-1])

Get the number of child sets linked from this entity set. If hops is non-zero, this represents the maximum hops from this entity set to any child in the count.

Parameters:
  • hops – Maximum hops from this entity set to a child set, not inclusive of the child set
Returns:

Number of children

getNumParents([hops=-1])

Get the number of parent sets linked from this entity set. If hops is non-zero, this represents the maximum hops from this entity set to any parents in the count.

Parameters:
  • hops – Maximum hops from this entity set to a parent set, not inclusive of the parent set
Returns:

Number of parents

getChildren([hops=-1, out])

Get the child sets linked from this entity set. If hops is non-zero, this represents the maximum hops from this entity set to any child in the result.

Parameters:
  • hops – Maximum hops from this entity set to a child set, not inclusive of the child set
Returns:

Array of children

getParents([hops=-1, out])

Get the parents sets linked from this entity set. If hops is non-zero, this represents the maximum hops from this entity set to any parent in the result.

Parameters:
  • hops – Maximum hops from this entity set to a parent set, not inclusive of the parent set
Returns:

Array of parents

addChild(set)

Add set as a child to this entity set.

Parameters:
  • set – The entity set to add
removeChild(set)

Remove set as a child from this entity set.

Parameters:
  • set – The entity set to remove
iterate([type=iBase.Type.all, topo=iMesh.Topology.all, count=1])

Initialize an Iterator over the specified entity type and topology for this entity set. If count is greater than 1, each step of the iteration returns an array of count entities. Equivalent to:

itaps.iMesh.Iterator(self, type, topo, count)
Parameters:
  • type – Type of entities being requested
  • topo – Topology of entities being requested
  • count – Number of entities to return on each step of iteration
Returns:

An Iterator instance

difference(set)

Subtract contents of an entity set from this set. Equivalent to self - set.

Parameters:
  • set – Entity set to subtract
Returns:

Resulting entity set

intersection(set)

Intersect contents of an entity set with this set. Equivalent to self & set.

Parameters:
  • set – Entity set to intersect
Returns:

Resulting entity set

union(set)

Unite contents of an entity set with this set. Equivalent to self | set.

Parameters:
  • set – Entity set to unite
Returns:

Resulting entity set

Iterator

class itaps.iMesh.Iterator(set[, type=iBase.Type.all, topo=iMesh.Topology.all, count=1])

Return a new iterator on the entity set set to iterate over entities of the specified type and topo. If size is greater than 1, each step of the iteration will return an array of size entities. All entities of a given type or topology are requested by specifying itaps.iBase.Type.all or itaps.iMesh.Topology.all, respectively.

Parameters:
  • set – Entity set to iterate over
  • type – Type of entities being requested
  • topo – Topology of entities being requested
  • count – Number of entities to return on each step of iteration
instance

Return the Mesh instance from which this iterator was created.

reset()

Resets the iterator to the beginning.

Tag

class itaps.iMesh.Tag(tag[, instance])

Return a new tag referring to the handled contained in tag. If tag is an itaps.iBase.Tag instance, instance must also be specified.

tag[entities]

Get the tag data for an entity, entity set, or array of entities.

tag[entities] = data

Set the tag data for an entity, entity set, or array of entities to data.

del tag[entities]

Remove the tag data for an entity, entity set, or array of entities.

instance

Return the Mesh instance from which this tag was created.

name

Get the name for this tag.

sizeValues

Get the size in number of values for this tag.

sizeBytes

Get the size in bytes for this tag.

type

Get the data type for this tag as a character code (see above).

get(entities[, out])

Get the tag data for an entity, entity set, or array of entities. This method is equivalent to tag[entities]`.

Parameters:
  • entities – Entity, entity set, or array of entities to get
Returns:

The tag data for entities

getData(entities)

Get the tag data for an entity, entity set, or array of entities. This method is deprecated in favor of tag[entities].

setData(entities, data)

Set the tag data for an entity, entity set, or array of entities to data. This method is deprecated in favor of tag[entities] = data.

remove(entities)

Remove the tag data for an entity, entity set, or array of entities. This method is deprecated in favor of del tag[entities].

Enumerations

class itaps.iMesh.Topology

An enumeration of mesh element topologies corresponding to iMesh_EntityTopology.

point

A general zero-dimensional entity

line_segment

A general one-dimensional entity

polygon

A general two-dimensional element

triangle

A three-sided, two-dimensional element

quadrilateral

A four-sided, two-dimensional element

polyhedron

A general three-dimensional element

tetrahedron

A four-sided, three-dimensional element whose faces are triangles

hexahedron

A six-sided, three-dimensional element whose faces are quadrilaterals

prism

A five-sided, three-dimensional element which has three quadrilateral faces and two triangular faces

pyramid

A five-sided, three-dimensional element which has one quadrilateral face and four triangular faces

septahedron

A hexahedral entity with one collapsed edge

all

Allows the user to request information about all the topology types

Table Of Contents

Previous topic

iBase Interface

Next topic

iGeom Interface

This Page