15 #include "../config/config.hpp"
17 #ifdef MFEM_USE_MESQUITE
21 #include "Mesquite_all_headers.hpp"
26 using namespace Mesquite;
33 struct MfemTagDescription
40 inline MfemTagDescription( std::string n,
43 : name(n), type(t), size(s) {}
45 inline MfemTagDescription( )
46 : type(Mesh::BYTE), size(0) {}
48 inline bool operator==(
const MfemTagDescription& o)
const
49 {
return name == o.name && type == o.type && size == o.size; }
50 inline bool operator!=(
const MfemTagDescription& o)
const
51 {
return name != o.name || type != o.type || size != o.size; }
65 ~MeshTags() { clear(); }
74 const MfemTagDescription
desc;
98 Mesh::TagType type,
unsigned length,
99 void* default_val = 0)
100 : desc(name, type, length*size_from_tag_type(type)),
101 elementData(0), elementCount(0),
102 vertexData(0), vertexCount(0),
103 defaultValue(default_val) {}
108 inline TagData(
const MfemTagDescription& descr )
109 : desc(descr), elementData(0), elementCount(0),
110 vertexData(0), vertexCount(0),
117 static size_t size_from_tag_type( Mesh::TagType type );
123 size_t handle(
const std::string& name, MsqError&
err )
const;
126 const MfemTagDescription& properties(
size_t tag_handle, MsqError&
err )
const;
136 size_t create(
const std::string& name,
146 size_t create(
const MfemTagDescription& desc,
151 void destroy(
size_t tag_index, MsqError&
err );
154 void set_element_data(
size_t tag_handle,
156 const size_t* elem_indices,
157 const void* tag_data,
161 void set_vertex_data(
size_t tag_handle,
163 const size_t* elem_indices,
164 const void* tag_data,
168 void get_element_data(
size_t tag_handle,
170 const size_t* elem_indices,
172 MsqError&
err )
const;
175 void get_vertex_data(
size_t tag_handle,
177 const size_t* elem_indices,
179 MsqError&
err )
const;
201 TagIterator tag_begin();
202 TagIterator tag_end() {
return TagIterator(
this,tagList.size()); }
205 bool tag_has_vertex_data(
size_t index, MsqError&
err ) ;
207 bool tag_has_element_data(
size_t index, MsqError&
err ) ;
211 friend class MeshTags::TagIterator;
213 std::vector<TagData*> tagList;
227 std::vector<char> mByte;
228 std::vector<bool> mFixed;
238 int get_geometric_dimension(MsqError &
err);
241 void get_all_elements(std::vector<ElementHandle>& elements,
243 void get_all_vertices(std::vector<VertexHandle>& vertices,
247 void vertices_get_coordinates(
const VertexHandle vert_array[],
248 MsqVertex* coordinates,
251 void vertex_set_coordinates(VertexHandle vertex,
252 const Vector3D &coordinates,
256 void vertex_set_byte(VertexHandle vertex,
259 void vertices_set_byte(
const VertexHandle *vert_array,
260 const unsigned char *byte_array,
263 void vertices_get_fixed_flag(
const VertexHandle vert_array[],
264 std::vector<bool>& fixed_flag_array,
267 void vertices_set_fixed_flag(
const VertexHandle vert_array[],
268 const std::vector< bool > &fixed_flag_array,
271 void vertex_get_byte(
const VertexHandle vertex,
274 void vertices_get_byte(
const VertexHandle *vertex,
275 unsigned char *byte_array,
279 void vertices_get_attached_elements(
const VertexHandle* vertex_array,
281 std::vector<ElementHandle>& elements,
282 std::vector<size_t>& offsets,
285 void elements_get_attached_vertices(
const ElementHandle *elem_handles,
287 std::vector<VertexHandle>& vert_handles,
288 std::vector<size_t>& offsets,
292 void elements_get_topologies(
const ElementHandle *element_handle_array,
293 EntityTopology *element_topologies,
300 void tag_attributes();
304 std::vector<bool>& slaved_flag_array,
308 TagHandle tag_create(
const std::string& tag_name,
309 TagType type,
unsigned length,
310 const void* default_value,
313 void tag_delete( TagHandle handle, MsqError&
err );
315 TagHandle tag_get(
const std::string& name,
318 void tag_properties( TagHandle handle,
319 std::string& name_out,
321 unsigned& length_out,
324 void tag_set_element_data( TagHandle handle,
326 const ElementHandle* elem_array,
327 const void* tag_data,
330 void tag_set_vertex_data ( TagHandle handle,
332 const VertexHandle* node_array,
333 const void* tag_data,
336 void tag_get_element_data( TagHandle handle,
338 const ElementHandle* elem_array,
342 void tag_get_vertex_data ( TagHandle handle,
344 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)
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
OutStream err(std::cerr)
Global stream used by the library for standard error output. Initially it uses the same std::streambu...
void vertices_get_slaved_flag(const VertexHandle vert_array[], std::vector< bool > &slaved_flag_array, size_t num_vtx, MsqError &err)
int index(int i, int j, int nx, int ny)
Abstract data type element.
void release_entity_handles(const EntityHandle *handle_array, size_t num_handles, MsqError &err)