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

Abstract base class for GeoModelMeshEntity. More...

#include <geomodel_mesh_entity.h>

Inheritance diagram for RINGMesh::GeoModelMeshEntity< DIMENSION >:
RINGMesh::GeoModelEntity< DIMENSION > RINGMesh::Corner< DIMENSION > RINGMesh::Line< DIMENSION > RINGMesh::Region< DIMENSION > RINGMesh::SurfaceBase< DIMENSION > RINGMesh::SurfaceBase< 2 > RINGMesh::SurfaceBase< 3 > RINGMesh::Surface< DIMENSION > RINGMesh::Surface< 2 > RINGMesh::Surface< 3 >

Public Member Functions

virtual ~GeoModelMeshEntity ()
 
virtual MeshEntityType type_name () const =0
 
gmme_id gmme () const
 
MeshEntityType mesh_entity_type () const
 
bool is_valid () const final
 Global validity of the entity. More...
 
virtual bool is_connectivity_valid () const
 
bool is_parent_connectivity_valid () const
 
void save (const std::string &filename) const
 
const NNSearch< DIMENSION > & vertex_nn_search () const
 Return the NNSearch for the Entity vertices. More...
 
GEO::AttributesManager & vertex_attribute_manager () const
 
Boundary relationship functions
index_t nb_boundaries () const
 
const gmme_idboundary_gmme (index_t x) const
 
const GeoModelMeshEntity< DIMENSION > & boundary (index_t x) const
 
index_t nb_incident_entities () const
 
const gmme_idincident_entity_gmme (index_t x) const
 
const GeoModelMeshEntity< DIMENSION > & incident_entity (index_t x) const
 
bool has_inside_border () const
 Check if one entity is twice in the boundary. More...
 
bool is_inside_border (const GeoModelMeshEntity &rhs) const
 Check if this entity is an inside border of rhs. More...
 
Parents/children relationship functions
bool has_parent () const
 
bool has_parent (const GeologicalEntityType &parent_type) const
 Check if the entity has a parent of the given type. More...
 
index_t nb_parents () const
 
const gmge_idparent_gmge (index_t id) const
 
const gmge_id parent_gmge (const GeologicalEntityType &parent_type) const
 Returns the gmge_id of the parent of the given type. More...
 
const GeoModelGeologicalEntity< DIMENSION > & parent (index_t parent_index) const
 
const GeoModelGeologicalEntity< DIMENSION > & parent (const GeologicalEntityType &parent_type) const
 
Local access to the GeoModelMeshEntity geometry
index_t nb_vertices () const
 
const vecn< DIMENSION > & vertex (index_t vertex_index) const
 Coordinates of the vertex_index. More...
 
virtual index_t nb_mesh_elements () const =0
 Get the number constitutive elements of the mesh. More...
 
virtual index_t nb_mesh_element_vertices (index_t mesh_element_index) const =0
 Number of vertices of a constitutive element of the mesh. More...
 
virtual index_t mesh_element_vertex_index (const ElementLocalVertex &element_local_vertex) const =0
 Convert the index in a mesh element to an index in the Entity. More...
 
const vecn< DIMENSION > & mesh_element_vertex (const ElementLocalVertex &element_local_vertex) const
 Coordinates of a vertex of a mesh element. More...
 
Geometrical request on Entity
virtual double mesh_element_size (index_t mesh_element_index) const =0
 
virtual vecn< DIMENSION > mesh_element_barycenter (index_t mesh_element_index) const =0
 
vecn< DIMENSION > entity_barycenter () const
 
virtual double size () const
 
- Public Member Functions inherited from RINGMesh::GeoModelEntity< DIMENSION >
virtual ~GeoModelEntity ()=default
 
virtual bool is_on_voi () const =0
 
const GeoModel< DIMENSION > & geomodel () const
 
const std::string & name () const
 
index_t index () const
 

Protected Member Functions

 GeoModelMeshEntity (const GeoModel< DIMENSION > &geomodel, index_t id)
 
virtual void copy_mesh_entity (const GeoModelMeshEntity< DIMENSION > &from)
 
virtual bool is_index_valid () const final
 
virtual bool is_mesh_valid () const
 
void set_mesh (std::shared_ptr< MeshBase< DIMENSION > > mesh)
 
bool is_boundary_connectivity_valid () const
 
bool is_incident_entity_connectivity_valid () const
 
bool are_geomodel_vertex_indices_valid () const
 Check that geomodel vertex indices are consistent with what is stored at the GeoModel level. More...
 
