Each RINGMesh::GeoModelMeshEntity has a RINGMesh::Mesh independent from the other ones. Even if there are dependencies through the RINGMesh::GeoModelGeologicalEntity, it implies that there is no connection between the different meshes, in other words, each mesh stores its vertices, facets and cells. However, you may want/need (1) a more general information than the one stores inside a mesh, and (2) a single mesh representing the entire geological model.
To ease the global access, four optional databases are attached to the RINGMesh::GeoModelMesh:
- RINGMesh::GeoModelMeshVertices: access to a global vertex without redundancy at the mesh interfaces. It also own a link to each GEO::Mesh vertices.
- RINGMesh::GeoModelMeshFacets: access to a global facet.
- RINGMesh::GeoModelMeshCells: access to a global cell and its adjacent cells (even at the mesh interfaces). It also handle cell disconnection along surfaces if needed. Several disconnection mode can be set in the RINGMesh::GeoModelMesh (cf. RINGMesh::DupplicationMode).
- RINGMesh::GeoModelMeshEdges: access to a global edge (to model wells). These databases are empty by default and are automatically filled as soon as they are used.
Examples:
for( index_t v = 0; v < gmm.vertices.nb_vertices(); v++ ) {
const vec3& point = gmm.vertices.vertex( v ) ;
}
for( index_t s = 0; s < gmm.model().nb_surfaces(); s++ ) {
for( index_t f = 0; f < gmm.facets.nb_facets( s ); f++ ) {
index_t facet_id_in_the_mesh = gmm.facets.facet( s, f ) ;
std::cout << "Nb vertices in the facets: " << gmm.facets.nb_vertices( facet_id_in_the_mesh ) << std::endl ;
}
}
for( index_t m = 0; m < gmm.model().nb_regions(); m++ ) {
for( index_t c = 0; c < gmm.cells.nb_cells( m ); c++ ) {
index_t cell_in_gmm = gmm.cells.cell( m, c ) ;
for( index_t f = 0; f < gmm.cells.nb_facets( cell_in_gmm ); f++ ) {
index_t global_c_adj = gmm.cells.adjacent( cell_in_gmm, f ) ;
if( global_c_adj == GEO::NO_CELL ) {
...
} else {
...
}
}
}
}