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

#include <geomodel_mesh.h>

Inheritance diagram for RINGMesh::GeoModelMeshVerticesBase< DIMENSION >:
RINGMesh::GeoModelMeshCommon< DIMENSION > RINGMesh::GeoModelMeshVertices< DIMENSION >

Classes

class  GeoModelVertexMapper
 

Public Member Functions

GEO::AttributesManager & attribute_manager () const
 
bool is_initialized () const
 
void test_and_initialize () const
 
index_t nb () const
 Number of non colocated vertices stored. More...
 
const vecn< DIMENSION > & vertex (index_t v) const
 Coordinates of a vertex of the GeoModel. More...
 
index_t index (const vecn< DIMENSION > &p) const
 Returns the index of the given vertex in the geomodel. More...
 
index_t geomodel_vertex_id (const gmme_id &mesh_entity, index_t entity_vertex_index=0) const
 Get the GeoModelMesh index of a GeoModelMeshEntity vertex from its index in that GeoModelMeshEntity. More...
 
index_t geomodel_vertex_id (const gmme_id &mesh_entity, const ElementLocalVertex &element_local_vertex) const
 Get the GeoModelMesh index of a GeoModelMeshEntity vertex from its index in that GeoModelMeshEntity. More...
 
std::vector< index_t > mesh_entity_vertex_id (const gmme_id &mesh_entity, index_t geomodel_vertex_id) const
 Get the GeoModelMeshEntity vertices from its index in the GeoModelMesh. More...
 
const std::vector< GMEVertex > & gme_vertices (index_t v) const
 Get the vertices in GeoModelEntity corresponding to the given unique vertex. More...
 
std::vector< GMEVertexgme_type_vertices (const MeshEntityType &entity_type, index_t vertex) const
 Get the vertex indices in the specified MeshEntity type corresponding to the given unique vertex. More...
 
index_t add_vertex (const vecn< DIMENSION > &point)
 To use when building the geomodel by first adding its vertices. More...
 
index_t add_vertices (const std::vector< vecn< DIMENSION > > &points)
 
void update_point (index_t v, const vecn< DIMENSION > &point)
 Set the point coordinates of all the vertices that share this unique vertex, including the unique vertex itself. More...
 
void update_vertex_mapping (const gmme_id &entity_id, index_t entity_vertex_index, index_t geomodel_vertex_index)
 
virtual void clear ()
 Clear the vertices - clear the gme_vertices_ - clear global vertex information in the all BMME. More...
 
void unbind_geomodel_vertex_map (const gmme_id &mesh_entity_id)
 
void bind_geomodel_vertex_map (const gmme_id &mesh_entity_id)
 
const NNSearch< DIMENSION > & nn_search () const
 
void remove_colocated ()
 Remove colocated vertices. More...
 
void erase_vertices (std::vector< index_t > &to_delete)
 Delete vertices for which to_delete[i] != i The global vertices are deleted, gme_vertices_ is updated and the geomodel_vertx_id in the GeoModelMeshEntity of the GeoModel are updated too. More...
 

Protected Member Functions

 GeoModelMeshVerticesBase (GeoModelMesh< DIMENSION > &gmm, GeoModel< DIMENSION > &gm, std::unique_ptr< PointSetMesh< DIMENSION > > &mesh)
 
virtual index_t nb_total_vertices () const
 return the number of all vertices it is computed summing all entities.nb(). More...
 
virtual index_t fill_vertices ()
 
void fill_vertices_for_entity_type (const GeoModel< DIMENSION > &M, const MeshEntityType &entity_type, index_t &count)
 
- 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

std::unique_ptr< PointSetMesh< DIMENSION > > & mesh_
 Attached Mesh. More...
 
GeoModelVertexMapper vertex_mapper_
 Mapper from/to GeoModelMeshEntity vertices. More...
 
- 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...
 

Private Member Functions

void initialize ()
 Initialize the vertices from the vertices of the GeoModel Corners, Lines, Surfaces and Regions. More...
 

Friends

class GeoModelMeshWells< DIMENSION >
 
class GeoModelMeshEdges< DIMENSION >
 
class GeoModelMeshPolygonsBase< DIMENSION >
 
class GeoModelMeshCells< DIMENSION >
 

Detailed Description

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

Definition at line 109 of file geomodel_mesh.h.

Constructor & Destructor Documentation

