Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::MeshBase< IndexT > Class Template Referenceabstract

base mesh class More...

+ Inheritance diagram for Feel::MeshBase< IndexT >:
+ Collaboration diagram for Feel::MeshBase< IndexT >:

Typedefs

using super = CommObject
 
using index_type = IndexT
 type of indices : default to uint32_type
 
using index_t = index_type
 
using size_type = index_type
 
typedef boost::tuple< index_type, index_type > face_processor_type
 Tuple that contains. More...
 
typedef SubMeshData< index_type > smd_type
 
typedef std::shared_ptr< smd_type > smd_ptrtype
 

Methods

class boost::serialization::access
 check elements orientation and fix it if needed
 
std::map< std::string, std::vector< size_type > > M_markername
 marker name dictionary ( std::string -> <int,int> ) get<0>() provides the id get<1>() provides the topological dimension
 
virtual void clear ()
 Empty all containers of the mesh. More...
 
virtual void updateForUse ()=0
 update all info for this mesh.
 
virtual void updateForUse (size_type components)
 update all info for this mesh according the components More...
 
virtual void updateForUseAfterMovingNodes (bool upMeasures=true)=0
 update the mesh when nodes have moved
 
virtual void partition (const rank_type n_parts)=0
 Call the default partitioner (currently metis_partition()).
 
virtual void meshModified ()=0
 
void setSubMeshData (smd_ptrtype smd)
 set sub mesh data
 
smd_ptrtype subMeshData () const
 return sub mesh data
 
bool hasSubMeshData () const
 
smd_type::mesh_ptrtype subMesh () const
 
smd_type::mesh_ptrtype parentMesh () const
 
bool isSubMesh () const
 true if is a sub mesh
 
bool isSubMeshFrom (MeshBase const *m) const
 
bool isSubMeshFrom (std::shared_ptr< MeshBase > m) const
 
bool isParentMeshOf (MeshBase const *m) const
 
bool isParentMeshOf (std::shared_ptr< MeshBase > m) const
 
bool isSiblingOf (MeshBase const *m) const
 
bool isSiblingOf (std::shared_ptr< MeshBase > m) const
 
template<typename M >
bool isSameMesh (M const *m) const
 
template<typename M >
bool isSameMesh (std::shared_ptr< M > m) const
 
template<typename M >
bool isRelatedTo (M const *m) const
 
template<typename M >
bool isRelatedTo (std::shared_ptr< M > m) const
 
size_type subMeshToMesh (size_type id) const
 
size_type meshToSubMesh (size_type id) const
 
std::pair< std::vector< size_type >, bool > meshToSubMesh (std::vector< size_type > const &p, bool add_invalid_indices=false) const
 
size_type subMeshToMesh (std::shared_ptr< MeshBase > m, size_type id) const
 
size_type meshToSubMesh (std::shared_ptr< MeshBase > m, size_type id) const
 
template<typename MeshType >
void addMeshWithNodesShared (std::shared_ptr< MeshType > m)
 store a mesh which has nodes shared with the current mesh
 
template<typename MeshType >
void addMeshWithNodesShared (std::shared_ptr< const MeshType > m)
 store a mesh which has nodes shared with the current mesh
 
std::vector< std::shared_ptr< MeshBase< IndexT > > > meshesWithNodesShared () const
 get all meshes which share the nodes with the current mesh (current mesh is also include)
 
void attachMeshSupport (MeshSupportBase *ms) const
 attach a mesh support
 
void detachMeshSupport (MeshSupportBase *ms) const
 detach a mesh support
 
std::vector< MeshSupportBase * > const & meshSupportsAttached () const
 return all mesh supports attached
 
bool hasAllMarkers (std::initializer_list< std::string > l)
 
bool hasAnyMarker (std::initializer_list< std::string > l)
 
bool hasMarker (std::string const &marker) const
 
bool hasElementMarker (std::string const &marker) const
 
bool hasFaceMarker (std::string const &marker) const
 
bool hasEdgeMarker (std::string const &marker) const
 
bool hasPointMarker (std::string const &marker) const
 
bool hasMarkers (std::initializer_list< std::string > l) const
 
size_type markerName (std::string const &marker) const
 
std::string markerName (size_type marker) const
 
std::string markerName (size_type marker, size_type dim) const
 
