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

1D mesh class More...

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

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, IndexT > 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 Points< nRealDim, T, IndexT, SubFaceOf< typename Elements< Shape, T, IndexT >::element_type > > super_points
 
typedef super_points::points_type points_type
 
typedef super_points::point_type point_type
 
typedef super_points super_faces
 
typedef super_faces::point_iterator face_iterator
 
typedef super_faces::point_const_iterator face_const_iterator
 
typedef super_faces::points_type faces_type
 
typedef super_faces::point_type face_type
 
typedef super_faces::points_reference_wrapper_type faces_reference_wrapper_type
 
typedef super_faces::points_reference_wrapper_ptrtype faces_reference_wrapper_ptrtype
 
typedef faces_reference_wrapper_type::iterator face_reference_wrapper_iterator
 
typedef faces_reference_wrapper_type::const_iterator face_reference_wrapper_const_iterator
 
typedef face_type edge_type
 
typedef super_faces super_edges
 
typedef super_edges::point_iterator edge_iterator
 
typedef super_edges::point_const_iterator edge_const_iterator
 
typedef super_edges::points_reference_wrapper_type edges_reference_wrapper_type
 
typedef super_edges::points_reference_wrapper_ptrtype edges_reference_wrapper_ptrtype
 
typedef edges_reference_wrapper_type::iterator edge_reference_wrapper_iterator
 
typedef edges_reference_wrapper_type::const_iterator edge_reference_wrapper_const_iterator
 
typedef Mesh1D< Shape, T, IndexT > self_type
 
typedef std::shared_ptr< self_type > self_ptrtype
 
typedef element_type::vertex_permutation_type vertex_permutation_type
 
typedef element_type::edge_permutation_type edge_permutation_type
 
typedef super::face_processor_type face_processor_type
 
static const uint16_type nDim = Shape::nRealDim
 
static const uint16_type nRealDim = Shape::nRealDim
 

Methods

class boost::serialization::access
 
faces_type & faces ()
 
faces_type const & faces () const
 
bool hasFace (size_type i) const
 
face_type const & face (size_type i) const
 
face_const_iterator faceIterator (size_type i) const
 
face_iterator faceIterator (size_type i)
 
face_const_iterator faceIterator (face_type const &face) const
 
face_iterator faceIterator (face_type const &face)
 
face_iterator beginFace ()
 
face_const_iterator beginFace () const
 
face_iterator endFace ()
 
face_const_iterator endFace () const
 
super_points::ordered_points_reference_wrapper_type const & orderedFaces () const noexcept
 
std::pair< face_iterator, bool > addFace (face_type &f)
 
std::pair< face_iterator, bool > addFace (face_type &&f)
 
face_iterator eraseFace (face_iterator it)
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > internalFaces (rank_type p=invalid_rank_type_value) const
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesOnBoundary (rank_type p=invalid_rank_type_value) const
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesWithMarkerByType (uint16_type markerType, std::set< flag_type > const &markerFlags, rank_type p=invalid_rank_type_value) const
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesWithMarkerByType (uint16_type markerType, flag_type m, rank_type p=invalid_rank_type_value) const
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesWithMarker (flag_type m=invalid_flag_type_value, rank_type p=invalid_rank_type_value) const
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesWithMarker2 (flag_type m=invalid_flag_type_value, rank_type p=invalid_rank_type_value) const
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesWithMarker3 (flag_type m=invalid_flag_type_value, rank_type p=invalid_rank_type_value) const
 
template<entity_process_t EPT = entity_process_t::LOCAL_ONLY>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesWithProcessId (rank_type p=invalid_rank_type_value) const
 
template<entity_filter_t FF, entity_process_t EPT, typename ... Ts>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesFilterImpl (Ts &&... ts) const
 
template<entity_filter_t FF, typename ... Ts>
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > facesFilter (entity_process_t ept, Ts &&... ts) const
 
std::tuple< face_reference_wrapper_const_iterator, face_reference_wrapper_const_iterator, faces_reference_wrapper_ptrtype > interProcessFaces (rank_type neighbor_pid=invalid_rank_type_value) const
 
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 updateEntitiesCoDimensionOnePermutation ()
 update permutation of entities of co-dimension 1
 
void updateEntitiesCoDimensionTwo () override
 update the entities of co-dimension 2 More...
 

Constructors, destructor

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

Operator overloads

Mesh1D & operator= (Mesh1D const &m)
 

Accessors

bool isEmpty () const override
 
size_type numElements () const override
 get the number of elements in the mesh More...
 
size_type numLocalFaces () const
 
uint16_type numLocalTopologicalFaces () const
 the number of topological faces per element More...
 
size_type numLocalVertices () const
 
size_type numFaces () const override
 
size_type numEdges () const
 
size_type numPoints () const override
 

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::Mesh1D< Shape, T, IndexT >

1D mesh class

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

Member Function Documentation

◆ clear()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
void Feel::Mesh1D< Shape, 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::Mesh1D< Shape, T, IndexT >::isEmpty ( ) const
override
Returns
true if all containers are empty, false otherwise

◆ numElements()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh1D< Shape, T, IndexT >::numElements ( ) const
overridevirtual

get the number of elements in the mesh

Returns
the number of elements in the mesh

Implements Feel::MeshBase< uint32_type >.

◆ numFaces()

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

Implements Feel::MeshBase< uint32_type >.

◆ numLocalFaces()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh1D< 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::Mesh1D< Shape, T, IndexT >::numLocalTopologicalFaces ( ) const

the number of topological faces per element

Returns
the number of topological faces per element

◆ numLocalVertices()

template<typename Shape , typename T = double, typename IndexT = uint32_type>
size_type Feel::Mesh1D< 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::Mesh1D< 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::Mesh1D< 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::Mesh1D< Shape, T, IndexT >::setWorldComm ( worldcomm_ptr_t const &  _worldComm)
overridevirtual

Reimplemented from Feel::CommObject.

◆ updateEntitiesCoDimensionTwo()

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

update the entities of co-dimension 2

Implements Feel::MeshBase< uint32_type >.