◆ GeoModelMeshVerticesBase()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::GeoModelMeshVerticesBase ( GeoModelMesh< DIMENSION > &  gmm,
GeoModel< DIMENSION > &  gm,
std::unique_ptr< PointSetMesh< DIMENSION > > &  mesh 
)
protected

Definition at line 427 of file geomodel_mesh.cpp.

Member Function Documentation

◆ add_vertex()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::add_vertex ( const vecn< DIMENSION > &  point)

To use when building the geomodel by first adding its vertices.

Returns
the first index of created vertices
Warning
The client is responsible for setting the mapping between the points of the GeoModelEntity and the unique vertex

Definition at line 655 of file geomodel_mesh.cpp.

◆ add_vertices()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::add_vertices ( const std::vector< vecn< DIMENSION > > &  points)

Definition at line 666 of file geomodel_mesh.cpp.

◆ attribute_manager()

template<index_t DIMENSION>
GEO::AttributesManager& RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::attribute_manager ( ) const
inline

Definition at line 118 of file geomodel_mesh.h.

◆ bind_geomodel_vertex_map()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::bind_geomodel_vertex_map ( const gmme_id mesh_entity_id)

Definition at line 569 of file geomodel_mesh.cpp.

◆ clear()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::clear ( )
virtual

Clear the vertices - clear the gme_vertices_ - clear global vertex information in the all BMME.

Warning
Not stable - crashes if attributes are still bound

Reimplemented in RINGMesh::GeoModelMeshVertices< 3 >.

Definition at line 550 of file geomodel_mesh.cpp.

◆ erase_vertices()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::erase_vertices ( std::vector< index_t > &  to_delete)

Delete vertices for which to_delete[i] != i The global vertices are deleted, gme_vertices_ is updated and the geomodel_vertx_id in the GeoModelMeshEntity of the GeoModel are updated too.

Parameters
[in,out]to_deletecan be NO_ID or give the index of a kept vertex with which information should be merged. It is recycled to give the mapping between old and new vertex indices
Precondition
to_delete[ v ] is either NO_ID, or is equal or inferior to v

Definition at line 737 of file geomodel_mesh.cpp.

◆ fill_vertices()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::fill_vertices ( )
protectedvirtual

Reimplemented in RINGMesh::GeoModelMeshVertices< 3 >.

Definition at line 537 of file geomodel_mesh.cpp.

◆ fill_vertices_for_entity_type()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::fill_vertices_for_entity_type ( const GeoModel< DIMENSION > &  M,
const MeshEntityType entity_type,
index_t &  count 
)
protected

Definition at line 466 of file geomodel_mesh.cpp.