size_type markerDim (std::string const &marker) const
 
std::map< std::string, std::vector< size_type > > markerNames () const
 
void setMarkerNames (std::map< std::string, std::vector< size_type > > const &m)
 set the marker names
 
void addMarkerName (std::pair< std::string, std::vector< size_type > > const &marker)
 add a new marker name
 
void addMarkerName (std::string __name, int __id, int __topoDim)
 add a new marker name
 
flag_type markerId (boost::any const &marker) const
 
std::set< flag_type > markersId (boost::any const &marker) const
 
void setUpdatedForUse (bool u)
 Set whether the mesh is finalized and ready for use. More...
 
void markGeometryChanged ()
 Advance the coordinate-only geometry revision.
 
virtual void renumber ()=0
 After loading/defining a mesh, we want to have as much locality as possible (elements/faces/nodes to be contiguous). More...
 
virtual void updateEntitiesCoDimensionOne ()=0
 update the entities of co-dimension 1
 
virtual void updateEntitiesCoDimensionTwo ()=0
 update the entities of co-dimension 2 More...
 
virtual void check () const =0
 check mesh connectivity
 

Constructors, destructor

 MeshBase ()
 
 MeshBase (worldcomm_ptr_t const &w)
 
 MeshBase (MeshBase const &)=default
 
 MeshBase (MeshBase &&)=default
 
 ~MeshBase () override
 
 MeshBase (uint16_type topodim, uint16_type realdim, worldcomm_ptr_t const &worldComm=Environment::worldCommPtr())
 build from a topological dimension, a real dimension and a communicator
 
 MeshBase (std::string const &name, uint16_type topodim, uint16_type realdim, worldcomm_ptr_t const &worldComm=Environment::worldCommPtr())
 build from a name, a topological dimension, a real dimension and a communicator
 

Operator overloads

MeshBase & operator= (MeshBase const &m)=default
 
MeshBase & operator= (MeshBase &&m)=default
 

Accessors

virtual std::shared_ptr< MeshBase< IndexT > > shared_from_this_meshbase ()=0
 return current shared_ptr of type MeshBase
 
virtual std::shared_ptr< const MeshBase< IndexT > > shared_from_this_meshbase () const =0
 return current shared_ptr of type MeshBase
 
bool isUpdatedForUse () const
 
uint64_type functionSpaceStructuralRevision () const noexcept
 Return the revision used to invalidate mesh-based function spaces. More...
 
uint64_type geometryRevision () const noexcept
 Return the coordinate-only geometry revision. More...
 
void setTopologicalDimension (int d)
 set the topological dimension
 
void setRealDimension (int d)
 set the real dimension
 
virtual size_type numGlobalElements () const =0
 
virtual size_type numGlobalFaces () const =0
 
virtual size_type numGlobalEdges () const =0
 
virtual size_type numGlobalPoints () const =0
 
virtual size_type numGlobalVertices () const =0
 
virtual size_type numElements () const =0
 
virtual size_type numFaces () const =0
 
virtual size_type numPoints () const =0
 
size_type numVertices () const
 
rank_type numberOfPartitions () const
 Returns the number of partitions.
 
bool isPartitioned () const
 
Context const & components () const
 
Context & components ()
 
bool isParametric () const
 

Mutators

void setNumberOfPartitions (rank_type n)
 set the number of partitions
 
void setNumVertices (size_type n)
 set the number of vertices
 
void setComponents (size_type components=MESH_ALL_COMPONENTS)
 set the components to be updated by updateForUse() More...
 
