Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::Mesh3D< Shape, T, IndexT > Class Template Reference

3D mesh class More...

+ Inheritance diagram for Feel::Mesh3D< Shape, T, IndexT >:
+ Collaboration diagram for Feel::Mesh3D< Shape, T, IndexT >:

Static Public Attributes

static const uint16_type nDim = 3
 
static const uint16_type nRealDim = 3
 

Typedefs

typedef VisitableBase ::return_type return_type
 
typedef VisitableBase super_visitable
 
typedef MeshBase< IndexT > super
 
using index_type = typename super::index_type
 
using size_type = typename super::size_type
 
typedef Elements< Shape, T > super_elements
 
typedef super_elements::elements_type elements_type
 
typedef super_elements::element_type element_type
 
typedef super_elements::element_iterator element_iterator
 
typedef super_elements::element_const_iterator element_const_iterator
 
typedef super_elements::update_element_neighbor_type update_element_neighbor_type
 
typedef element_type::node_type node_type
 
typedef element_type::edge_permutation_type edge_permutation_type
 
typedef element_type::face_permutation_type face_permutation_type
 
typedef Points< 3, T > super_points
 
typedef super_points::points_type points_type
 
typedef super_points::point_type point_type
 
typedef Faces< typename Shape::template shape< 2 >, typename super_elements::element_type > super_faces
 
typedef super_faces::faces_type faces_type
 
typedef super_faces::face_type face_type
 
typedef super_faces::face_iterator face_iterator
 
typedef super_faces::face_const_iterator face_const_iterator
 
typedef super_faces::face_reference_wrapper_iterator location_face_iterator
 
typedef super_faces::face_reference_wrapper_const_iterator location_face_const_iterator
 
typedef Edges< typename Shape::template shape< 1 >, face_type > super_edges
 
typedef super_edges::edges_type edges_type
 
typedef super_edges::edge_type edge_type
 
typedef super_edges::edge_iterator edge_iterator
 
typedef super_edges::edge_const_iterator edge_const_iterator
 
typedef std::pair< size_type, size_type > edge_pair_type
 
typedef Mesh3D< Shape, T > self_type
 
typedef std::shared_ptr< self_type > self_ptrtype
 
typedef super::face_processor_type face_processor_type
 
typedef boost::tuple< size_type, int > element_edge_type
 Tuple that contains. More...
 
static const size_type SHAPE = Shape::Shape
 

Methods

class boost::serialization::access
 
void setWorldComm (worldcomm_ptr_t const &_worldComm) override
 
void clear () override
 clear out all data from the mesh, isEmpty() should return true after a clear() More...
 
 FEELPP_DEFINE_VISITABLE ()
 
void renumber () override
 dummy implementation More...
 
void updateEntitiesCoDimensionTwo () override
 update the entities of co-dimension 2 More...
 
void updateEntitiesCoDimensionOnePermutation ()
 update permutation of entities of co-dimension 1
 

Constructors, destructor

 Mesh3D (std::string const &name="", worldcomm_ptr_t const &worldComm=Environment::worldCommPtr())
 default constructor
 
 Mesh3D (Mesh3D const &m)=default
 
 Mesh3D (Mesh3D &&m)=default
 
 ~Mesh3D () override
 destructor
 

Operator overloads

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

Accessors

bool isEmpty () const override
 
size_type numElements () const override
 
size_type numLocalFaces () const
 
uint16_type numLocalTopologicalFaces () const
 the number of topological faces per element More...
 
size_type numLocalEdges () const
 
size_type numLocalVertices () const
 
size_type numFaces () const override
 
size_type numEdges () const
 
size_type numPoints () const override
 
FEELPP_DEPRECATED element_edge_type const & localEdgeId (element_type const &e, size_type const n) const
 
FEELPP_DEPRECATED element_edge_type const & localEdgeId (size_type const e, size_type const n) const
 

Additional Inherited Members

- Public Types inherited from Feel::VisitableBase< R, CatchAll >
typedef R return_type
 
- Public Types inherited from Feel::MeshBase< uint32_type >
using super = CommObject
 
using index_type = uint32_type
 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
 
- 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::VisitableBase< R, CatchAll >
virtual return_type accept (VisitorBase &)=0
 accept visitor: use S_DEFINE_VISITABLE() to redefine it
 
virtual return_type accept (VisitorBase *)=0
 accept visitor: use S_DEFINE_VISITABLE() to redefine it
 
- Public Member Functions inherited from Feel::MeshBase< uint32_type >
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
 
bool isSameMesh (M const *m) const
 
bool isSameMesh (std::shared_ptr< M > m) const
 
bool isRelatedTo (M const *m) const
 
bool isRelatedTo (std::shared_ptr< M > m) const
 
size_type subMeshToMesh (size_type id) const
 
