RINGMesh  Version 5.0.0
A programming library for geological model meshes
RINGMesh::VolumeMeshBuilder< DIMENSION > Class Template Referenceabstract

#include <mesh_builder.h>

Inheritance diagram for RINGMesh::VolumeMeshBuilder< DIMENSION >:
RINGMesh::MeshBaseBuilder< DIMENSION > RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >

Public Member Functions

index_t create_cells (index_t nb_cells, CellType type)
 Creates a contiguous chunk of cells of the same type. More...
 
void assign_cell_tet_mesh (const std::vector< index_t > &tets)
 
void set_cell_vertex (const ElementLocalVertex &cell_local_vertex, index_t vertex_id)
 Sets a vertex of a cell by local vertex index. More...
 
void set_cell_corner_vertex_index (index_t corner_index, index_t vertex_index)
 Sets the vertex that a corner is incident to. More...
 
void set_cell_adjacent (const CellLocalFacet &cell_local_facet, index_t cell_adjacent)
 Sets the cell adjacent. More...
 
virtual void connect_cells ()=0
 Retrieve the adjacencies. More...
 
void clear_cells (bool keep_attributes, bool keep_memory)
 Removes all the cells and attributes. More...
 
void permute_cells (const std::vector< index_t > &permutation)
 Applies a permutation to the entities and their attributes. On exit, permutation is modified (used for internal bookkeeping). Applying a permutation permutation is equivalent to: for( i = 0 ; i < permutation.size() ; i++) { data2[i] = data[permutation[i]] } data = data2 ; More...
 
void delete_cells (const std::vector< bool > &to_delete, bool remove_isolated_vertices)
 Deletes a set of cells. More...
 
void remove_isolated_vertices ()
 
- Public Member Functions inherited from RINGMesh::MeshBaseBuilder< DIMENSION >
virtual ~MeshBaseBuilder ()=default
 
template<>
std::unique_ptr< MeshBaseBuilder< 2 > > RINGMESH_API create_builder (MeshBase< 2 > &mesh)
 
template<>
std::unique_ptr< MeshBaseBuilder< 3 > > RINGMESH_API create_builder (MeshBase< 3 > &mesh)
 
void copy (const MeshBase< DIMENSION > &rhs, bool copy_attributes)
 Copy a mesh into this one. More...
 
virtual void load_mesh (const std::string &filename)=0
 
void clear (bool keep_attributes, bool keep_memory)
 Removes all the entities and attributes of this mesh. More...
 
void repair (GEO::MeshRepairMode mode, double colocate_epsilon)
 Fixes some defaults in a mesh. More...
 
void set_vertex (index_t v_id, const vecn< DIMENSION > &vertex)
 Sets a point. More...
 
index_t create_vertex ()
 Creates a new vertex. More...
 
index_t create_vertex (const vecn< DIMENSION > &vertex)
 Creates a new vertex. More...
 
index_t create_vertices (index_t nb)
 Creates a contiguous chunk of vertices. More...
 
void assign_vertices (const std::vector< double > &point_coordinates)
 set vertex coordinates from a std::vector of coordinates More...
 
void delete_vertices (const std::vector< bool > &to_delete)
 Deletes a set of vertices. More...
 
void clear_vertices (bool keep_attributes, bool keep_memory)
 Removes all the vertices and attributes. More...
 
void permute_vertices (const std::vector< index_t > &permutation)
 

Static Public Member Functions

static std::unique_ptr< VolumeMeshBuilder< DIMENSION > > create_builder (VolumeMesh< DIMENSION > &mesh)
 
- Static Public Member Functions inherited from RINGMesh::MeshBaseBuilder< DIMENSION >
static std::unique_ptr< MeshBaseBuilder< DIMENSION > > create_builder (MeshBase< DIMENSION > &mesh)
 

Protected Member Functions

 VolumeMeshBuilder (VolumeMesh< DIMENSION > &mesh)
 
- Protected Member Functions inherited from RINGMesh::MeshBaseBuilder< DIMENSION >
 MeshBaseBuilder (MeshBase< DIMENSION > &mesh)
 
void delete_vertex_nn_search ()
 

Protected Attributes

VolumeMesh< DIMENSION > & volume_mesh_
 
- Protected Attributes inherited from RINGMesh::MeshBaseBuilder< DIMENSION >
MeshBase< DIMENSION > & mesh_base_
 

Private Member Functions

void delete_cell_nn_search ()
 Deletes the NNSearch on cells. More...
 
void delete_cell_aabb ()
 Deletes the AABB on cells. More...
 
void clear_vertex_linked_objects () override
 Deletes the NNSearch on vertices. More...
 
void clear_cell_linked_objects ()
 
virtual index_t do_create_cells (index_t nb_cells, CellType type)=0
 Creates a contiguous chunk of cells of the same type. More...
 
virtual void do_assign_cell_tet_mesh (const std::vector< index_t > &tets)=0
 
