Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Mesh Class Referenceabstract

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>

Inheritance diagram for Mesh:

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 VertexIteratorvertex_iterator (MsqError &err)=0
 Returns a pointer to an iterator that iterates over the set of all vertices in this mesh. More...
 
virtual ElementIteratorelement_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...
 

Detailed Description

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.

Member Typedef Documentation

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.

Definition at line 85 of file MeshInterface.hpp.

Member Enumeration Documentation

enum TagType

The type of a tag.

Enumerator
BYTE 
BOOL 
INT 
DOUBLE 
HANDLE 

Definition at line 274 of file MeshInterface.hpp.

Constructor & Destructor Documentation

virtual ~Mesh ( )
inlineprotectedvirtual

Don't allow a Mesh to be deleted directly.

Definition at line 406 of file MeshInterface.hpp.

407  {}

Member Function Documentation

virtual size_t element_get_attached_vertex_count ( ElementHandle  elem,
MsqError err 
)
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.

virtual EntityTopology element_get_topology ( ElementHandle  entity_handle,
MsqError err 
)
pure virtual

Returns the topology of the given entity.

Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.

virtual ElementIterator* element_iterator ( MsqError err)
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.

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 
)
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:

  1. "elem_handles" points at an array of "num_elems" element handles.
  2. "vert_handles" points at an array of size "sizeof_vert_handles"
  3. "csr_data" points at an array of size "sizeof_csr_data"
  4. "csr_offsets" points at an array of size "num_elems+1"

When this function returns, adjacency information will be stored in csr format:

  1. "vert_handles" stores handles to all vertices found in one or more of the elements. Each vertex appears only once in "vert_handles", even if it is in multiple elements.
  2. "sizeof_vert_handles" is set to the number of vertex handles placed into "vert_handles".
  3. "sizeof_csr_data" is set to the total number of vertex uses (for example, sizeof_csr_data = 6 in the case of 2 TRIANGLES, even if the two triangles share some vertices).
  4. "csr_offsets" is filled such that csr_offset[i] indicates the location of entity i's first adjacency in "csr_data". The number of vertices in element i is equal to csr_offsets[i+1] - csr_offsets[i]. For this reason, csr_offsets[num_elems] is set to the new value of "sizeof_csr_data".
  5. "csr_data" stores integer offsets which give the location of each adjacency in the "vert_handles" array.

As an example of how to use this data, you can get the handle of the first vertex in element #3 like this:

VertexHandle vh = vert_handles[ csr_data[ csr_offsets[3] ] ]

and the second vertex of element #3 like this:

VertexHandle vh = vert_handles[ csr_data[ csr_offsets[3]+1 ] ]

Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.

virtual void elements_get_topologies ( ElementHandle element_handle_array,
EntityTopology element_topologies,
size_t  num_elements,
MsqError err 
)
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.

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 
)
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.

Parameters
vert_arrayArray to store vertex handles in
vert_lenLength of vert_array
elem_arrayArray to store element handles in
elem_lenLength of elem_array
elem_conn_offsetsOffsets into elem_conn_indices at which the connectivity data for each element begins.
offset_lenLength of elem_conn_offsets. Should be elem_len + 1.
elem_conn_indicesIndices into vert_array
index_lenLength of elem_conn_indices.

Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.

virtual void get_all_sizes ( size_t &  vertex_count,
size_t &  element_count,
size_t &  vertex_use_count,
MsqError err 
)
pure virtual

get sizes for calling get_all_mesh

Get counts of entities in mesh.

Parameters
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.

virtual int get_geometric_dimension ( MsqError err)
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().

Here is the caller graph for this function:

virtual size_t get_vertex_use_count ( ElementHandle handle_array,
size_t  num_handles,
MsqError err 
)
pure virtual

Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.

virtual void release ( )
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.

virtual void release_entity_handles ( EntityHandle handle_array,
size_t  num_handles,
MsqError err 
)
pure virtual

Tells the mesh that the client is finished with a given entity handle.

Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.

virtual TagHandle tag_create ( const msq_std::string &  tag_name,
TagType  type,
unsigned  length,
const void *  default_value,
MsqError err 
)
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(..).

Parameters
tag_nameA unique name for the data object
typeThe type of the data
lengthNumber of values per entity (1->scalar, >1 ->vector)
default_valueDefault value to assign to all entities - may be NULL
Returns
- Handle for tag definition

Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.

