38 #ifndef MESQUITE_MESH_IMPL_HPP
39 #define MESQUITE_MESH_IMPL_HPP
43 #ifdef MSQ_USE_OLD_STD_HEADERS
54 struct TagDescription;
88 size_t& element_count,
89 size_t& vertex_use_count,
112 size_t* elem_conn_offsets,
size_t offset_len,
113 size_t* elem_conn_indices,
size_t index_len,
118 size_t elem_array_length,
169 unsigned char *byte_array,
180 unsigned char *byte_array,
194 size_t sizeof_elem_array,
243 size_t &sizeof_vert_handles,
245 size_t &sizeof_csr_data,
251 size_t sizeof_vert_handles,
281 const void* default_value,
304 msq_std::string& name_out,
306 unsigned& length_out,
322 const void* tag_data,
338 const void* tag_data,
430 long num_data_to_read,
436 size_t per_elem,
size_t num_elem,
464 const void* data,
size_t count,
Iterates through a set of entities. An EntityIterator is typically obtained via Mesh::vertex_iterator...
void * vtk_read_tensor_attrib(FileTokenizer &file, long count, TagDescription &tag_out, MsqError &err)
Read tensor (3x3 matrix) data Initializes size and type fields of passed TagDescroption.
virtual void vertices_set_byte(VertexHandle *vert_array, unsigned char *byte_array, size_t array_size, MsqError &err)
void * vtk_read_attrib_data(FileTokenizer &file, long num_data_to_read, TagDescription &tag_out, MsqError &err)
Read actual data for both vtk_read_point_data and vtk_read_cell_data Initializes all fields of passed...
void * vtk_read_texture_attrib(FileTokenizer &file, long count, TagDescription &tag_out, MsqError &err)
Read texture attribute data Initializes size and type fields of passed TagDescroption.
void vtk_read_field(FileTokenizer &file, MsqError &err)
Read file-level field data.
void * vtk_read_color_attrib(FileTokenizer &file, long count, TagDescription &tag_out, MsqError &err)
Read color attribute data Initializes size and type fields of passed TagDescroption.
virtual size_t get_vertex_use_count(ElementHandle *elem_array, size_t elem_array_length, MsqError &err)
Get sum of number of vertices in each element.
Used to hold the error state and return it to the application.
TagType
The type of a tag.
virtual TagHandle tag_create(const msq_std::string &tag_name, TagType type, unsigned length, const void *default_value, MsqError &err)
Create a tag.
virtual void tag_set_vertex_data(TagHandle handle, size_t num_elems, const VertexHandle *node_array, const void *tag_data, MsqError &err)
Set tag values on vertices.
virtual void vertices_get_byte(VertexHandle *vertex, unsigned char *byte_array, size_t array_size, MsqError &err)
void vtk_read_dataset(FileTokenizer &file, MsqError &err)
Read a data block from the file.
void vtk_read_unstructured_grid(FileTokenizer &file, MsqError &err)
Read unstructured mesh.
Class to store mesh representation for MeshImpl.
EntityHandle VertexHandle
virtual void vertex_set_byte(VertexHandle vertex, unsigned char byte, MsqError &err)
Each vertex has a byte-sized flag that can be used to store flags.
virtual void vertex_get_attached_elements(VertexHandle vertex, ElementHandle *elem_array, size_t sizeof_elem_array, MsqError &err)
Gets the elements attached to this vertex.
virtual void vertex_get_byte(VertexHandle vertex, unsigned char *byte, MsqError &err)
Retrieve the byte value for the specified vertex or vertices.
EntityHandle ElementHandle
This file contains the Mesquite mesh interface. Many users will want to implement a concrete class de...
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
void element_get_connectivity(ElementHandle element, VertexHandle *vert_handles, size_t sizeof_vert_handles, MsqError &err)
void * EntityHandle
Opaque EntityHandle type and tag type.
virtual VertexIterator * vertex_iterator(MsqError &err)
Returns a pointer to an iterator that iterates over the set of all vertices in this mesh...
void * vtk_read_vector_attrib(FileTokenizer &file, long count, TagDescription &tag_out, MsqError &err)
Read vector or normal attribute data Initializes size and type fields of passed TagDescroption.
virtual void vertices_get_coordinates(const Mesh::VertexHandle vert_array[], Mesquite::MsqVertex *coordinates, size_t num_vtx, MsqError &err)
Get/set location of a vertex.
void write_vtk(const char *out_filename, Mesquite::MsqError &err)
double length(Vector3D *const v, int n)
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)
Returns the vertices that are part of the topological definition of each element in the "elem_handles...
virtual void tag_get_element_data(TagHandle handle, size_t num_elems, const ElementHandle *elem_array, void *tag_data, MsqError &err)
Get tag values on elements.
virtual void get_all_sizes(size_t &vertex_count, size_t &element_count, size_t &vertex_use_count, MsqError &err)
get sizes for calling get_all_mesh
void * vtk_read_typed_data(FileTokenizer &file, int type, size_t per_elem, size_t num_elem, TagDescription &tag_out, MsqError &err)
Read a 2-D array of data of the specified type from the file Initializes size and type fields of pass...
virtual void tag_delete(TagHandle handle, MsqError &err)
Remove a tag and all corresponding data.
void read_exodus(const char *in_filename, Mesquite::MsqError &err)
virtual void tag_set_element_data(TagHandle handle, size_t num_elems, const ElementHandle *elem_array, const void *tag_data, MsqError &err)
Set tag values on elements.
virtual size_t vertex_get_attached_element_count(VertexHandle vertex, MsqError &err)
Gets the number of elements attached to this vertex.
void vtk_create_structured_elems(const long *dims, MsqError &err)
Helper function for readers of structured mesh - create elements.
void vtk_read_polygons(FileTokenizer &file, MsqError &err)
Helper function for vtk_read_polydata - reads polygon subsection.
int numCoords
Coordinate values per vertex.
void * vtk_read_scalar_attrib(FileTokenizer &file, long count, TagDescription &tag_out, MsqError &err)
Read scalar attribute data Initializes size and type fields of passed TagDescroption.
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).
virtual bool vertex_is_fixed(VertexHandle vertex, MsqError &err)
Returns true or false, indicating whether the vertex is allowed to be repositioned.
MeshImpl is a Mesquite implementation of the Mesh interface. Applications can also provide their own ...
void vtk_read_cell_data(FileTokenizer &file, MsqError &err)
Read attribute data for elements.
virtual int get_geometric_dimension(MsqError &err)
Returns whether this mesh lies in a 2D or 3D coordinate system.
void vtk_write_attrib_data(msq_stdio::ostream &file, const TagDescription &desc, const void *data, size_t count, MsqError &err) const
Write tag data to VTK attributes.
virtual void vertices_are_on_boundary(VertexHandle vert_array[], bool on_bnd[], size_t num_vtx, MsqError &err)
Returns true or false, indicating whether the vertex is on the boundary.
void vtk_read_polydata(FileTokenizer &file, MsqError &err)
Read polydata mesh.
virtual ElementIterator * element_iterator(MsqError &err)
Returns a pointer to an iterator that iterates over the set of all top-level elements in this mesh...
virtual EntityTopology element_get_topology(ElementHandle entity_handle, MsqError &err)
Returns the topology of the given entity.
virtual void tag_properties(TagHandle handle, msq_std::string &name_out, TagType &type_out, unsigned &length_out, MsqError &err)
Get properites of tag.
void read_vtk(const char *in_filename, Mesquite::MsqError &err)
void vtk_read_point_data(FileTokenizer &file, MsqError &err)
Read attribute data for vertices.
void * TagHandle
Type used to refer to a tag defintion.
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)
Get entities and connectivity.
virtual void release()
Instead of deleting a Mesh when you think you are done, call release().
virtual void elements_get_topologies(ElementHandle *element_handle_array, EntityTopology *element_topologies, size_t num_elements, MsqError &err)
Returns the topologies of the given entities.
MsqVertex is the Mesquite object that stores information about the vertices in the mesh...
void vtk_read_structured_grid(FileTokenizer &file, MsqError &err)
Read structured grid mesh.
virtual size_t element_get_attached_vertex_count(ElementHandle elem, MsqError &err)
Gets the number of vertices in this element.
void write_exodus(const char *out_filename, Mesquite::MsqError &err)
Writes an exodus file of the mesh.
void vtk_read_structured_points(FileTokenizer &file, MsqError &err)
Read structured point mesh.
virtual TagHandle tag_get(const msq_std::string &name, MsqError &err)
Get handle for existing tag, by name.
void vtk_read_rectilinear_grid(FileTokenizer &file, MsqError &err)
Read rectilinear grid structured mesh.
virtual void tag_get_vertex_data(TagHandle handle, size_t num_elems, const VertexHandle *node_array, void *tag_data, MsqError &err)
Get tag values on vertices.
virtual void vertex_set_coordinates(VertexHandle vertex, const Vector3D &coordinates, MsqError &err)
virtual void release_entity_handles(EntityHandle *handle_array, size_t num_handles, MsqError &err)
Tells the mesh that the client is finished with a given entity handle.
Parse a file as space-separated tokens.