virtual void do_set_cell_vertex (const ElementLocalVertex &cell_local_vertex, index_t vertex_id)=0
 Sets a vertex of a cell by local vertex index. More...
 
virtual void do_set_cell_corner_vertex_index (index_t corner_index, index_t vertex_index)=0
 Sets the vertex that a corner is incident to. More...
 
virtual void do_set_cell_adjacent (const CellLocalFacet &cell_local_facet, index_t cell_adjacent)=0
 Sets the cell adjacent. More...
 
virtual void do_clear_cells (bool keep_attributes, bool keep_memory)=0
 Removes all the cells and attributes. More...
 
virtual void do_permute_cells (const std::vector< index_t > &permutation)=0
 Applies a permutation to the entities and their attributes. On exit, permutation is modified (used for internal bookkeeping). Applying a permutation permutation is equivalent to: for( i = 0 ; i < permutation.size() ; i++) { data2[i] = data[permutation[i]] } data = data2 ; More...
 
virtual void do_delete_cells (const std::vector< bool > &to_delete)=0
 Deletes a set of cells. More...
 

Detailed Description

template<index_t DIMENSION>
class RINGMesh::VolumeMeshBuilder< DIMENSION >

Definition at line 898 of file mesh_builder.h.

Constructor & Destructor Documentation

◆ VolumeMeshBuilder()

template<index_t DIMENSION>
RINGMesh::VolumeMeshBuilder< DIMENSION >::VolumeMeshBuilder ( VolumeMesh< DIMENSION > &  mesh)
inlineexplicitprotected

Definition at line 1041 of file mesh_builder.h.

Member Function Documentation

◆ assign_cell_tet_mesh()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::assign_cell_tet_mesh ( const std::vector< index_t > &  tets)
inline

Definition at line 927 of file mesh_builder.h.

◆ clear_cell_linked_objects()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::clear_cell_linked_objects ( )
inlineprivate

Definition at line 1070 of file mesh_builder.h.

◆ clear_cells()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::clear_cells ( bool  keep_attributes,
bool  keep_memory 
)
inline

Removes all the cells and attributes.

Parameters
[in]keep_attributesif true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed.
[in]keep_memoryif true, then memory is kept and can be reused by subsequent mesh entity creations.

Definition at line 984 of file mesh_builder.h.

◆ clear_vertex_linked_objects()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::clear_vertex_linked_objects ( )
inlineoverrideprivatevirtual

Deletes the NNSearch on vertices.

Implements RINGMesh::MeshBaseBuilder< DIMENSION >.

Definition at line 1064 of file mesh_builder.h.

◆ connect_cells()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::connect_cells ( )
pure virtual

Retrieve the adjacencies.

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ create_builder()

template<index_t DIMENSION>
template std::unique_ptr< VolumeMeshBuilder< 3 > > RINGMESH_API RINGMesh::VolumeMeshBuilder< DIMENSION >::create_builder ( VolumeMesh< DIMENSION > &  mesh)
static

Definition at line 193 of file mesh_builder.cpp.

◆ create_cells()

template<index_t DIMENSION>
index_t RINGMesh::VolumeMeshBuilder< DIMENSION >::create_cells ( index_t  nb_cells,
CellType  type 
)
inline

Creates a contiguous chunk of cells of the same type.

Parameters
[in]nb_cellsnumber of cells to create
[in]typetype of the cells to create, one of TETRAEDRON, HEXAEDRON, CellType::PRISM, CellType::PYRAMID, CellType::UNCLASSIFIED.
Returns
the first created cell.

Definition at line 914 of file mesh_builder.h.

◆ delete_cell_aabb()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::delete_cell_aabb ( )
inlineprivate

Deletes the AABB on cells.

Definition at line 1059 of file mesh_builder.h.

◆ delete_cell_nn_search()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::delete_cell_nn_search ( )
inlineprivate

Deletes the NNSearch on cells.

Definition at line 1050 of file mesh_builder.h.

◆ delete_cells()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::delete_cells ( const std::vector< bool > &  to_delete,
bool  remove_isolated_vertices 
)
inline

Deletes a set of cells.

Parameters
[in]to_deletea vector of size nb(). If to_delete[e] is true, then entity e will be destroyed, else it will be kept.
[in]remove_isolated_verticesif true, then the vertices that are no longer incident to any entity are deleted.

Definition at line 1014 of file mesh_builder.h.

◆ do_assign_cell_tet_mesh()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::do_assign_cell_tet_mesh ( const std::vector< index_t > &  tets)
privatepure virtual

◆ do_clear_cells()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::do_clear_cells ( bool  keep_attributes,
bool  keep_memory 
)
privatepure virtual

Removes all the cells and attributes.

Parameters
[in]keep_attributesif true, then all the existing attribute names / bindings are kept (but they are cleared). If false, they are destroyed.
[in]keep_memoryif true, then memory is kept and can be reused by subsequent mesh entity creations.

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ do_create_cells()

