21 #ifndef __MESH_EDITOR_H 22 #define __MESH_EDITOR_H 59 std::size_t gdim, std::size_t degree=1);
73 void open(
Mesh& mesh, std::string type, std::size_t tdim,
74 std::size_t gdim, std::size_t degree=1);
114 std::size_t num_global_vertices);
146 std::size_t num_global_cells);
162 void add_vertex(std::size_t index,
const std::vector<double>& x);
180 void add_vertex(std::size_t index,
double x,
double y);
192 void add_vertex(std::size_t index,
double x,
double y,
double z);
214 const std::vector<double>& x);
218 std::size_t index,
const Point& p);
228 void add_cell(std::size_t c, std::size_t v0, std::size_t v1);
240 void add_cell(std::size_t c, std::size_t v0, std::size_t v1,
255 void add_cell(std::size_t c, std::size_t v0, std::size_t v1,
256 std::size_t v2, std::size_t v3);
265 void add_cell(std::size_t c,
const std::vector<std::size_t>& v)
287 void add_cell(std::size_t local_index, std::size_t global_index,
297 add_cell_common(local_index, _tdim);
300 _mesh->_topology(_tdim, 0).set(local_index, v);
316 void close(
bool order=
true);
324 void add_vertex_common(std::size_t v, std::size_t dim);
327 void add_cell_common(std::size_t v, std::size_t dim);
330 void compute_boundary_indicators();
336 template <
typename T>
337 void check_vertices(
const T& v)
const 339 for (std::size_t i = 0; i < v.size(); ++i)
341 if (_num_vertices > 0 && v[i] >= _num_vertices)
344 "add cell using mesh editor",
345 "Vertex index (%d) out of range [0, %d)", v[i],
361 std::size_t _num_vertices;
364 std::size_t _num_cells;
367 std::size_t next_vertex;
370 std::size_t next_cell;
373 std::vector<std::size_t> _vertices;
~MeshEditor()
Destructor.
Definition: MeshEditor.cpp:39
void init_entities()
Definition: MeshEditor.cpp:119
void add_vertex(std::size_t index, const Point &p)
Definition: MeshEditor.cpp:165
Definition: MeshEditor.h:36
void add_vertex_global(std::size_t local_index, std::size_t global_index, const Point &p)
Definition: MeshEditor.cpp:202
Type
Enum for different cell types.
Definition: CellType.h:51
void close(bool order=true)
Definition: MeshEditor.cpp:265
void set_global_index(std::size_t dim, std::size_t local_index, std::int64_t global_index)
Definition: MeshTopology.h:97
void init_cells(std::size_t num_cells)
Definition: MeshEditor.h:128
void init_cells_global(std::size_t num_local_cells, std::size_t num_global_cells)
Definition: MeshEditor.cpp:145
void add_cell(std::size_t c, const T &v)
Definition: MeshEditor.h:275
void add_entity_point(std::size_t entity_dim, std::size_t order, std::size_t index, const Point &p)
Add a point in a given entity of dimension entity_dim.
Definition: MeshEditor.cpp:226
void open(Mesh &mesh, CellType::Type type, std::size_t tdim, std::size_t gdim, std::size_t degree=1)
Definition: MeshEditor.cpp:44
MeshEditor()
Constructor.
Definition: MeshEditor.cpp:33
void init_vertices(std::size_t num_vertices)
Definition: MeshEditor.h:88
void dolfin_error(std::string location, std::string task, std::string reason,...)
Definition: log.cpp:129
void add_cell(std::size_t c, const std::vector< std::size_t > &v)
Definition: MeshEditor.h:265
void init_vertices_global(std::size_t num_local_vertices, std::size_t num_global_vertices)
Definition: MeshEditor.cpp:99
void add_cell(std::size_t c, std::size_t v0, std::size_t v1)
Definition: MeshEditor.cpp:233
void add_cell(std::size_t local_index, std::size_t global_index, const T &v)
Definition: MeshEditor.h:287
This class implements functionality for tetrahedral cell meshes.
Definition: TetrahedronCell.h:40