void unbind_vertex_mapping_attribute () const
 
void bind_vertex_mapping_attribute () const
 
virtual void change_mesh_data_structure (const MeshType &type)=0
 
- Protected Member Functions inherited from RINGMesh::GeoModelEntity< DIMENSION >
 GeoModelEntity (const GeoModel< DIMENSION > &geomodel, index_t id)
 
void copy_name (const GeoModelEntity< DIMENSION > &from)
 

Protected Attributes

std::vector< index_t > boundaries_ {}
 Boundary relations of this entity. More...
 
std::vector< index_t > incident_entities_ {}
 Incident-entity relations of this entity. More...
 
std::vector< index_t > parents_ {}
 Parents relations of this entity. More...
 
- Protected Attributes inherited from RINGMesh::GeoModelEntity< DIMENSION >
const GeoModel< DIMENSION > & geomodel_
 Reference to the GeoModel owning this entity. More...
 
std::string name_ = std::string{ "Unnamed" }
 Name of the entity - default is "Unnamed". More...
 
index_t id_ { NO_ID }
 Index of the entity. More...
 

Private Member Functions

 ringmesh_disable_copy_and_move (GeoModelMeshEntity)
 
 ringmesh_template_assert_2d_or_3d (DIMENSION)
 
gmge_id defined_parent_gmge (const GeologicalEntityType &parent_type) const
 
gmge_id could_be_undefined_parent_gmge (const GeologicalEntityType &parent_type) const
 

Private Attributes

std::shared_ptr< MeshBase< DIMENSION > > mesh_ {}
 The RINGMesh::Mesh giving the geometry of this entity. More...
 

Friends

class GeoModelMeshEntityAccess< DIMENSION >
 
class GeoModelMeshEntityConstAccess< DIMENSION >
 

Detailed Description

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

Abstract base class for GeoModelMeshEntity.

The GeoModelMeshEntity geometrical representation is stored as a RINGMesh::Mesh. We defines generic access to the RINGMesh::Mesh geometry.

Definition at line 77 of file geomodel_mesh_entity.h.

Constructor & Destructor Documentation

◆ ~GeoModelMeshEntity()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshEntity< DIMENSION >::~GeoModelMeshEntity ( )
virtual

Definition at line 243 of file geomodel_mesh_entity.cpp.

◆ GeoModelMeshEntity()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshEntity< DIMENSION >::GeoModelMeshEntity ( const GeoModel< DIMENSION > &  geomodel,
index_t  id 
)
inlineprotected

Definition at line 301 of file geomodel_mesh_entity.h.

Member Function Documentation

◆ are_geomodel_vertex_indices_valid()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::are_geomodel_vertex_indices_valid ( ) const
protected

Check that geomodel vertex indices are consistent with what is stored at the GeoModel level.

Definition at line 269 of file geomodel_mesh_entity.cpp.

◆ bind_vertex_mapping_attribute()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshEntity< DIMENSION >::bind_vertex_mapping_attribute ( ) const
protected

Definition at line 261 of file geomodel_mesh_entity.cpp.

◆ boundary()

template<index_t DIMENSION>
const GeoModelMeshEntity< DIMENSION > & RINGMesh::GeoModelMeshEntity< DIMENSION >::boundary ( index_t  x) const

Definition at line 529 of file geomodel_mesh_entity.cpp.

◆ boundary_gmme()

template<index_t DIMENSION>
const gmme_id & RINGMesh::GeoModelMeshEntity< DIMENSION >::boundary_gmme ( index_t  x) const

Definition at line 518 of file geomodel_mesh_entity.cpp.

◆ change_mesh_data_structure()

template<index_t DIMENSION>
virtual void RINGMesh::GeoModelMeshEntity< DIMENSION >::change_mesh_data_structure ( const MeshType type)
protectedpure virtual

◆ copy_mesh_entity()

template<index_t DIMENSION>
virtual void RINGMesh::GeoModelMeshEntity< DIMENSION >::copy_mesh_entity ( const GeoModelMeshEntity< DIMENSION > &  from)
inlineprotectedvirtual

Reimplemented in RINGMesh::Region< DIMENSION >.

Definition at line 306 of file geomodel_mesh_entity.h.

◆ could_be_undefined_parent_gmge()

template<index_t DIMENSION>
gmge_id RINGMesh::GeoModelMeshEntity< DIMENSION >::could_be_undefined_parent_gmge ( const GeologicalEntityType parent_type) const
private