◆ geomodel_vertex_id() [1/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::geomodel_vertex_id ( const gmme_id mesh_entity,
index_t  entity_vertex_index = 0 
) const

Get the GeoModelMesh index of a GeoModelMeshEntity vertex from its index in that GeoModelMeshEntity.

Parameters
[in]mesh_entityGeoModelMeshEntity that vertex belongs to
[in]entity_vertex_indexindex of the query vertex in the GeoModelMeshEntity
Returns
if found the vertex index in the geomodel, else NO_ID.

Definition at line 607 of file geomodel_mesh.cpp.

◆ geomodel_vertex_id() [2/2]

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::geomodel_vertex_id ( const gmme_id mesh_entity,
const ElementLocalVertex element_local_vertex 
) const

Get the GeoModelMesh index of a GeoModelMeshEntity vertex from its index in that GeoModelMeshEntity.

Parameters
[in]mesh_entityGeoModelMeshEntity that vertex belongs to
[in]element_local_vertexlocal vertex in the element
Returns
if found the vertex index in the geomodel, else NO_ID.

Definition at line 616 of file geomodel_mesh.cpp.

◆ gme_type_vertices()

template<index_t DIMENSION>
std::vector< GMEVertex > RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::gme_type_vertices ( const MeshEntityType entity_type,
index_t  vertex 
) const

Get the vertex indices in the specified MeshEntity type corresponding to the given unique vertex.

Definition at line 647 of file geomodel_mesh.cpp.

◆ gme_vertices()

template<index_t DIMENSION>
const std::vector< GMEVertex > & RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::gme_vertices ( index_t  v) const

Get the vertices in GeoModelEntity corresponding to the given unique vertex.

Parameters
[in]vertexVertex index in the geomodel
Returns
Corresponding GeoModelMeshEntity vertices

Definition at line 639 of file geomodel_mesh.cpp.

◆ index()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::index ( const vecn< DIMENSION > &  p) const

Returns the index of the given vertex in the geomodel.

Parameters
[in]pinput point coordinates
Returns
index of the vertex in the geomodel if found (distance < epsilon), otherwise NO_ID

Definition at line 592 of file geomodel_mesh.cpp.

◆ initialize()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::initialize ( )
private

Initialize the vertices from the vertices of the GeoModel Corners, Lines, Surfaces and Regions.

Fills the mesh_->vertices, computes the vertex mapping and delete colocated vertices

Definition at line 511 of file geomodel_mesh.cpp.

◆ is_initialized()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::is_initialized ( ) const

Tests if the mesh vertices are initialized

Definition at line 439 of file geomodel_mesh.cpp.

◆ mesh_entity_vertex_id()

template<index_t DIMENSION>
std::vector< index_t > RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::mesh_entity_vertex_id ( const gmme_id mesh_entity,
index_t  geomodel_vertex_id 
) const

Get the GeoModelMeshEntity vertices from its index in the GeoModelMesh.

Parameters
[in]mesh_entityUnique id to a GeoModelMeshEntity
[in]geomodel_vertex_idIndex of the query vertex in the geomodel
Returns
Corresponding GeoModelMeshEntity vertices

Definition at line 628 of file geomodel_mesh.cpp.

◆ nb()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::nb ( ) const

Number of non colocated vertices stored.

Definition at line 576 of file geomodel_mesh.cpp.

◆ nb_total_vertices()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::nb_total_vertices ( ) const
protectedvirtual

return the number of all vertices it is computed summing all entities.nb().

Note
colocated vertices are counted twice or more.

Reimplemented in RINGMesh::GeoModelMeshVertices< 3 >.

Definition at line 498 of file geomodel_mesh.cpp.

◆ nn_search()

template<index_t DIMENSION>
const NNSearch< DIMENSION >& RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::nn_search ( ) const
inline

Definition at line 234 of file geomodel_mesh.h.

◆ remove_colocated()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::remove_colocated ( )

Remove colocated vertices.

Definition at line 716 of file geomodel_mesh.cpp.

◆ test_and_initialize()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::test_and_initialize ( ) const

Tests if the mesh vertices need to be initialized, if so initialize them.

Definition at line 445 of file geomodel_mesh.cpp.

◆ unbind_geomodel_vertex_map()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::unbind_geomodel_vertex_map ( const gmme_id mesh_entity_id)

Definition at line 562 of file geomodel_mesh.cpp.

◆ update_point()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::update_point ( index_t  v,
const vecn< DIMENSION > &  point 
)

Set the point coordinates of all the vertices that share this unique vertex, including the unique vertex itself.

Parameters
[in]vertexIndex of the vertex
[in]pointNew coordinates

Definition at line 682 of file geomodel_mesh.cpp.

◆ update_vertex_mapping()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::update_vertex_mapping ( const gmme_id entity_id,
index_t  entity_vertex_index,
index_t  geomodel_vertex_index 
)

Definition at line 703 of file geomodel_mesh.cpp.

◆ vertex()

template<index_t DIMENSION>
const vecn< DIMENSION > & RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::vertex ( index_t  v) const

Coordinates of a vertex of the GeoModel.

Precondition
v < nb()

Definition at line 583 of file geomodel_mesh.cpp.

Friends And Related Function Documentation

◆ GeoModelMeshCells< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshCells< DIMENSION >
friend

Definition at line 116 of file geomodel_mesh.h.

◆ GeoModelMeshEdges< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshEdges< DIMENSION >
friend

Definition at line 114 of file geomodel_mesh.h.

◆ GeoModelMeshPolygonsBase< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshPolygonsBase< DIMENSION >
friend

Definition at line 115 of file geomodel_mesh.h.

◆ GeoModelMeshWells< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshWells< DIMENSION >
friend

Definition at line 113 of file geomodel_mesh.h.

Member Data Documentation

◆ mesh_

template<index_t DIMENSION>
std::unique_ptr< PointSetMesh< DIMENSION > >& RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::mesh_
protected

Attached Mesh.

Definition at line 504 of file geomodel_mesh.h.

◆ vertex_mapper_

template<index_t DIMENSION>
GeoModelVertexMapper RINGMesh::GeoModelMeshVerticesBase< DIMENSION >::vertex_mapper_
protected

Mapper from/to GeoModelMeshEntity vertices.

Definition at line 506 of file geomodel_mesh.h.


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