A Mesquite::Mesh is a collection of mesh elements which are composed of mesh vertices. Intermediate objects are not accessible through this interface (where intermediate objects include things like the faces of a hex, or an element's edges). More...
#include <MeshInterface.hpp>
Public Types | |
enum | TagType { BYTE, BOOL, INT, DOUBLE, HANDLE } |
The type of a tag. More... | |
typedef void * | EntityHandle |
Opaque EntityHandle type and tag type. More... | |
typedef EntityHandle | VertexHandle |
typedef EntityHandle | ElementHandle |
Public Member Functions | |
virtual int | get_geometric_dimension (MsqError &err)=0 |
Returns whether this mesh lies in a 2D or 3D coordinate system. More... | |
virtual void | get_all_sizes (size_t &vertex_count, size_t &element_count, size_t &vertex_use_count, MsqError &err)=0 |
get sizes for calling get_all_mesh More... | |
virtual void | get_all_mesh (VertexHandle *vert_array, size_t vert_len, ElementHandle *elem_array, size_t elem_len, size_t *elem_conn_offsets, size_t offset_len, size_t *elem_conn_indices, size_t index_len, MsqError &err)=0 |
Get entities and connectivity. More... | |
virtual VertexIterator * | vertex_iterator (MsqError &err)=0 |
Returns a pointer to an iterator that iterates over the set of all vertices in this mesh. More... | |
virtual ElementIterator * | element_iterator (MsqError &err)=0 |
Returns a pointer to an iterator that iterates over the set of all top-level elements in this mesh. More... | |
virtual bool | vertex_is_fixed (VertexHandle vertex, MsqError &err)=0 |
Returns true or false, indicating whether the vertex is allowed to be repositioned. More... | |
virtual void | vertices_are_on_boundary (VertexHandle vert_array[], bool on_bnd[], size_t num_vtx, MsqError &err)=0 |
Returns true or false, indicating whether the vertex is on the boundary. More... | |
virtual void | vertices_get_coordinates (const VertexHandle vert_array[], MsqVertex *coordinates, size_t num_vtx, MsqError &err)=0 |
Get/set location of a vertex. More... | |
virtual void | vertex_set_coordinates (VertexHandle vertex, const Vector3D &coordinates, MsqError &err)=0 |
virtual void | vertex_set_byte (VertexHandle vertex, unsigned char byte, MsqError &err)=0 |
Each vertex has a byte-sized flag that can be used to store flags. More... | |
virtual void | vertices_set_byte (VertexHandle *vert_array, unsigned char *byte_array, size_t array_size, MsqError &err)=0 |
virtual void | vertex_get_byte (VertexHandle vertex, unsigned char *byte, MsqError &err)=0 |
Retrieve the byte value for the specified vertex or vertices. More... | |
virtual void | vertices_get_byte (VertexHandle *vertex, unsigned char *byte_array, size_t array_size, MsqError &err)=0 |
virtual size_t | vertex_get_attached_element_count (VertexHandle vertex, MsqError &err)=0 |
Gets the number of elements attached to this vertex. More... | |
virtual void | vertex_get_attached_elements (VertexHandle vertex, ElementHandle *elem_array, size_t sizeof_elem_array, MsqError &err)=0 |
Gets the elements attached to this vertex. More... | |
virtual size_t | element_get_attached_vertex_count (ElementHandle elem, MsqError &err)=0 |
Gets the number of vertices in this element. More... | |
virtual size_t | get_vertex_use_count (ElementHandle *handle_array, size_t num_handles, MsqError &err)=0 |
virtual void | elements_get_attached_vertices (ElementHandle *elem_handles, size_t num_elems, VertexHandle *vert_handles, size_t &sizeof_vert_handles, size_t *csr_data, size_t &sizeof_csr_data, size_t *csr_offsets, MsqError &err)=0 |
Returns the vertices that are part of the topological definition of each element in the "elem_handles" array. More... | |
virtual EntityTopology | element_get_topology (ElementHandle entity_handle, MsqError &err)=0 |
Returns the topology of the given entity. More... | |
virtual void | elements_get_topologies (ElementHandle *element_handle_array, EntityTopology *element_topologies, size_t num_elements, MsqError &err)=0 |
Returns the topologies of the given entities. More... | |
virtual TagHandle | tag_create (const msq_std::string &tag_name, TagType type, unsigned length, const void *default_value, MsqError &err)=0 |
Create a tag. More... | |
virtual void | tag_delete (TagHandle handle, MsqError &err)=0 |
Remove a tag and all corresponding data. More... | |
virtual TagHandle | tag_get (const msq_std::string &name, MsqError &err)=0 |
Get handle for existing tag, by name. More... | |
virtual void | tag_properties (TagHandle handle, msq_std::string &name_out, TagType &type_out, unsigned &length_out, MsqError &err)=0 |
Get properites of tag. More... | |
virtual void | tag_set_element_data (TagHandle handle, size_t num_elems, const ElementHandle *elem_array, const void *tag_data, MsqError &err)=0 |
Set tag values on elements. More... | |
virtual void | tag_set_vertex_data (TagHandle handle, size_t num_elems, const VertexHandle *node_array, const void *tag_data, MsqError &err)=0 |
Set tag values on vertices. More... | |
virtual void | tag_get_element_data (TagHandle handle, size_t num_elems, const ElementHandle *elem_array, void *tag_data, MsqError &err)=0 |
Get tag values on elements. More... | |
virtual void | tag_get_vertex_data (TagHandle handle, size_t num_elems, const VertexHandle *node_array, void *tag_data, MsqError &err)=0 |
Get tag values on vertices. More... | |
virtual void | release_entity_handles (EntityHandle *handle_array, size_t num_handles, MsqError &err)=0 |
Tells the mesh that the client is finished with a given entity handle. More... | |
virtual void | release ()=0 |
Instead of deleting a Mesh when you think you are done, call release(). More... | |
Protected Member Functions | |
virtual | ~Mesh () |
Don't allow a Mesh to be deleted directly. More... | |
A Mesquite::Mesh is a collection of mesh elements which are composed of mesh vertices. Intermediate objects are not accessible through this interface (where intermediate objects include things like the faces of a hex, or an element's edges).
Definition at line 73 of file MeshInterface.hpp.
typedef EntityHandle ElementHandle |
Definition at line 86 of file MeshInterface.hpp.
typedef void* EntityHandle |
Opaque EntityHandle type and tag type.
Definition at line 78 of file MeshInterface.hpp.
typedef EntityHandle VertexHandle |
Definition at line 85 of file MeshInterface.hpp.
enum TagType |
The type of a tag.
Enumerator | |
---|---|
BYTE | |
BOOL | |
INT | |
DOUBLE | |
HANDLE |
Definition at line 274 of file MeshInterface.hpp.
|
inlineprotectedvirtual |
|
pure virtual |
Gets the number of vertices in this element.
This data can also be found by querying the element's topology and getting the number of vertices per element for that topology type.
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Returns the topology of the given entity.
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Returns a pointer to an iterator that iterates over the set of all top-level elements in this mesh.
The calling code should delete the returned iterator when it is finished with it. If elements are added or removed from the Mesh after obtaining an iterator, the behavior of that iterator is undefined.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Returns the vertices that are part of the topological definition of each element in the "elem_handles" array.
When this function is called, the following must be true:
When this function returns, adjacency information will be stored in csr format:
As an example of how to use this data, you can get the handle of the first vertex in element #3 like this:
and the second vertex of element #3 like this:
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Returns the topologies of the given entities.
The "entity_topologies" array must be at least "num_elements" in size.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Get entities and connectivity.
Get vertex handles, element handles, and connectivty for active mesh. Use get_all_sizes to determine required array sizes.
vert_array | Array to store vertex handles in |
vert_len | Length of vert_array |
elem_array | Array to store element handles in |
elem_len | Length of elem_array |
elem_conn_offsets | Offsets into elem_conn_indices at which the connectivity data for each element begins. |
offset_len | Length of elem_conn_offsets. Should be elem_len + 1. |
elem_conn_indices | Indices into vert_array |
index_len | Length of elem_conn_indices. |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
get sizes for calling get_all_mesh
Get counts of entities in mesh.
vertex_count | - Number of vertices connected to active mesh |
element_count | - Number of elements in active mesh |
vertex_use_count | - Number of vertex uses (sum of the length of the connectivity list for all elements in active.) |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Returns whether this mesh lies in a 2D or 3D coordinate system.
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
Referenced by MeshSet::add_mesh().
|
pure virtual |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Instead of deleting a Mesh when you think you are done, call release().
In simple cases, the implementation could just call the destructor. More sophisticated implementations may want to keep the Mesh object to live longer than Mesquite is using it.
Implemented in MesqPane, MeshTSTTImpl, MesqPane, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Tells the mesh that the client is finished with a given entity handle.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Create a tag.
Create a user-defined data type that can be attached to any element or vertex in the mesh. For an opaque or undefined type, use type=BYTE and length=sizeof(..).
tag_name | A unique name for the data object |
type | The type of the data |
length | Number of values per entity (1->scalar, >1 ->vector) |
default_value | Default value to assign to all entities - may be NULL |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
Referenced by CornerTagHandles::get_handle().
Remove a tag and all corresponding data.
Delete a tag.
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
Get handle for existing tag, by name.
Check for the existance of a tag given it's name and if it exists return a handle for it. If the specified tag does not exist, zero should be returned WITHOUT flagging an error.
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
Referenced by CornerTagHandles::get_handle().
|
pure virtual |
Get tag values on elements.
Get the value of a tag for a list of mesh elements.
handle | The tag |
num_elems | Length of elem_array |
elem_array | Array of elements for which to get the tag value. |
tag_data | Return buffer in which to copy tag data, contiguous in memory. This data is expected to be num_elems*tag_length*sizeof(tag_type) bytes. |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
Referenced by CornerTagHandles::save_load_tags().
|
pure virtual |
Get tag values on vertices.
Get the value of a tag for a list of mesh vertices.
handle | The tag |
num_elems | Length of elem_array |
elem_array | Array of vertices for which to get the tag value. |
tag_data | Return buffer in which to copy tag data, contiguous in memory. This data is expected to be num_elems*tag_length*sizeof(tag_type) bytes. |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Get properites of tag.
Get data type and number of values per entity for tag.
handle | Tag to get properties of. |
name_out | Passed back tag name. |
type_out | Passed back tag type. |
length_out | Passed back number of values per entity. |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
Referenced by CornerTagHandles::get_handle().
|
pure virtual |
Set tag values on elements.
Set the value of a tag for a list of mesh elements.
handle | The tag |
num_elems | Length of elem_array |
elem_array | Array of elements for which to set the tag value. |
tag_data | Tag data for each element, contiguous in memory. This data is expected to be num_elems*tag_length*sizeof(tag_type) bytes. |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
Referenced by CornerTagHandles::save_load_tags().
|
pure virtual |
Set tag values on vertices.
Set the value of a tag for a list of mesh vertices.
handle | The tag |
num_elems | Length of node_array |
node_array | Array of vertices for which to set the tag value. |
tag_data | Tag data for each element, contiguous in memory. This data is expected to be num_elems*tag_length*sizeof(tag_type) bytes. |
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Gets the number of elements attached to this vertex.
Useful to determine how large the "elem_array" parameter of the vertex_get_attached_elements() function must be.
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Gets the elements attached to this vertex.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Retrieve the byte value for the specified vertex or vertices.
The byte value is 0 if it has not yet been set via one of the *_set_byte() functions.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Returns true or false, indicating whether the vertex is allowed to be repositioned.
True indicates that the vertex is fixed and cannot be moved. Note that this is a read-only property; this flag can't be modified by users of the Mesquite::Mesh interface.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Returns a pointer to an iterator that iterates over the set of all vertices in this mesh.
The calling code should delete the returned iterator when it is finished with it. If vertices are added or removed from the Mesh after obtaining an iterator, the behavior of that iterator is undefined.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Each vertex has a byte-sized flag that can be used to store flags.
This byte's value is neither set nor used by the mesh implementation. It is intended to be used by Mesquite algorithms. Until a vertex's byte has been explicitly set, its value is 0.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Returns true or false, indicating whether the vertex is on the boundary.
Boundary nodes may be treated as a special case by some algorithms or culling methods. Note that this is a read-only property; this flag can't be modified by users of the Mesquite::Mesh interface.
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.
|
pure virtual |
Get/set location of a vertex.
Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.
|
pure virtual |
Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.