Definition at line 494 of file geomodel_mesh_entity.cpp.

◆ defined_parent_gmge()

template<index_t DIMENSION>
gmge_id RINGMesh::GeoModelMeshEntity< DIMENSION >::defined_parent_gmge ( const GeologicalEntityType parent_type) const
private

Definition at line 509 of file geomodel_mesh_entity.cpp.

◆ entity_barycenter()

template<index_t DIMENSION>
vecn< DIMENSION > RINGMesh::GeoModelMeshEntity< DIMENSION >::entity_barycenter ( ) const
inline

Definition at line 273 of file geomodel_mesh_entity.h.

◆ gmme()

template<index_t DIMENSION>
gmme_id RINGMesh::GeoModelMeshEntity< DIMENSION >::gmme ( ) const
inline

Definition at line 89 of file geomodel_mesh_entity.h.

◆ has_inside_border()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::has_inside_border ( ) const

Check if one entity is twice in the boundary.

Definition at line 230 of file geomodel_mesh_entity.cpp.

◆ has_parent() [1/2]

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::has_parent ( ) const
inline

Definition at line 152 of file geomodel_mesh_entity.h.

◆ has_parent() [2/2]

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::has_parent ( const GeologicalEntityType parent_type) const
inline

Check if the entity has a parent of the given type.

Definition at line 160 of file geomodel_mesh_entity.h.

◆ incident_entity()

template<index_t DIMENSION>
const GeoModelMeshEntity< DIMENSION > & RINGMesh::GeoModelMeshEntity< DIMENSION >::incident_entity ( index_t  x) const

Definition at line 536 of file geomodel_mesh_entity.cpp.

◆ incident_entity_gmme()

template<index_t DIMENSION>
const gmme_id & RINGMesh::GeoModelMeshEntity< DIMENSION >::incident_entity_gmme ( index_t  x) const

Definition at line 542 of file geomodel_mesh_entity.cpp.

◆ is_boundary_connectivity_valid()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_boundary_connectivity_valid ( ) const
protected

All entities in the boundary must have this in their incident_entity vector

Definition at line 318 of file geomodel_mesh_entity.cpp.

◆ is_connectivity_valid()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_connectivity_valid ( ) const
virtual

Check that required information for the TYPE is defined and that reverse information is stored by the corresponding entities

Reimplemented in RINGMesh::Region< DIMENSION >, and RINGMesh::Line< DIMENSION >.

Definition at line 461 of file geomodel_mesh_entity.cpp.

◆ is_incident_entity_connectivity_valid()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_incident_entity_connectivity_valid ( ) const
protected

All entities must be at least in the boundary of another entity and all entities in the incident_entity must have this entity in their boundary vector

Definition at line 356 of file geomodel_mesh_entity.cpp.

◆ is_index_valid()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_index_valid ( ) const
finalprotectedvirtual

Implements RINGMesh::GeoModelEntity< DIMENSION >.

Definition at line 312 of file geomodel_mesh_entity.cpp.

◆ is_inside_border()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_inside_border ( const GeoModelMeshEntity< DIMENSION > &  rhs) const

Check if this entity is an inside border of rhs.

That can be Surface stopping in a Region, or Line stopping in a Surface.

Parameters
[in]rhsThe entity to test

Definition at line 214 of file geomodel_mesh_entity.cpp.

◆ is_mesh_valid()

template<index_t DIMENSION>
virtual bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_mesh_valid ( ) const
inlineprotectedvirtual

◆ is_parent_connectivity_valid()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_parent_connectivity_valid ( ) const

Check that for each parent type, this entity has one and only one parent of that type.

Definition at line 401 of file geomodel_mesh_entity.cpp.

◆ is_valid()

template<index_t DIMENSION>
bool RINGMesh::GeoModelMeshEntity< DIMENSION >::is_valid ( ) const
inlinefinalvirtual

Global validity of the entity.

Implements RINGMesh::GeoModelEntity< DIMENSION >.

Definition at line 100 of file geomodel_mesh_entity.h.

◆ mesh_element_barycenter()

template<index_t DIMENSION>
virtual vecn< DIMENSION > RINGMesh::GeoModelMeshEntity< DIMENSION >::mesh_element_barycenter ( index_t  mesh_element_index) const
pure virtual

◆ mesh_element_size()