template<index_t DIMENSION>
virtual index_t RINGMesh::VolumeMeshBuilder< DIMENSION >::do_create_cells ( index_t  nb_cells,
CellType  type 
)
privatepure virtual

Creates a contiguous chunk of cells of the same type.

Parameters
[in]nb_cellsnumber of cells to create
[in]typetype of the cells to create, one of TETRAEDRON, HEXAEDRON, CellType::PRISM, CellType::PYRAMID, CellType::UNCLASSIFIED.
Returns
the first created cell.

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ do_delete_cells()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::do_delete_cells ( const std::vector< bool > &  to_delete)
privatepure virtual

Deletes a set of cells.

Parameters
[in]to_deletea vector of size nb(). If to_delete[e] is true, then entity e will be destroyed, else it will be kept.

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ do_permute_cells()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::do_permute_cells ( const std::vector< index_t > &  permutation)
privatepure virtual

Applies a permutation to the entities and their attributes. On exit, permutation is modified (used for internal bookkeeping). Applying a permutation permutation is equivalent to: for( i = 0 ; i < permutation.size() ; i++) { data2[i] = data[permutation[i]] } data = data2 ;

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ do_set_cell_adjacent()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::do_set_cell_adjacent ( const CellLocalFacet cell_local_facet,
index_t  cell_adjacent 
)
privatepure virtual

Sets the cell adjacent.

Parameters
[in]cell_local_facetindex of the cell, and local index of the cell facet
[in]cell_adjacentadjacent value to set

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ do_set_cell_corner_vertex_index()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::do_set_cell_corner_vertex_index ( index_t  corner_index,
index_t  vertex_index 
)
privatepure virtual

Sets the vertex that a corner is incident to.

Parameters
[in]corner_indexthe corner, in 0.. nb() - 1
[in]vertex_indexspecifies the vertex that corner
corner_indexis incident to

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ do_set_cell_vertex()

template<index_t DIMENSION>
virtual void RINGMesh::VolumeMeshBuilder< DIMENSION >::do_set_cell_vertex ( const ElementLocalVertex cell_local_vertex,
index_t  vertex_id 
)
privatepure virtual

Sets a vertex of a cell by local vertex index.

Parameters
[in]cell_local_vertexindex of the cell,and local index of the vertex in the cell. Local index between 0 and nb_vertices(cell_id) - 1.
[in]vertex_idspecifies the global index of the vertex
local_vertex_idin the cell
cell_id.Index between 0 and nb() - 1.

Implemented in RINGMesh::GeogramVolumeMeshBuilder< DIMENSION >.

◆ permute_cells()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::permute_cells ( const std::vector< index_t > &  permutation)
inline

Applies a permutation to the entities and their attributes. On exit, permutation is modified (used for internal bookkeeping). Applying a permutation permutation is equivalent to: for( i = 0 ; i < permutation.size() ; i++) { data2[i] = data[permutation[i]] } data = data2 ;

Definition at line 1000 of file mesh_builder.h.

◆ remove_isolated_vertices()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::remove_isolated_vertices ( )
inline

Definition at line 1025 of file mesh_builder.h.

◆ set_cell_adjacent()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::set_cell_adjacent ( const CellLocalFacet cell_local_facet,
index_t  cell_adjacent 
)
inline

Sets the cell adjacent.

Parameters
[in]cell_local_facetindex of the cell, and local index of the cell facet
[in]cell_adjacentadjacent value to set

Definition at line 965 of file mesh_builder.h.

◆ set_cell_corner_vertex_index()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::set_cell_corner_vertex_index ( index_t  corner_index,
index_t  vertex_index 
)
inline

Sets the vertex that a corner is incident to.

Parameters
[in]corner_indexthe corner, in 0.. nb() - 1
[in]vertex_indexspecifies the vertex that corner
corner_indexis incident to

Definition at line 953 of file mesh_builder.h.

◆ set_cell_vertex()

template<index_t DIMENSION>
void RINGMesh::VolumeMeshBuilder< DIMENSION >::set_cell_vertex ( const ElementLocalVertex cell_local_vertex,
index_t  vertex_id 
)
inline

Sets a vertex of a cell by local vertex index.

Parameters
[in]cell_local_vertexindex of the cell, and local index of the vertex in the cell. Local index between 0 and nb_vertices(cell_id) - 1.
[in]vertex_idspecifies the global index of the vertex
local_vertex_idin the cell
cell_id.Index between 0 and nb() - 1.

Definition at line 941 of file mesh_builder.h.

Member Data Documentation

◆ volume_mesh_

template<index_t DIMENSION>
VolumeMesh< DIMENSION >& RINGMesh::VolumeMeshBuilder< DIMENSION >::volume_mesh_
protected

Definition at line 1155 of file mesh_builder.h.


The documentation for this class was generated from the following files: