15 #include "../config/config.hpp"
18 #ifdef MFEM_USE_MESQUITE
20 #include "Mesquite_all_headers.hpp"
25 using namespace Mesquite;
32 struct MfemTagDescription {
38 inline MfemTagDescription( std::string n,
41 : name(n), type(t), size(s){}
43 inline MfemTagDescription( )
44 : type(Mesh::BYTE), size(0) {}
46 inline bool operator==(
const MfemTagDescription& o)
const
47 {
return name == o.name && type == o.type && size == o.size; }
48 inline bool operator!=(
const MfemTagDescription& o)
const
49 {
return name != o.name || type != o.type || size != o.size; }
62 ~MeshTags() { clear(); }
70 const MfemTagDescription
desc;
94 Mesh::TagType type,
unsigned length,
95 void* default_val = 0)
96 : desc(name, type, length*size_from_tag_type(type)),
97 elementData(0), elementCount(0),
98 vertexData(0), vertexCount(0),
99 defaultValue(default_val) {}
104 inline TagData(
const MfemTagDescription& descr )
105 : desc(descr), elementData(0), elementCount(0),
106 vertexData(0), vertexCount(0),
113 static size_t size_from_tag_type( Mesh::TagType type );
119 size_t handle(
const std::string& name, MsqError& err )
const;
122 const MfemTagDescription& properties(
size_t tag_handle, MsqError& err )
const;
132 size_t create(
const std::string& name,
142 size_t create(
const MfemTagDescription& desc,
147 void destroy(
size_t tag_index, MsqError& err );
150 void set_element_data(
size_t tag_handle,
152 const size_t* elem_indices,
153 const void* tag_data,
157 void set_vertex_data(
size_t tag_handle,
159 const size_t* elem_indices,
160 const void* tag_data,
164 void get_element_data(
size_t tag_handle,
166 const size_t* elem_indices,
168 MsqError& err )
const;
171 void get_vertex_data(
size_t tag_handle,
173 const size_t* elem_indices,
175 MsqError& err )
const;
197 TagIterator tag_begin();
198 TagIterator tag_end() {
return TagIterator(
this,tagList.size()); }
201 bool tag_has_vertex_data(
size_t index, MsqError& err ) ;
203 bool tag_has_element_data(
size_t index, MsqError& err ) ;
207 friend class MeshTags::TagIterator;
209 std::vector<TagData*> tagList;
223 std::vector<char> mByte;
224 std::vector<bool> mFixed;
234 int get_geometric_dimension(MsqError &err);
237 void get_all_elements(std::vector<ElementHandle>& elements,
239 void get_all_vertices(std::vector<VertexHandle>& vertices,
243 void vertices_get_coordinates(
const VertexHandle vert_array[],
244 MsqVertex* coordinates,
247 void vertex_set_coordinates(VertexHandle vertex,
248 const Vector3D &coordinates,
252 void vertex_set_byte(VertexHandle vertex,
255 void vertices_set_byte(
const VertexHandle *vert_array,
256 const unsigned char *byte_array,
259 void vertices_get_fixed_flag(
const VertexHandle vert_array[],
260 std::vector<bool>& fixed_flag_array,
263 void vertices_set_fixed_flag(
const VertexHandle vert_array[],
264 const std::vector< bool > &fixed_flag_array,
267 void vertex_get_byte(
const VertexHandle vertex,
270 void vertices_get_byte(
const VertexHandle *vertex,
271 unsigned char *byte_array,
275 void vertices_get_attached_elements(
const VertexHandle* vertex_array,
277 std::vector<ElementHandle>& elements,
278 std::vector<size_t>& offsets,
281 void elements_get_attached_vertices(
const ElementHandle *elem_handles,
283 std::vector<VertexHandle>& vert_handles,
284 std::vector<size_t>& offsets,
288 void elements_get_topologies(
const ElementHandle *element_handle_array,
289 EntityTopology *element_topologies,
296 void tag_attributes();
300 std::vector<bool>& slaved_flag_array,
304 TagHandle tag_create(
const std::string& tag_name,
305 TagType type,
unsigned length,
306 const void* default_value,
309 void tag_delete( TagHandle handle, MsqError& err );
311 TagHandle tag_get(
const std::string& name,
314 void tag_properties( TagHandle handle,
315 std::string& name_out,
317 unsigned& length_out,
320 void tag_set_element_data( TagHandle handle,
322 const ElementHandle* elem_array,
323 const void* tag_data,
326 void tag_set_vertex_data ( TagHandle handle,
328 const VertexHandle* node_array,
329 const void* tag_data,
332 void tag_get_element_data( TagHandle handle,
334 const ElementHandle* elem_array,
338 void tag_get_vertex_data ( TagHandle handle,
340 const VertexHandle* node_array,
Class for grid function - Vector with associated FE space.
Abstract finite element space.
void vertices_get_slaved_flag(const VertexHandle vert_array[], std::vector< bool > &slaved_flag_array, size_t num_vtx, MsqError &err)
Abstract data type element.
void release_entity_handles(const EntityHandle *handle_array, size_t num_handles, MsqError &err)