template<index_t DIMENSION>
virtual double RINGMesh::GeoModelMeshEntity< DIMENSION >::mesh_element_size ( index_t  mesh_element_index) const
pure virtual

◆ mesh_element_vertex()

template<index_t DIMENSION>
const vecn< DIMENSION >& RINGMesh::GeoModelMeshEntity< DIMENSION >::mesh_element_vertex ( const ElementLocalVertex element_local_vertex) const
inline

Coordinates of a vertex of a mesh element.

Parameters
[in]mesh_element_indexIndex of a constitutive element of the mesh
[in]vertex_local_indexLocal index of a vertex in the constitutive mesh element
Returns
the vertex coordinates in the GeoModelMeshEntity

Definition at line 258 of file geomodel_mesh_entity.h.

◆ mesh_element_vertex_index()

template<index_t DIMENSION>
virtual index_t RINGMesh::GeoModelMeshEntity< DIMENSION >::mesh_element_vertex_index ( const ElementLocalVertex element_local_vertex) const
pure virtual

Convert the index in a mesh element to an index in the Entity.

Parameters
[in]mesh_element_indexIndex of a constitutive element of the mesh
[in]vertex_local_indexLocal index of a vertex in the constitutive mesh element
Returns
the global index of the vertex in the GeoModelMeshEntity

Implemented in RINGMesh::Region< DIMENSION >, RINGMesh::SurfaceBase< DIMENSION >, RINGMesh::SurfaceBase< 2 >, RINGMesh::SurfaceBase< 3 >, RINGMesh::Line< DIMENSION >, and RINGMesh::Corner< DIMENSION >.

◆ mesh_entity_type()

template<index_t DIMENSION>
MeshEntityType RINGMesh::GeoModelMeshEntity< DIMENSION >::mesh_entity_type ( ) const
inline

Definition at line 93 of file geomodel_mesh_entity.h.

◆ nb_boundaries()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshEntity< DIMENSION >::nb_boundaries ( ) const
inline

Definition at line 121 of file geomodel_mesh_entity.h.

◆ nb_incident_entities()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshEntity< DIMENSION >::nb_incident_entities ( ) const
inline

Definition at line 128 of file geomodel_mesh_entity.h.

◆ nb_mesh_element_vertices()

template<index_t DIMENSION>
virtual index_t RINGMesh::GeoModelMeshEntity< DIMENSION >::nb_mesh_element_vertices ( index_t  mesh_element_index) const
pure virtual

◆ nb_mesh_elements()

template<index_t DIMENSION>
virtual index_t RINGMesh::GeoModelMeshEntity< DIMENSION >::nb_mesh_elements ( ) const
pure virtual

Get the number constitutive elements of the mesh.

Constitutive elements are those of the dimension of the object. segments for lines, polygons for surfaces and cells for volumetric meshes.

Implemented in RINGMesh::Region< DIMENSION >, RINGMesh::SurfaceBase< DIMENSION >, RINGMesh::SurfaceBase< 2 >, RINGMesh::SurfaceBase< 3 >, RINGMesh::Line< DIMENSION >, and RINGMesh::Corner< DIMENSION >.

◆ nb_parents()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshEntity< DIMENSION >::nb_parents ( ) const
inline

Definition at line 165 of file geomodel_mesh_entity.h.

◆ nb_vertices()

template<index_t DIMENSION>
index_t RINGMesh::GeoModelMeshEntity< DIMENSION >::nb_vertices ( ) const
inline

Definition at line 213 of file geomodel_mesh_entity.h.

◆ parent() [1/2]

template<index_t DIMENSION>
const GeoModelGeologicalEntity< DIMENSION > & RINGMesh::GeoModelMeshEntity< DIMENSION >::parent ( index_t  parent_index) const

Definition at line 469 of file geomodel_mesh_entity.cpp.

◆ parent() [2/2]

template<index_t DIMENSION>
const GeoModelGeologicalEntity< DIMENSION > & RINGMesh::GeoModelMeshEntity< DIMENSION >::parent ( const GeologicalEntityType parent_type) const

Definition at line 478 of file geomodel_mesh_entity.cpp.

◆ parent_gmge() [1/2]

template<index_t DIMENSION>
const gmge_id & RINGMesh::GeoModelMeshEntity< DIMENSION >::parent_gmge ( index_t  id) const

Definition at line 552 of file geomodel_mesh_entity.cpp.

◆ parent_gmge() [2/2]

template<index_t DIMENSION>
const gmge_id RINGMesh::GeoModelMeshEntity< DIMENSION >::parent_gmge ( const GeologicalEntityType parent_type) const

