27 #ifndef MESQUITE_MESH_IMPL_DATA_HPP
28 #define MESQUITE_MESH_IMPL_DATA_HPP
34 #ifdef MSQ_USE_OLD_STD_HEADERS
40 #include <sys/types.h>
67 void copy_mesh(
size_t* vertex_handle_array,
68 size_t* element_hanlde_array,
69 size_t* element_conn_offsets,
70 size_t* element_conn_indices );
142 const msq_std::vector<size_t>& vertices,
149 size_t add_element(
const msq_std::vector<size_t>& vertices,
160 msq_std::vector<size_t>& vertices,
161 msq_std::vector<size_t>& vertex_indices,
162 msq_std::vector<size_t>& index_offsets,
171 msq_std::vector<size_t>::const_iterator nodes_end,
172 msq_std::vector<size_t>& elems_out,
181 void skin( msq_std::vector<size_t>& sides,
MsqError& err );
194 const msq_std::vector<size_t>& nodes,
203 const msq_std::vector<size_t>& vertices,
Iterates through a set of entities. An EntityIterator is typically obtained via Mesh::vertex_iterator...
unsigned char get_vertex_byte(size_t index, MsqError &err) const
Get vertex byte.
void all_elements(msq_std::vector< size_t > &list, MsqError &err) const
Get all elements.
Vertex(const Vector3D &pos, bool is_fixed)
void fix_vertex(size_t index, bool flag, MsqError &err)
Set vertex fixed flag.
EntityTopology topology
element type
size_t max_vertex_index() const
MeshImplElemIter(MeshImplData *data)
Used to hold the error state and return it to the application.
virtual bool is_at_end() const
Returns false until the iterator has been advanced PAST the last entity.
virtual void operator++()
++iterator
void copy_higher_order(msq_std::vector< size_t > &mid_nodes, msq_std::vector< size_t > &vertices, msq_std::vector< size_t > &vertex_indices, msq_std::vector< size_t > &index_offsets, MsqError &err)
Get all mid-nodes and their adjacent corner vertices.
virtual Mesh::VertexHandle operator*() const
*iterator.
Class to store mesh representation for MeshImpl.
const msq_std::vector< size_t > & element_connectivity(size_t index, MsqError &err) const
Get element connectivity list, including mid-nodes.
msq_std::vector< Element > elementList
Array of elements.
EntityHandle VertexHandle
size_t num_vertices() const
Get number of vertices, does not include mid-nodes.
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...
unsigned midcount
num elements referencing this as a mid-node
void get_adjacent_elements(msq_std::vector< size_t >::const_iterator nodes, msq_std::vector< size_t >::const_iterator nodes_end, msq_std::vector< size_t > &elems_out, MsqError &err)
Get elements adjacent to ALL of the passed nodes.
void reset_element(size_t index, const msq_std::vector< size_t > &vertices, EntityTopology topology, MsqError &err)
Clear element at specified index (if any) including connectivity and adjacency data, and re-initialize with passed data.
msq_std::vector< size_t > deletedElementList
List of unused indices in element list.
virtual void operator++()
++iterator
virtual ~MeshImplVertIter()
void allocate_vertices(size_t count, MsqError &err)
Allocate space for specified number of vertices.
size_t add_vertex(const Vector3D &coords, bool fixed, MsqError &err)
Add a new vertex.
void clear()
Clear all data.
virtual void restart()
Moves the iterator back to the first entity in the list.
bool has_adjacent_elements(size_t elem, const msq_std::vector< size_t > &nodes, MsqError &err)
helper function for skinning
EntityTopology element_topology(size_t index, MsqError &err) const
Get element type.
const msq_std::vector< size_t > & vertex_adjacencies(size_t index, MsqError &err) const
Get vertex adjacency list.
void skin(msq_std::vector< size_t > &sides, MsqError &err)
Skin mesh.
Struct holding an element.
virtual Mesh::ElementHandle operator*() const
*iterator.
VertexIterator for MeshImpl.
virtual bool is_at_end() const
Returns false until the iterator has been advanced PAST the last entity.
void set_vertex_coords(size_t index, const Vector3D &coords, MsqError &err)
Set vertex coordinates.
virtual ~MeshImplElemIter()
msq_std::vector< size_t > deletedVertexList
List of unused indices in vertex list.
bool is_vertex_valid(size_t index) const
Check if passed vertex index is valid.
size_t max_element_index() const
bool valid
is a valid (initialized) array entry
size_t add_element(const msq_std::vector< size_t > &vertices, EntityTopology topology, MsqError &err)
Add a new element.
const Vector3D & get_vertex_coords(size_t index, MsqError &err) const
Get vertex coordinates.
msq_std::vector< size_t > adjacencies
indices of adjacent elements
void set_vertex_byte(size_t index, unsigned char value, MsqError &err)
Set vertex byte.
bool vertex_is_fixed(size_t index, MsqError &err) const
Get vertex fixed flag.
msq_std::vector< size_t > connectivity
list of vertex indices
virtual void restart()
Moves the iterator back to the first entity in the list.
void delete_vertex(size_t index, MsqError &err)
Delete a vertex - may not be referenced by any element.
bool is_mid_node(size_t index) const
Check if the specified node is used as a mid-node on any element.
void allocate_elements(size_t count, MsqError &err)
Allocate space for specified number of elements.
ElementIterator for MeshImpl.
void reset_vertex(size_t index, const Vector3D &coords, bool fixed, MsqError &err)
Set allocated but unset veretx to specified values.
void copy_mesh(size_t *vertex_handle_array, size_t *element_hanlde_array, size_t *element_conn_offsets, size_t *element_conn_indices)
Copy internal representation into CSR rep Does not include mid-nodes.
void all_vertices(msq_std::vector< size_t > &list, MsqError &err) const
Get all vertices, including mid-nodes.
msq_std::vector< Vertex > vertexList
Array of vertices.
void clear_element(size_t index, MsqError &err)
Clear existing element data.
size_t num_vertex_uses() const
Get number of vertex uses (sum of connectivity length for all elements) Does not count mid-nodes...
void set_element(size_t index, const msq_std::vector< size_t > &vertices, EntityTopology topology, MsqError &err)
Set cleared element.
void delete_element(size_t index, MsqError &err)
Delete an element.
MeshImplVertIter(MeshImplData *data)
bool is_corner_node(size_t index) const
Check if the specified node is used as a corner vertex on any element.
bool is_element_valid(size_t index) const
Check if passed element index is valid.
size_t num_elements() const
Get number of elements.