size_type subMeshToMesh (std::shared_ptr< MeshBase > m, 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 meshToSubMesh (std::shared_ptr< MeshBase > m, size_type id) const
 
void addMeshWithNodesShared (std::shared_ptr< MeshType > m)
 store a mesh which has nodes shared with the current mesh
 
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< uint32_type > > > 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
 
 MeshBase ()
 
 MeshBase (worldcomm_ptr_t const &w)
 
 MeshBase (MeshBase const &)=default
 
 MeshBase (MeshBase &&)=default
 
 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
 
 ~MeshBase () override
 
MeshBase & operator= (MeshBase const &m)=default
 
MeshBase & operator= (MeshBase &&m)=default
 
virtual std::shared_ptr< MeshBase< uint32_type > > shared_from_this_meshbase ()=0
 return current shared_ptr of type MeshBase
 
virtual std::shared_ptr< const MeshBase< uint32_type > > 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
 
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
 
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...
 
- 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::MeshBase< uint32_type >
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 updateEntitiesCoDimensionOne ()=0
 update the entities of co-dimension 1
 
virtual void check () const=0
 check mesh connectivity
 
- Protected Member Functions inherited from Feel::JournalWatcher
void applyUpdateInformationObject ()
 Protected Methods.
 
- Static Protected Member Functions inherited from Feel::VisitableBase< R, CatchAll >
template<class T >
static return_type acceptImpl (T *visited, VisitorBase *guest)
 give access only to the hierarchy More...
 
- Protected Attributes inherited from Feel::MeshBase< uint32_type >
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
 

Detailed Description

template<typename Shape, typename T = double, typename IndexT = uint32_type>
class Feel::Mesh3D< Shape, T, IndexT >

3D mesh class

// create a 3D mesh made of simplex of order 1
Mesh3D<Simplex<3,1> > mesh;
// create a 3D mesh made of simplex of order 2
Mesh3D<Simplex<3,2> > mesh;
Author
Christophe Prud'homme
See also

Member Typedef Documentation

◆ element_edge_type

template<typename Shape , typename T = double, typename IndexT = uint32_type>
typedef boost::tuple<size_type, int> Feel::Mesh3D< Shape, T, IndexT >::element_edge_type

Tuple that contains.

  1. the index of the edge
  2. +1 or -1 depending on the orientation

Member Function Documentation

◆ clear()

template<typename GEOSHAPE , typename T , typename IndexT >
void Feel::Mesh3D< GEOSHAPE, T, IndexT >::clear
overridevirtual

clear out all data from the mesh, isEmpty() should return true after a clear()

Reimplemented from Feel::MeshBase< uint32_type >.

◆ isEmpty()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
bool Feel::Mesh3D< Shape, T, IndexT >::isEmpty ( ) const
override
Returns
true if all containers are empty, false otherwise

◆ localEdgeId() [1/2]

template<typename Shape , typename T = double, typename IndexT = uint32_type>
FEELPP_DEPRECATED element_edge_type const & Feel::Mesh3D< Shape, T, IndexT >::localEdgeId ( element_type const &  e,
size_type const  n 
) const
Returns
the edge index of the edge n in the element e

References Feel::edges().

◆ localEdgeId() [2/2]

template<typename Shape , typename T = double, typename IndexT = uint32_type>
FEELPP_DEPRECATED element_edge_type const & Feel::Mesh3D< Shape, T, IndexT >::localEdgeId ( size_type const  e,
size_type const  n 
) const
Returns
the edge index of the edge n in the element e

◆ numEdges()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh3D< Shape, T, IndexT >::numEdges ( ) const
Returns
the number of edges

◆ numElements()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh3D< Shape, T, IndexT >::numElements ( ) const
overridevirtual
Returns
the number of elements

Implements Feel::MeshBase< uint32_type >.

◆ numFaces()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh3D< Shape, T, IndexT >::numFaces ( ) const
overridevirtual
Returns
the number of faces

Implements Feel::MeshBase< uint32_type >.

◆ numLocalEdges()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh3D< Shape, T, IndexT >::numLocalEdges ( ) const
Returns
the number of edges in an element

◆ numLocalFaces()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh3D< Shape, T, IndexT >::numLocalFaces ( ) const
Returns
the number of faces in an element

◆ numLocalTopologicalFaces()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
uint16_type Feel::Mesh3D< Shape, T, IndexT >::numLocalTopologicalFaces ( ) const

the number of topological faces per element

Returns
the number of topological faces per element

References Feel::elements().

◆ numLocalVertices()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh3D< Shape, T, IndexT >::numLocalVertices ( ) const
Returns
the number of vertices in an element

◆ numPoints()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh3D< Shape, T, IndexT >::numPoints ( ) const
overridevirtual
Returns
the number of points

Implements Feel::MeshBase< uint32_type >.

◆ renumber()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
void Feel::Mesh3D< Shape, T, IndexT >::renumber ( )
overrideprotectedvirtual

dummy implementation

See also
Mesh

Implements Feel::MeshBase< uint32_type >.

◆ setWorldComm()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
void Feel::Mesh3D< Shape, T, IndexT >::setWorldComm ( worldcomm_ptr_t const &  _worldComm)
overridevirtual

Reimplemented from Feel::CommObject.

◆ updateEntitiesCoDimensionTwo()

template<typename GEOSHAPE , typename T , typename IndexT >
void Feel::Mesh3D< GEOSHAPE, T, IndexT >::updateEntitiesCoDimensionTwo
overrideprotectedvirtual

update the entities of co-dimension 2

Implements Feel::MeshBase< uint32_type >.