Returns the gmge_id of the parent of the given type.

Precondition
The code assumes that this entity has a parent of the given type parent_type_name, else it will crash in debug and return an invalid entity in release. The method has_parent(GeologicalEntityType) is a safe way to check if the type parent_type_name is a valid parent type for the GeoModelMeshEntity.
Parameters
[in]parent_type_namethe asking parent type

Definition at line 487 of file geomodel_mesh_entity.cpp.

◆ ringmesh_disable_copy_and_move()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshEntity< DIMENSION >::ringmesh_disable_copy_and_move ( GeoModelMeshEntity< DIMENSION >  )
private

◆ ringmesh_template_assert_2d_or_3d()

template<index_t DIMENSION>
RINGMesh::GeoModelMeshEntity< DIMENSION >::ringmesh_template_assert_2d_or_3d ( DIMENSION  )
private

◆ save()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshEntity< DIMENSION >::save ( const std::string &  filename) const
inline

Definition at line 195 of file geomodel_mesh_entity.h.

◆ set_mesh()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshEntity< DIMENSION >::set_mesh ( std::shared_ptr< MeshBase< DIMENSION > >  mesh)
inlineprotected

Definition at line 322 of file geomodel_mesh_entity.h.

◆ size()

template<index_t DIMENSION>
virtual double RINGMesh::GeoModelMeshEntity< DIMENSION >::size ( ) const
inlinevirtual

Reimplemented in RINGMesh::Region< DIMENSION >, and RINGMesh::Corner< DIMENSION >.

Definition at line 284 of file geomodel_mesh_entity.h.

◆ type_name()

◆ unbind_vertex_mapping_attribute()

template<index_t DIMENSION>
void RINGMesh::GeoModelMeshEntity< DIMENSION >::unbind_vertex_mapping_attribute ( ) const
protected

Definition at line 253 of file geomodel_mesh_entity.cpp.

◆ vertex()

template<index_t DIMENSION>
const vecn< DIMENSION >& RINGMesh::GeoModelMeshEntity< DIMENSION >::vertex ( index_t  vertex_index) const
inline

Coordinates of the vertex_index.

Definition at line 220 of file geomodel_mesh_entity.h.

◆ vertex_attribute_manager()

template<index_t DIMENSION>
GEO::AttributesManager& RINGMesh::GeoModelMeshEntity< DIMENSION >::vertex_attribute_manager ( ) const
inline

Definition at line 295 of file geomodel_mesh_entity.h.

◆ vertex_nn_search()

template<index_t DIMENSION>
const NNSearch< DIMENSION >& RINGMesh::GeoModelMeshEntity< DIMENSION >::vertex_nn_search ( ) const
inline

Return the NNSearch for the Entity vertices.

Definition at line 203 of file geomodel_mesh_entity.h.

Friends And Related Function Documentation

◆ GeoModelMeshEntityAccess< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshEntityAccess< DIMENSION >
friend

Definition at line 81 of file geomodel_mesh_entity.h.

◆ GeoModelMeshEntityConstAccess< DIMENSION >

template<index_t DIMENSION>
friend class GeoModelMeshEntityConstAccess< DIMENSION >
friend

Definition at line 82 of file geomodel_mesh_entity.h.

Member Data Documentation

◆ boundaries_

template<index_t DIMENSION>
std::vector< index_t > RINGMesh::GeoModelMeshEntity< DIMENSION >::boundaries_ {}
protected

Boundary relations of this entity.

Definition at line 362 of file geomodel_mesh_entity.h.

◆ incident_entities_

template<index_t DIMENSION>
std::vector< index_t > RINGMesh::GeoModelMeshEntity< DIMENSION >::incident_entities_ {}
protected

Incident-entity relations of this entity.

Definition at line 365 of file geomodel_mesh_entity.h.

◆ mesh_

template<index_t DIMENSION>
std::shared_ptr< MeshBase< DIMENSION > > RINGMesh::GeoModelMeshEntity< DIMENSION >::mesh_ {}
private

The RINGMesh::Mesh giving the geometry of this entity.

Definition at line 372 of file geomodel_mesh_entity.h.

◆ parents_

template<index_t DIMENSION>
std::vector< index_t > RINGMesh::GeoModelMeshEntity< DIMENSION >::parents_ {}
protected

Parents relations of this entity.

Definition at line 368 of file geomodel_mesh_entity.h.


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