15 #include "../config/config.hpp"
18 #ifdef MFEM_USE_MESQUITE
20 #include "Mesquite_all_headers.hpp"
25 using namespace Mesquite;
32 struct MfemTagDescription
39 inline MfemTagDescription( std::string n,
42 : name(n), type(t), size(s) {}
44 inline MfemTagDescription( )
45 : type(Mesh::BYTE), size(0) {}
47 inline bool operator==(
const MfemTagDescription& o)
const
48 {
return name == o.name && type == o.type && size == o.size; }
49 inline bool operator!=(
const MfemTagDescription& o)
const
50 {
return name != o.name || type != o.type || size != o.size; }
64 ~MeshTags() { clear(); }
73 const MfemTagDescription
desc;
97 Mesh::TagType type,
unsigned length,
98 void* default_val = 0)
99 : desc(name, type, length*size_from_tag_type(type)),
100 elementData(0), elementCount(0),
101 vertexData(0), vertexCount(0),
102 defaultValue(default_val) {}
107 inline TagData(
const MfemTagDescription& descr )
108 : desc(descr), elementData(0), elementCount(0),
109 vertexData(0), vertexCount(0),
116 static size_t size_from_tag_type( Mesh::TagType type );
122 size_t handle(
const std::string& name, MsqError& err )
const;
125 const MfemTagDescription& properties(
size_t tag_handle, MsqError& err )
const;
135 size_t create(
const std::string& name,
145 size_t create(
const MfemTagDescription& desc,
150 void destroy(
size_t tag_index, MsqError& err );
153 void set_element_data(
size_t tag_handle,
155 const size_t* elem_indices,
156 const void* tag_data,
160 void set_vertex_data(
size_t tag_handle,
162 const size_t* elem_indices,
163 const void* tag_data,
167 void get_element_data(
size_t tag_handle,
169 const size_t* elem_indices,
171 MsqError& err )
const;
174 void get_vertex_data(
size_t tag_handle,
176 const size_t* elem_indices,
178 MsqError& err )
const;
200 TagIterator tag_begin();
201 TagIterator tag_end() {
return TagIterator(
this,tagList.size()); }
204 bool tag_has_vertex_data(
size_t index, MsqError& err ) ;
206 bool tag_has_element_data(
size_t index, MsqError& err ) ;
210 friend class MeshTags::TagIterator;
212 std::vector<TagData*> tagList;
226 std::vector<char> mByte;
227 std::vector<bool> mFixed;
237 int get_geometric_dimension(MsqError &err);
240 void get_all_elements(std::vector<ElementHandle>& elements,
242 void get_all_vertices(std::vector<VertexHandle>& vertices,
246 void vertices_get_coordinates(
const VertexHandle vert_array[],
247 MsqVertex* coordinates,
250 void vertex_set_coordinates(VertexHandle vertex,
251 const Vector3D &coordinates,
255 void vertex_set_byte(VertexHandle vertex,
258 void vertices_set_byte(
const VertexHandle *vert_array,
259 const unsigned char *byte_array,
262 void vertices_get_fixed_flag(
const VertexHandle vert_array[],
263 std::vector<bool>& fixed_flag_array,
266 void vertices_set_fixed_flag(
const VertexHandle vert_array[],
267 const std::vector< bool > &fixed_flag_array,
270 void vertex_get_byte(
const VertexHandle vertex,
273 void vertices_get_byte(
const VertexHandle *vertex,
274 unsigned char *byte_array,
278 void vertices_get_attached_elements(
const VertexHandle* vertex_array,
280 std::vector<ElementHandle>& elements,
281 std::vector<size_t>& offsets,
284 void elements_get_attached_vertices(
const ElementHandle *elem_handles,
286 std::vector<VertexHandle>& vert_handles,
287 std::vector<size_t>& offsets,
291 void elements_get_topologies(
const ElementHandle *element_handle_array,
292 EntityTopology *element_topologies,
299 void tag_attributes();
303 std::vector<bool>& slaved_flag_array,
307 TagHandle tag_create(
const std::string& tag_name,
308 TagType type,
unsigned length,
309 const void* default_value,
312 void tag_delete( TagHandle handle, MsqError& err );
314 TagHandle tag_get(
const std::string& name,
317 void tag_properties( TagHandle handle,
318 std::string& name_out,
320 unsigned& length_out,
323 void tag_set_element_data( TagHandle handle,
325 const ElementHandle* elem_array,
326 const void* tag_data,
329 void tag_set_vertex_data ( TagHandle handle,
331 const VertexHandle* node_array,
332 const void* tag_data,
335 void tag_get_element_data( TagHandle handle,
337 const ElementHandle* elem_array,
341 void tag_get_vertex_data ( TagHandle handle,
343 const VertexHandle* node_array,
Class for grid function - Vector with associated FE space.
bool operator!=(const Array< T > &LHS, const Array< T > &RHS)
bool operator==(const Array< T > &LHS, const Array< T > &RHS)
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)