Referenced by CornerTagHandles::get_handle().

Here is the caller graph for this function:

virtual void tag_delete ( TagHandle  handle,
MsqError err 
)
pure virtual

Remove a tag and all corresponding data.

Delete a tag.

Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.

virtual TagHandle tag_get ( const msq_std::string &  name,
MsqError err 
)
pure virtual

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().

Here is the caller graph for this function:

virtual void tag_get_element_data ( TagHandle  handle,
size_t  num_elems,
const ElementHandle elem_array,
void *  tag_data,
MsqError err 
)
pure virtual

Get tag values on elements.

Get the value of a tag for a list of mesh elements.

Parameters
handleThe tag
num_elemsLength of elem_array
elem_arrayArray of elements for which to get the tag value.
tag_dataReturn 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().

Here is the caller graph for this function:

virtual void tag_get_vertex_data ( TagHandle  handle,
size_t  num_elems,
const VertexHandle node_array,
void *  tag_data,
MsqError err 
)
pure virtual

Get tag values on vertices.

Get the value of a tag for a list of mesh vertices.

Parameters
handleThe tag
num_elemsLength of elem_array
elem_arrayArray of vertices for which to get the tag value.
tag_dataReturn 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.

virtual void tag_properties ( TagHandle  handle,
msq_std::string &  name_out,
TagType type_out,
unsigned &  length_out,
MsqError err 
)
pure virtual

Get properites of tag.

Get data type and number of values per entity for tag.

Parameters
handleTag to get properties of.
name_outPassed back tag name.
type_outPassed back tag type.
length_outPassed back number of values per entity.

Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.

Referenced by CornerTagHandles::get_handle().

Here is the caller graph for this function:

virtual void tag_set_element_data ( TagHandle  handle,
size_t  num_elems,
const ElementHandle elem_array,
const void *  tag_data,
MsqError err 
)
pure virtual

Set tag values on elements.

Set the value of a tag for a list of mesh elements.

Parameters
handleThe tag
num_elemsLength of elem_array
elem_arrayArray of elements for which to set the tag value.
tag_dataTag 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().

Here is the caller graph for this function:

virtual void tag_set_vertex_data ( TagHandle  handle,
size_t  num_elems,
const VertexHandle node_array,
const void *  tag_data,
MsqError err 
)
pure virtual

Set tag values on vertices.

Set the value of a tag for a list of mesh vertices.

Parameters
handleThe tag
num_elemsLength of node_array
node_arrayArray of vertices for which to set the tag value.
tag_dataTag 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.

virtual size_t vertex_get_attached_element_count ( VertexHandle  vertex,
MsqError err 
)
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.

virtual void vertex_get_attached_elements ( VertexHandle  vertex,
ElementHandle elem_array,
size_t  sizeof_elem_array,
MsqError err 
)
pure virtual

Gets the elements attached to this vertex.

Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.

virtual void vertex_get_byte ( VertexHandle  vertex,
unsigned char *  byte,
MsqError err 
)
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.

virtual bool vertex_is_fixed ( VertexHandle  vertex,
MsqError err 
)
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.

virtual VertexIterator* vertex_iterator ( MsqError err)
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.

virtual void vertex_set_byte ( VertexHandle  vertex,
unsigned char  byte,
MsqError err 
)
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.

virtual void vertex_set_coordinates ( VertexHandle  vertex,
const Vector3D coordinates,
MsqError err 
)
pure virtual

Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.

virtual void vertices_are_on_boundary ( VertexHandle  vert_array[],
bool  on_bnd[],
size_t  num_vtx,
MsqError err 
)
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.

virtual void vertices_get_byte ( VertexHandle vertex,
unsigned char *  byte_array,
size_t  array_size,
MsqError err 
)
pure virtual

Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.

virtual void vertices_get_coordinates ( const VertexHandle  vert_array[],
MsqVertex coordinates,
size_t  num_vtx,
MsqError err 
)
pure virtual

Get/set location of a vertex.

Implemented in MeshTSTTImpl, MeshImpl, and MeshImpl.

virtual void vertices_set_byte ( VertexHandle vert_array,
unsigned char *  byte_array,
size_t  array_size,
MsqError err 
)
pure virtual

Implemented in MeshTSTTImpl, MesqPane, MeshImpl, and MeshImpl.


The documentation for this class was generated from the following file: