RINGMesh
Version 5.0.0
A programming library for geological model meshes
|
#include <geomodel_mesh.h>
Public Types | |
enum | DuplicateMode { NONE, FAULT, HORIZON, ALL } |
Public Member Functions | |
GeoModelMeshCells (GeoModelMesh< DIMENSION > &gmm, GeoModel< DIMENSION > &gm, std::unique_ptr< VolumeMesh< DIMENSION > > &mesh) | |
GEO::AttributesManager & | attribute_manager () const |
bool | is_initialized () const |
bool | is_duplication_initialized () const |
void | test_and_initialize () const |
index_t | nb () const |
Number of cells stored. More... | |
index_t | nb_duplicated_vertices () const |
index_t | nb_total_vertices () const |
index_t | duplicated_corner_index (const ElementLocalVertex &cell_local_vertex) const |
index_t | duplicated_vertex (index_t duplicate_vertex_index) const |
index_t | nb_vertices (index_t cell) const |
index_t | vertex (const ElementLocalVertex &cell_local_vertex) const |
index_t | nb_edges (index_t cell) const |
index_t | nb_facets (index_t cell) const |
index_t | nb_facet_vertices (const CellLocalFacet &cell_local_facet) const |
index_t | facet_vertex (const CellLocalFacet &cell_local_facet, index_t local_vertex) const |
Gets a cell vertex by local facet index and local vertex index in the edge. More... | |
index_t | edge_vertex (index_t cell, index_t local_edge, index_t local_vertex) const |
Gets a cell vertex by local edge index and local vertex index in the edge. More... | |
index_t | adjacent (index_t cell, index_t facet) const |
index_t | region (index_t cell) const |
index_t | index_in_region (index_t cell) const |
CellType | type (index_t cell) const |
index_t | nb_cells (CellType type=CellType::UNDEFINED) const |
index_t | nb_cells (index_t region, CellType type=CellType::UNDEFINED) const |
index_t | cell (index_t region, index_t cell, CellType type=CellType::UNDEFINED) const |
index_t | nb_tet () const |
index_t | nb_tet (index_t region) const |
index_t | tet (index_t region, index_t tet) const |
index_t | nb_hex () const |
index_t | nb_hex (index_t region) const |
index_t | hex (index_t region, index_t hex) const |
index_t | nb_prism () const |
index_t | nb_prism (index_t region) const |
index_t | prism (index_t region, index_t prism) const |
index_t | nb_pyramid () const |
index_t | nb_pyramid (index_t region) const |
index_t | pyramid (index_t region, index_t pyramid) const |
index_t | nb_connector () const |
index_t | nb_connector (index_t region) const |
index_t | connector (index_t region, index_t connector) const |
void | clear () |
void | clear_duplication () |
bool | is_cell_facet_on_surface (index_t cell, index_t facet_index, index_t &colocated_facet_index, bool &side) const |
vec3 | barycenter (index_t cell) const |
double | volume (index_t cell) const |
const NNSearch< DIMENSION > & | cell_nn_search () const |
const NNSearch< DIMENSION > & | cell_facet_nn_search () const |
const VolumeAABBTree< DIMENSION > & | aabb () const |
return the AABB tree for the cells of the mesh More... | |
Private Types | |
enum | ActionOnSurface { SKIP = -2, TO_PROCESS = -1, NEG_SIDE = 0, POS_SIDE = 1 } |
using | action_on_surface = std::pair< index_t, ActionOnSurface > |
Action to do according a surface index. More... | |
Private Member Functions | |
void | initialize () |
Initialize the cells from the cells of the GeoModel Region cells. More... | |
void | resize_cell_data () |
void | clear_cell_data () |
void | test_and_initialize_duplication () const |
void | initialize_duplication () |
bool | is_surface_to_duplicate (index_t surface) const |
bool | are_corners_to_duplicate (const std::vector< action_on_surface > &surfaces, std::vector< ActionOnSurface > &info) |
void | test_and_initialize_cell_facet () const |
void | initialize_cell_facet () |
void | sort_cells () |
Private Attributes | |
std::unique_ptr< VolumeMesh< DIMENSION > > & | mesh_ |
Attached Mesh. More... | |
std::vector< index_t > | region_id_ |
Vector storing the region index per cell. More... | |
std::vector< index_t > | cell_id_ |
Vector storing the cell index in region per cell. More... | |
std::vector< index_t > | region_cell_ptr_ |
index_t | nb_tets_ { 0 } |
Number of tet in the GeoModelMesh. More... | |
index_t | nb_hexs_ { 0 } |
Number of hex in the GeoModelMesh. More... | |
index_t | nb_prisms_ { 0 } |
Number of prism in the GeoModelMesh. More... | |
index_t | nb_pyramids_ { 0 } |
Number of pyramid in the GeoModelMesh. More... | |
index_t | nb_connectors_ { 0 } |
Number of connector in the GeoModelMesh. More... | |
DuplicateMode | mode_ { NONE } |
Current duplicate mode applied on the mesh. More... | |
std::vector< index_t > | duplicated_vertex_indices_ |
Vector of duplicated vertices. More... | |
std::vector< index_t > | polygon_id_ |
Vector storing the colocalised polygon index per cell facet If a cell facet is on a surface, the vector is equal to the index of the corresponding polygon. More... | |
Static Private Attributes | |
static const std::string | region_att_name |
static const std::string | cell_region_att_name |
Friends | |
class | GeoModelMeshBase< DIMENSION > |
class | GeoModelMesh< DIMENSION > |
Additional Inherited Members | |
Protected Member Functions inherited from RINGMesh::GeoModelMeshCommon< DIMENSION > | |
GeoModelMeshCommon (GeoModelMesh< DIMENSION > &gmm, GeoModel< DIMENSION > &geomodel) | |
virtual | ~GeoModelMeshCommon ()=default |
void | set_mesh (MeshBase< DIMENSION > *mesh) |
void | save_mesh (const std::string &filename) const |
Protected Attributes inherited from RINGMesh::GeoModelMeshCommon< DIMENSION > | |
GeoModelMesh< DIMENSION > & | gmm_ |
Attached GeoModelMesh. More... | |
GeoModel< DIMENSION > & | geomodel_ |
Attached GeoModel. More... | |
MeshBase< DIMENSION > * | mesh_base_ |
Attached MeshBase. More... | |
Definition at line 1055 of file geomodel_mesh.h.
|
private |
Action to do according a surface index.
Definition at line 1423 of file geomodel_mesh.h.
|
private |
enum to characterize the action to do concerning a surface Action concerns the vertices of a Surface and not the Surface
Definition at line 1411 of file geomodel_mesh.h.
enum RINGMesh::GeoModelMeshCells::DuplicateMode |
Several modes for vertex duplication algorithm:
Enumerator | |
---|---|
NONE | |
FAULT | |
HORIZON | |
ALL |
Definition at line 1072 of file geomodel_mesh.h.
RINGMesh::GeoModelMeshCells< DIMENSION >::GeoModelMeshCells | ( | GeoModelMesh< DIMENSION > & | gmm, |
GeoModel< DIMENSION > & | gm, | ||
std::unique_ptr< VolumeMesh< DIMENSION > > & | mesh | ||
) |
Definition at line 846 of file geomodel_mesh.cpp.
const VolumeAABBTree< DIMENSION > & RINGMesh::GeoModelMeshCells< DIMENSION >::aabb | ( | ) | const |
return the AABB tree for the cells of the mesh
Definition at line 1811 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::adjacent | ( | index_t | cell, |
index_t | facet | ||
) | const |
Get the adjacent cell index in the GeoModelMesh
[in] | cell | the cell index |
[in] | facet | the facet index |
Definition at line 1134 of file geomodel_mesh.cpp.
|
private |
Determine the actions to do according the action_on_surfaces encountered during the propagation around a vertex (initialize())
[in] | surfaces | the action_on_surfaces encountered |
[in,out] | info | the global information on what to do for each surface. This information is updated in this function according the encountered action_on_surfaces |
Definition at line 1597 of file geomodel_mesh.cpp.
|
inline |
Definition at line 1084 of file geomodel_mesh.h.
vec3 RINGMesh::GeoModelMeshCells< DIMENSION >::barycenter | ( | index_t | cell | ) | const |
Get the center of the given cell
[in] | cell | the cell index |
Definition at line 1796 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::cell | ( | index_t | region, |
index_t | cell, | ||
CellType | type = CellType::UNDEFINED |
||
) | const |
Get the cell index in the GeoModelMesh
[in] | region | the region index owing the cell |
[in] | cell | the cell index varying from 0 to number of cells of type type in the region region . |
cell
is NOT a cell id of the region region
, It is cellth cell of type type
in the internal storage of the GeoModelMeshCells (see GeoModelMeshCells::region_cell_ptr_). [in] | type | it can specify the cell type used. For example, if type = HEXAEDRON then cell represents the cellth hex in the region region and cell can vary from 0 to nb_hex( r ). If type is CellType::UNDEFINED, all the cell types are taken into account. |
Definition at line 1226 of file geomodel_mesh.cpp.
|
inline |
Definition at line 1397 of file geomodel_mesh.h.
|
inline |
Definition at line 1392 of file geomodel_mesh.h.
void RINGMesh::GeoModelMeshCells< DIMENSION >::clear | ( | ) |
Clear the mesh cells
Definition at line 1723 of file geomodel_mesh.cpp.
|
private |
Clear cell_id; region_id and polygon id_
Definition at line 1052 of file geomodel_mesh.cpp.
void RINGMesh::GeoModelMeshCells< DIMENSION >::clear_duplication | ( | ) |
Remove the duplication of the mesh cell facets
Definition at line 1740 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::connector | ( | index_t | region, |
index_t | connector | ||
) | const |
Get the cell index in the GeoModelMesh corresponding to the asked connector in the region
[in] | region | the region index |
[in] | connector | the connectorth connector index varying from 0 to nb_connector( r ) |
Definition at line 1390 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::duplicated_corner_index | ( | const ElementLocalVertex & | cell_local_vertex | ) | const |
Check if the corner in a cell is duplicated, if so give the duplicated vertex index
[in] | c | the cell index in the GeoModelMesh |
[in] | vertex | the local vertex index in the cell c (0 to nb_vertices( c )) |
Definition at line 1696 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::duplicated_vertex | ( | index_t | duplicate_vertex_index | ) | const |
Get the vertex index in the GeoModelMesh corresponding to the given duplicated vertex index
[in] | duplicate_vertex_index | the duplicated vertex index |
Definition at line 1713 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::edge_vertex | ( | index_t | cell, |
index_t | local_edge, | ||
index_t | local_vertex | ||
) | const |
Gets a cell vertex by local edge index and local vertex index in the edge.
[in] | cell | the cell, in 0..nb()-1 |
[in] | local_edge | the local edge index, in 0..nb_edges(c)-1 |
[in] | local_vertex | the local index in the edge, one of 0,1 |
local_vertex
of edge local_edge
in cell c
Definition at line 1125 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::facet_vertex | ( | const CellLocalFacet & | cell_local_facet, |
index_t | local_vertex | ||
) | const |
Gets a cell vertex by local facet index and local vertex index in the edge.
[in] | cell_local_facet | the local facet in a cell |
[in] | local_vertex | the local index in the cell facet |
lv
of facet lf
in cell c
Definition at line 1114 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::hex | ( | index_t | region, |
index_t | hex | ||
) | const |
Get the cell index in the GeoModelMesh corresponding to the asked hex in the region
[in] | region | the region index |
[in] | hex | the hexth hex index varying from 0 to nb_hex( region ) |
Definition at line 1302 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::index_in_region | ( | index_t | cell | ) | const |
Get the cell index in the GeoModelMesh restricted to the region owing the cell
[in] | cell | the cell index |
cell
Definition at line 1152 of file geomodel_mesh.cpp.
|
private |
Initialize the cells from the cells of the GeoModel Region cells.
Definition at line 871 of file geomodel_mesh.cpp.
|
private |
Initialize the mesh cell facet vector of colocalised facet.
Definition at line 1771 of file geomodel_mesh.cpp.
|
private |
Duplicate the mesh cell along some surfaces defined by the duplication mode
Definition at line 1417 of file geomodel_mesh.cpp.
bool RINGMesh::GeoModelMeshCells< DIMENSION >::is_cell_facet_on_surface | ( | index_t | cell, |
index_t | facet_index, | ||
index_t & | colocated_facet_index, | ||
bool & | side | ||
) | const |
Determine if a cell facet is on a surface. If so, fill the action
with the surface index and the surface side encountered
[in] | cell | the cell index |
[in] | facet | the facet index |
[out] | colocated_facet_index | the facet index colocalised with the cell facet |
[out] | side | the side of the facet facet . true = side of the facet normal, false = the other side |
Definition at line 1582 of file geomodel_mesh.cpp.
bool RINGMesh::GeoModelMeshCells< DIMENSION >::is_duplication_initialized | ( | ) | const |
Test if the mesh cells are duplicated
Definition at line 1401 of file geomodel_mesh.cpp.
bool RINGMesh::GeoModelMeshCells< DIMENSION >::is_initialized | ( | ) | const |
Test if the mesh cells are initialized
Definition at line 856 of file geomodel_mesh.cpp.
|
private |
Test if we need to duplicate mesh cell along the given surface according the duplicate mode
[in] | s | the surface index in the GeoModel |
Definition at line 1650 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb | ( | ) | const |
Number of cells stored.
Definition at line 1060 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_cells | ( | CellType | type = CellType::UNDEFINED | ) | const |
Get the number of cells of the corresponding type
[in] | type | the corresponding type |
Definition at line 1168 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_cells | ( | index_t | region, |
CellType | type = CellType::UNDEFINED |
||
) | const |
Get the number of cells of the corresponding type in the given region of the GeoModel
[in] | region | the region index |
[in] | type | the corresponding type |
Definition at line 1192 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_connector | ( | ) | const |
Get the number of connectors in the GeoModelMesh
Definition at line 1370 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_connector | ( | index_t | region | ) | const |
Get the number of connectors in the given region
[in] | region | the region index |
Definition at line 1377 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_duplicated_vertices | ( | ) | const |
Gets the number of duplicated points by the DuplicateMode algorithm
Definition at line 1683 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_edges | ( | index_t | cell | ) | const |
Get the number of edges in the cell
[in] | cell | the cell index |
Definition at line 1087 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_facet_vertices | ( | const CellLocalFacet & | cell_local_facet | ) | const |
Get the number of facets in the cell
Definition at line 1103 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_facets | ( | index_t | cell | ) | const |
Get the number of facets in the cell
[in] | cell | the cell index |
Definition at line 1095 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_hex | ( | ) | const |
Get the number of hexs in the GeoModelMesh
Definition at line 1283 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_hex | ( | index_t | region | ) | const |
Get the number of hexs in the given region
[in] | region | the region index |
Definition at line 1290 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_prism | ( | ) | const |
Get the number of prisms in the GeoModelMesh
Definition at line 1312 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_prism | ( | index_t | region | ) | const |
Get the number of prisms in the given region
[in] | region | the region index |
Definition at line 1319 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_pyramid | ( | ) | const |
Get the number of pyramids in the GeoModelMesh
Definition at line 1340 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_pyramid | ( | index_t | region | ) | const |
Get the number of pyramids in the given region
[in] | region | the region index |
Definition at line 1347 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_tet | ( | ) | const |
Get the number of tets in the GeoModelMesh
Definition at line 1253 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_tet | ( | index_t | region | ) | const |
Get the number of tets in the given region
[in] | r | the region index |
Definition at line 1260 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_total_vertices | ( | ) | const |
Gets the total number of vertices (mesh.vertices.nb() + nb_duplicated_vertices())
Definition at line 1690 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::nb_vertices | ( | index_t | cell | ) | const |
Get the number of vertices in the cell
[in] | c | the cell index |
Definition at line 1067 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::prism | ( | index_t | region, |
index_t | prism | ||
) | const |
Get the cell index in the GeoModelMesh corresponding to the asked prism in the region
[in] | region | the region index |
[in] | prism | the prismth prism index varying from 0 to nb_prism( region ) |
Definition at line 1330 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::pyramid | ( | index_t | region, |
index_t | pyramid | ||
) | const |
Get the cell index in the GeoModelMesh corresponding to the asked pyramid in the region
[in] | r | the region index |
[in] | p | the pth pyramid index varying from 0 to nb_pyramid( r ) |
Definition at line 1359 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::region | ( | index_t | cell | ) | const |
Get the region index in the GeoModel according the cell index in the GeoModelMesh
[in] | cell | the cell index |
Definition at line 1144 of file geomodel_mesh.cpp.
|
private |
Resize region_id and cell_id
Definition at line 1045 of file geomodel_mesh.cpp.
|
private |
Definition at line 1026 of file geomodel_mesh.cpp.
void RINGMesh::GeoModelMeshCells< DIMENSION >::test_and_initialize | ( | ) | const |
Test if the mesh cells need to be initialized, if so initialize them.
Definition at line 862 of file geomodel_mesh.cpp.
|
private |
Test if the mesh cell facet vector is filled with the colocalised facet. If not fill it.
Definition at line 1762 of file geomodel_mesh.cpp.
|
private |
Test if the mesh cell are duplicated according the duplication mode, if not duplicate them.
Definition at line 1407 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::tet | ( | index_t | region, |
index_t | tet | ||
) | const |
Get the cell index in the GeoModelMesh corresponding to the asked tet in the region
[in] | region | the region index |
[in] | tet | the tetth tet index varying from 0 to nb_tet( region ) |
Definition at line 1273 of file geomodel_mesh.cpp.
CellType RINGMesh::GeoModelMeshCells< DIMENSION >::type | ( | index_t | cell | ) | const |
Get the cell index in the GeoModelMesh restricted to the region owing the cell and its type
[in] | cell | the cell index |
[out] | index | the cell index varying from 0 to nb_cells of the corresponding type of c in the owing region |
c
Definition at line 1160 of file geomodel_mesh.cpp.
index_t RINGMesh::GeoModelMeshCells< DIMENSION >::vertex | ( | const ElementLocalVertex & | cell_local_vertex | ) | const |
Get the vertex index of a vertex in a cell in the GeoModelMesh
[in] | c | the cell index |
[in] | vertex | the local vertex index [0, nb_vertices_in_cell[ |
Definition at line 1075 of file geomodel_mesh.cpp.
double RINGMesh::GeoModelMeshCells< DIMENSION >::volume | ( | index_t | cell | ) | const |
Get the volume of the cell
[in] | cell | the cell index |
Definition at line 1803 of file geomodel_mesh.cpp.
|
friend |
Definition at line 1063 of file geomodel_mesh.h.
|
friend |
Definition at line 1062 of file geomodel_mesh.h.
|
private |
Vector storing the cell index in region per cell.
Definition at line 1489 of file geomodel_mesh.h.
|
staticprivate |
Definition at line 1059 of file geomodel_mesh.h.
|
private |
Vector of duplicated vertices.
Each value is a duplicated vertex, the index corresponds to vertex index in mesh.vertices.
Definition at line 1519 of file geomodel_mesh.h.
|
private |
Attached Mesh.
Definition at line 1484 of file geomodel_mesh.h.
|
private |
Current duplicate mode applied on the mesh.
Definition at line 1513 of file geomodel_mesh.h.
|
private |
Number of connector in the GeoModelMesh.
Definition at line 1510 of file geomodel_mesh.h.
|
private |
Number of hex in the GeoModelMesh.
Definition at line 1504 of file geomodel_mesh.h.
|
private |
Number of prism in the GeoModelMesh.
Definition at line 1506 of file geomodel_mesh.h.
|
private |
Number of pyramid in the GeoModelMesh.
Definition at line 1508 of file geomodel_mesh.h.
|
private |
Number of tet in the GeoModelMesh.
Definition at line 1502 of file geomodel_mesh.h.
|
private |
Vector storing the colocalised polygon index per cell facet If a cell facet is on a surface, the vector is equal to the index of the corresponding polygon.
Definition at line 1526 of file geomodel_mesh.h.
|
staticprivate |
Definition at line 1058 of file geomodel_mesh.h.
|
private |
Vector storing the index of the starting cell index for a given region and a given cell type. For example: the 2nd hex index of the region index R will be found here: surface_polygon_ptr_[CellType::UNDEFINED*R + CellType::HEXAEDRON]
Definition at line 1499 of file geomodel_mesh.h.
|
private |
Vector storing the region index per cell.
Definition at line 1487 of file geomodel_mesh.h.