void setParametric (bool x)
 set if the mesh is parametric ( e.g. More...
 

Additional Inherited Members

- Public Types inherited from Feel::JournalWatcher
using function_update_information_type = std::function< void(nl::json &)>
 
using notify_type = nl::json
 
- Public Member Functions inherited from Feel::CommObject
WorldComm const & comm () const
 
 CommObject (CommObject &&)=default
 
 CommObject (CommObject const &)=default
 
 CommObject (worldcomm_ptr_t &w)
 
 CommObject (worldcomm_ptr_t const &w)
 
bool hasWorldComm () const
 returns true if worldcomm is allocated, false othewise
 
CommObject & operator= (CommObject &&)=default
 
CommObject & operator= (CommObject const &)=default
 
virtual void setWorldComm (worldcomm_ptr_t const &w)
 
virtual void setWorldComm (worldcomm_t &w)
 
worldcomm_ptr_t & subWorldCommSeqPtr ()
 
worldcomm_ptr_t const & subWorldCommSeqPtr () const
 
WorldComm & worldComm ()
 
WorldComm const & worldComm () const
 
worldcomm_ptr_t & worldCommPtr ()
 
worldcomm_ptr_t const & worldCommPtr () const
 
- Public Member Functions inherited from Feel::JournalWatcher
 JournalWatcher (std::string const &category="", std::string const &name="", bool connect=JournalManager::journalAutoMode())
 Constructors. More...
 
 JournalWatcher (std::string const &category, bool useDefaultName, bool connect=JournalManager::journalAutoMode())
 
 JournalWatcher (function_update_information_type const &func, std::string const &category="", std::string const &name="", bool useDefaultNameIfEmpty=true, bool connect=JournalManager::journalAutoMode())
 
 JournalWatcher (JournalWatcher const &jw)
 Copy constructor.
 
virtual ~JournalWatcher ()
 Default destructor. The (inherited) object is always disconnected from the journal during the destruction.
 
bool journalIsConnected () const
 GettersCheck if the object is connected to the journal. More...
 
std::string const & journalWatcherInstanceName () const
 Return the full instance name for this watched object. The name is composed with the base name and a suffix index corresponding to the nth call. More...
 
nl::json::json_pointer journalSection () const
 Return the section into the journal as json_pointer.
 
nl::json const & informationObject () const
 Return the information into property tree.
 
void journalConnect ()
 Setters. More...
 
void journalDisconnect ()
 Disconnect the derived object from the simulation info manager. The disconnection is safe.
 
virtual void updateInformationObject (nl::json &p) const
 update information object into p More...
 
void setInformationObject (nl::json const &informationObject)
 set information object
 
void putInformationObject (nl::json const &informationObject)
 put information object
 
void addInformationObject (nl::json const &informationObject)
 add information object
 
void journalFinalize ()
 finalize journal publication
 
- Protected Member Functions inherited from Feel::JournalWatcher
void applyUpdateInformationObject ()
 Protected Methods.
 

Detailed Description

template<typename IndexT = uint32_type>
class Feel::MeshBase< IndexT >

base mesh class

Author
Christophe Prud'homme
See also
/

Member Typedef Documentation

◆ face_processor_type

template<typename IndexT = uint32_type>
typedef boost::tuple<index_type, index_type> Feel::MeshBase< IndexT >::face_processor_type

Tuple that contains.

  1. the index of the face
  2. the processor id the face belongs to

Member Function Documentation

◆ clear()

template<typename IndexT >
void Feel::MeshBase< IndexT >::clear
virtual

Empty all containers of the mesh.

Must be redefined by derived classes.

Reimplemented in Feel::Mesh0D< Shape, T, IndexT >, Feel::Mesh1D< Shape, T, IndexT >, Feel::Mesh2D< Shape, T, IndexT >, and Feel::Mesh3D< Shape, T, IndexT >.

Referenced by Feel::Mesh0D< Shape, T, IndexT >::renumber().

◆ components() [1/2]

template<typename IndexT = uint32_type>
Context & Feel::MeshBase< IndexT >::components ( )
Returns
an integer(stored in a Context) that encodes the components to be updated by the mesh data structure.
See also
Context, MeshComponents

◆ components() [2/2]

template<typename IndexT = uint32_type>
Context const & Feel::MeshBase< IndexT >::components ( ) const
Returns
an integer(stored in a Context) that encodes the components to be updated by the mesh data structure.
See also
Context, MeshComponents

◆ functionSpaceStructuralRevision()

template<typename IndexT = uint32_type>
uint64_type Feel::MeshBase< IndexT >::functionSpaceStructuralRevision ( ) const
noexcept

Return the revision used to invalidate mesh-based function spaces.

The revision advances when an already finalized mesh is marked as no longer updated for use because its topology or DOF-relevant structure may have changed.

Returns
current structural revision

◆ geometryRevision()

template<typename IndexT = uint32_type>
uint64_type Feel::MeshBase< IndexT >::geometryRevision ( ) const
noexcept

Return the coordinate-only geometry revision.

Returns
number of geometry changes reported through the mesh lifecycle

◆ hasAllMarkers()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasAllMarkers ( std::initializer_list< std::string >  l)
Returns
true if the list strings are all mesh marker

◆ hasAnyMarker()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasAnyMarker ( std::initializer_list< std::string >  l)
Returns
true if any of the list string contain a mesh marker

◆ hasEdgeMarker()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasEdgeMarker ( std::string const &  marker) const
Returns
true if marker exists and topological dimension of the entity associated is Dim-2, false otherwise

◆ hasElementMarker()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasElementMarker ( std::string const &  marker) const
Returns
true if marker exists and topological dimension of the entity associated is Dim, false otherwise

◆ hasFaceMarker()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasFaceMarker ( std::string const &  marker) const
Returns
true if marker exists and topological dimension of the entity associated is Dim-1, false otherwise

◆ hasMarker()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasMarker ( std::string const &  marker) const
Returns
true if marker exists, false otherwise

◆ hasMarkers()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasMarkers ( std::initializer_list< std::string >  l) const
Returns
true if all markers are defined in the mesh, false otherwise

◆ hasPointMarker()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasPointMarker ( std::string const &  marker) const
Returns
true if marker exists and topological dimension of the entity associated is 0, false otherwise

◆ hasSubMeshData()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::hasSubMeshData ( ) const
Returns
true if mesh holds sub mesh data

◆ isParametric()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::isParametric ( ) const
Returns
true if the mesh has parametric nodes

◆ isParentMeshOf()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::isParentMeshOf ( std::shared_ptr< MeshBase< IndexT > >  m) const
Returns
true if the mesh is related to the mesh m

◆ isPartitioned()

template<typename IndexT >
bool Feel::MeshBase< IndexT >::isPartitioned
Returns
true if mesh is partitioned, false otherwise

◆ isSiblingOf()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::isSiblingOf ( std::shared_ptr< MeshBase< IndexT > >  m) const
Returns
true if the mesh is related to the mesh m

◆ isSubMeshFrom() [1/2]

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::isSubMeshFrom ( MeshBase< IndexT > const *  m) const
Returns
true if the mesh is related to the mesh m

◆ isSubMeshFrom() [2/2]

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::isSubMeshFrom ( std::shared_ptr< MeshBase< IndexT > >  m) const
Returns
true if the mesh is related to the mesh m

◆ isUpdatedForUse()

template<typename IndexT = uint32_type>
bool Feel::MeshBase< IndexT >::isUpdatedForUse ( ) const
Returns
true if the mesh is ready for use, false otherwise

◆ markerDim()

template<typename IndexT = uint32_type>
size_type Feel::MeshBase< IndexT >::markerDim ( std::string const &  marker) const
Returns
the topological dimension associated to the marker

◆ markerId()

template<typename IndexT >
flag_type Feel::MeshBase< IndexT >::markerId ( boost::any const &  marker) const
Returns
the marker id given the marker name marker

◆ markerName() [1/3]

template<typename IndexT = uint32_type>
std::string Feel::MeshBase< IndexT >::markerName ( size_type  marker) const
Returns
the marker name associated to the marker id

◆ markerName() [2/3]

template<typename IndexT = uint32_type>
std::string Feel::MeshBase< IndexT >::markerName ( size_type  marker,
size_type  dim 
) const
Returns
the marker name associated to the marker id

◆ markerName() [3/3]

template<typename IndexT = uint32_type>
size_type Feel::MeshBase< IndexT >::markerName ( std::string const &  marker) const
Returns
the id associated to the marker

◆ markerNames()

template<typename IndexT = uint32_type>
std::map< std::string, std::vector< size_type > > Feel::MeshBase< IndexT >::markerNames ( ) const
Returns
the marker names

◆ markersId()

template<typename IndexT >
std::set< flag_type > Feel::MeshBase< IndexT >::markersId ( boost::any const &  marker) const
Returns
the set of marker id given the marker name marker

◆ meshToSubMesh() [1/3]

template<typename IndexT = uint32_type>
size_type Feel::MeshBase< IndexT >::meshToSubMesh ( size_type  id) const
Returns
id in sub mesh given the id in the parent mesh

◆ meshToSubMesh() [2/3]

template<typename IndexT = uint32_type>
size_type Feel::MeshBase< IndexT >::meshToSubMesh ( std::shared_ptr< MeshBase< IndexT > >  m,
size_type  id 
) const
Returns
id in sub mesh given the id in the parent mesh

◆ meshToSubMesh() [3/3]

template<typename IndexT = uint32_type>
std::pair< std::vector< size_type >, bool > Feel::MeshBase< IndexT >::meshToSubMesh ( std::vector< size_type > const &  p,
bool  add_invalid_indices = false 
) const
Returns
ids in sub mesh given the ids in the parent mesh

◆ numElements()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numElements ( ) const
pure virtual

◆ numFaces()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numFaces ( ) const
pure virtual

◆ numGlobalEdges()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numGlobalEdges ( ) const
pure virtual
Returns
the number of edges

◆ numGlobalElements()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numGlobalElements ( ) const
pure virtual
Returns
the number of elements

◆ numGlobalFaces()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numGlobalFaces ( ) const
pure virtual
Returns
the number of faces

◆ numGlobalPoints()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numGlobalPoints ( ) const
pure virtual
Returns
the number of points

◆ numGlobalVertices()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numGlobalVertices ( ) const
pure virtual
Returns
the number of vertices

◆ numPoints()

template<typename IndexT = uint32_type>
virtual size_type Feel::MeshBase< IndexT >::numPoints ( ) const
pure virtual

◆ numVertices()

template<typename IndexT = uint32_type>
size_type Feel::MeshBase< IndexT >::numVertices ( ) const
Returns
the number of vertices (in current process)

◆ parentMesh()

template<typename IndexT = uint32_type>
smd_type::mesh_ptrtype Feel::MeshBase< IndexT >::parentMesh ( ) const
Returns
sub mesh

◆ renumber()

template<typename IndexT = uint32_type>
virtual void Feel::MeshBase< IndexT >::renumber ( )
protectedpure virtual

After loading/defining a mesh, we want to have as much locality as possible (elements/faces/nodes to be contiguous).

In order to do that the mesh elements/faces/nodes are renumbered. That will be then most helpful when generating the Dof table. This procedure should work also with comm().size() == 1

Implemented in Feel::Mesh0D< Shape, T, IndexT >, Feel::Mesh1D< Shape, T, IndexT >, Feel::Mesh2D< Shape, T, IndexT >, and Feel::Mesh3D< Shape, T, IndexT >.

◆ setComponents()

template<typename IndexT = uint32_type>
void Feel::MeshBase< IndexT >::setComponents ( size_type  components = MESH_ALL_COMPONENTS)

set the components to be updated by updateForUse()

See also
updateForUse

◆ setParametric()

template<typename IndexT = uint32_type>
void Feel::MeshBase< IndexT >::setParametric ( bool  x)

set if the mesh is parametric ( e.g.

has parametric nodes )

◆ setUpdatedForUse()

template<typename IndexT = uint32_type>
void Feel::MeshBase< IndexT >::setUpdatedForUse ( bool  u)
protected

Set whether the mesh is finalized and ready for use.

Changing a finalized mesh to the not-updated state advances the function-space structural revision exactly once.

Parameters
uwhether the mesh is updated for use

◆ subMesh()

template<typename IndexT = uint32_type>
smd_type::mesh_ptrtype Feel::MeshBase< IndexT >::subMesh ( ) const
Returns
sub mesh

◆ subMeshToMesh() [1/2]

template<typename IndexT = uint32_type>
size_type Feel::MeshBase< IndexT >::subMeshToMesh ( size_type  id) const
Returns
id in parent mesh given the id in the sub mesh

◆ subMeshToMesh() [2/2]

template<typename IndexT = uint32_type>
size_type Feel::MeshBase< IndexT >::subMeshToMesh ( std::shared_ptr< MeshBase< IndexT > >  m,
size_type  id 
) const
Returns
id in parent mesh given the id in the sub mesh

◆ updateEntitiesCoDimensionTwo()

template<typename IndexT = uint32_type>
virtual void Feel::MeshBase< IndexT >::updateEntitiesCoDimensionTwo ( )
protectedpure virtual

◆ updateForUse()

template<typename IndexT >
void Feel::MeshBase< IndexT >::updateForUse ( size_type  components)
virtual

update all info for this mesh according the components

See also
components(), setComponents()