Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feel::Mesh< C, V, T > Class Template Reference

#include <mesh.hpp>

Detailed Description

template<typename C, typename V, int T>
class Feel::Mesh< C, V, T >

unifying mesh class

Author
Christophe Prud'homme
See Also

Inherits type< mpl::equal_to< mpl::int_< GeoShape::nDim >, mpl::int_< 0 > >, mpl::identity< Mesh0D< GeoShape > >, mpl::if_< mpl::equal_to< mpl::int_< GeoShape::nDim >, mpl::int_< 1 > >, mpl::identity< Mesh1D< GeoShape > >, mpl::if_< mpl::equal_to< mpl::int_< GeoShape::nDim >, mpl::int_< 2 > >, mpl::identity< Mesh2D< GeoShape > >, mpl::identity< Mesh3D< GeoShape > > >::type >::type >, addable< Mesh< GeoShape, T, Tag > >, and enable_shared_from_this< Mesh< GeoShape, T, Tag > >.

Public Types

Typedefs
typedef T value_type
 
typedef GeoShape shape_type
 
typedef super::return_type return_type
 
typedef node< double >::type node_type
 
typedef super::super_elements super_elements
 
typedef super::elements_type elements_type
 
typedef super::element_type element_type
 
typedef super::element_iterator element_iterator
 
typedef
super::element_const_iterator 
element_const_iterator
 
typedef super::super_faces super_faces
 
typedef super::faces_type faces_type
 
typedef super::face_type face_type
 
typedef super::face_iterator face_iterator
 
typedef super::face_const_iterator face_const_iterator
 
typedef super::edge_type edge_type
 
typedef super::points_type points_type
 
typedef super::point_type point_type
 
typedef super::point_iterator point_iterator
 
typedef super::point_const_iterator point_const_iterator
 
typedef element_type::gm_type gm_type
 
typedef boost::shared_ptr
< gm_type > 
gm_ptrtype
 
typedef element_type::gm1_type gm1_type
 
typedef boost::shared_ptr
< gm1_type > 
gm1_ptrtype
 
typedef Mesh< shape_type, T, Tag > self_type
 
typedef self_type mesh_type
 
typedef boost::shared_ptr
< self_type
self_ptrtype
 
typedef self_ptrtype mesh_ptrtype
 
typedef element_type::template
reference_convex< T >::type 
reference_convex_type
 
typedef super::face_processor_type face_processor_type
 
typedef super::face_processor_type element_edge_type
 
typedef mpl::if_< mpl::bool_
< GeoShape::is_simplex >
, mpl::identity< Mesh< Simplex
< GeoShape::nDim,
1, GeoShape::nRealDim >
, value_type, Tag >
>, mpl::identity< Mesh
< Hypercube< GeoShape::nDim,
1, GeoShape::nRealDim >
, value_type, Tag >
> >::type::type 
P1_mesh_type
 
typedef boost::shared_ptr
< P1_mesh_type > 
P1_mesh_ptrtype
 
typedef trace_mesh< Tag >::type trace_mesh_type
 
typedef trace_mesh< Tag >::ptrtype trace_mesh_ptrtype
 
typedef trace_trace_mesh< Tag >
::type 
trace_trace_mesh_type
 
typedef trace_trace_mesh< Tag >
::ptrtype 
trace_trace_mesh_ptrtype
 

Public Member Functions

void checkLocalPermutation (mpl::bool_< false >) const
 
void checkLocalPermutation (mpl::bool_< true >) const
 
void findNeighboringProcessors ()
 
 Mesh (WorldComm const &worldComm=Environment::worldComm())
 
void meshModified ()
 
self_typeoperator+= (self_type const &m)
 
template<typename RangeT >
Mesh< Shape, T, Tag >
::template trace_mesh< Tag >
::ptrtype 
trace (RangeT const &range) const
 
template<typename RangeT , int TheTag>
Mesh< Shape, T, Tag >
::template trace_mesh< TheTag >
::ptrtype 
trace (RangeT const &range, mpl::int_< TheTag >) const
 
void updateForUse ()
 
template<typename RangeT >
Mesh< Shape, T, Tag >
::template trace_trace_mesh
< Tag >::ptrtype 
wireBasket (RangeT const &range) const
 
template<typename RangeT , int TheTag>
Mesh< Shape, T, Tag >
::template trace_trace_mesh
< TheTag >::ptrtype 
wireBasket (RangeT const &range, mpl::int_< TheTag >) const
 
Accessors
size_type numGlobalElements () const
 
uint16_type dimension () const
 
gm_ptrtype const & gm () const
 
gm1_ptrtype const & gm1 () const
 
gm_ptrtype & gm ()
 
gm1_ptrtype & gm1 ()
 
reference_convex_type referenceConvex () const
 
face_processor_type const & localFaceId (element_type const &e, size_type const n) const
 
face_processor_type const & localFaceId (size_type const e, size_type const n) const
 
Mutators
void setPartitioner (std::string partitioner)
 
face_processor_type & localFaceId (element_type const &e, size_type const n)
 
face_processor_type & localFaceId (size_type const e, size_type const n)
 
size_type markerName (std::string const &marker) const
 
size_type markerDim (std::string const &marker) const
 
std::map< std::string,
std::vector< size_type > > 
markerNames () const
 
boost::shared_ptr< typename
self_type::Localization > 
tool_localization ()
 
value_type measure () const
 
value_type measureBoundary () const
 
Methods
void addMarkerName (std::pair< std::string, std::vector< size_type > > const &marker)
 
void addMarkerName (std::string __name, int __id, int __topoDim)
 
flag_type markerId (boost::any const &marker)
 
element_iterator eraseElement (element_iterator position, bool modify=true)
 
template<typename RangeT , int TheTag>
trace_mesh< TheTag >::ptrtype trace (RangeT const &range, mpl::int_< TheTag >) const
 
template<int TheTag = Tag>
trace_mesh< TheTag >::ptrtype trace () const
 
template<typename RangeT >
trace_mesh< Tag >::ptrtype trace (RangeT const &range) const
 
template<int TheTag = Tag>
trace_mesh< TheTag >::ptrtype wireBasket () const
 
template<typename RangeT , int TheTag>
trace_trace_mesh< TheTag >::ptrtype wireBasket (RangeT const &range, mpl::int_< TheTag >) const
 
template<typename RangeT >
trace_trace_mesh< Tag >::ptrtype wireBasket (RangeT const &range) const
 
template<typename Iterator >
void createSubmesh (self_type &mesh, Iterator const &begin_elt, Iterator const &end_elt, size_type extraction_policies=EXTRACTION_KEEP_ALL_IDS) const
 
void createSubmeshByProcessId (self_type &mesh, uint16_type pid) const
 
P1_mesh_ptrtype createP1mesh () const
 
template<typename IteratorRange >
void updateMarker2WithRange (IteratorRange const &range, flag_type flag)
 
template<typename IteratorRange >
void updateMarker2WithRange (IteratorRange const &range, flag_type flag, mpl::int_< MESH_ELEMENTS >)
 
template<typename IteratorRange >
void updateMarker2WithRange (IteratorRange const &range, flag_type flag, mpl::int_< MESH_FACES >)
 
template<typename IteratorRange >
void updateMarker3WithRange (IteratorRange const &range, flag_type flag)
 
template<typename IteratorRange >
void updateMarker3WithRange (IteratorRange const &range, flag_type flag, mpl::int_< MESH_ELEMENTS >)
 
template<typename IteratorRange >
void updateMarker3WithRange (IteratorRange const &range, flag_type flag, mpl::int_< MESH_FACES >)
 
void partition (const uint16_type n_parts=1)
 
void renumber ()
 
void renumber (std::vector< size_type > const &node_map, mpl::int_< 1 >)
 
void renumber (std::vector< size_type > const &node_map, mpl::int_< 2 >)
 
void renumber (std::vector< size_type > const &node_map, mpl::int_< 3 >)
 
void localrenumber ()
 
void checkAndFixPermutation ()
 
void send (int p, int tag)
 
void recv (int p, int tag)
 
void encode ()
 
void decode ()
 
 FEELPP_DEFINE_VISITABLE ()
 

Static Public Member Functions

static mesh_ptrtype New ()
 

Static Public Attributes

Constants
static const uint16_type nDim = GeoShape::nDim
 
static const uint16_type nRealDim = GeoShape::nRealDim
 
static const uint16_type Shape = GeoShape::Shape
 
static const uint16_type nOrder = GeoShape::nOrder
 
static const uint16_type tag = Tag
 

Protected Member Functions

void check () const
 
void updateEntitiesCoDimensionOne ()
 
void updateEntitiesCoDimensionOne (mpl::bool_< true >)
 
void updateEntitiesCoDimensionOne (mpl::bool_< false >)
 
void updateEntitiesCoDimensionOneGhostCell ()
 

Friends

class boost::serialization::access
 

Signals

boost::signals2::signal< void(MESH_CHANGES)> meshChanged
 
template<typename Observer >
void addObserver (Observer &obs)
 
void removeFacesFromBoundary (std::initializer_list< uint16_type > markers)
 

Constructor & Destructor Documentation

template<typename Shape , typename T , int Tag>
Feel::Mesh< Shape, T, Tag >::Mesh ( WorldComm const &  worldComm = Environment::worldComm())

Default mesh constructor

Member Function Documentation

template<typename C, typename V, int T>
void Feel::Mesh< C, V, T >::addMarkerName ( std::pair< std::string, std::vector< size_type > > const &  marker)
inline

add a new marker name

template<typename C, typename V, int T>
void Feel::Mesh< C, V, T >::addMarkerName ( std::string  __name,
int  __id,
int  __topoDim 
)
inline

add a new marker name

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::check ( ) const
protected

check mesh connectivity

References Feel::invalid_size_type_value.

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::checkAndFixPermutation ( )

check elements permutation and fix it if needed

References Feel::elements().

template<typename C, typename V, int T>
void Feel::Mesh< C, V, T >::checkLocalPermutation ( mpl::bool_< false >  ) const
inline

This function checks if the local numbering of the mesh elements is anticlockwise oriented. For the time being, this function only applies to tetrahedra meshes

template<typename Shape , typename T , int Tag>
Mesh< Shape, T, Tag >::P1_mesh_ptrtype Feel::Mesh< Shape, T, Tag >::createP1mesh ( ) const

Create a P1 mesh from the HO mesh

template<typename C, typename V, int T>
void Feel::Mesh< C, V, T >::createSubmeshByProcessId ( self_type mesh,
uint16_type  pid 
) const
inline

A special case of createSubmesh() : it creates a mesh by iterating over all elements having the process id pid

Parameters
meshnew mesh to construct
pidprocess id that will select the elements to add
template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::decode ( )

decode the mesh data structure from a tighter data structure and to avoid pointers in order to serialize it for saving/loading and sending/receiving the mesh

References Feel::addElement().

template<typename C, typename V, int T>
uint16_type Feel::Mesh< C, V, T >::dimension ( ) const
inline
Returns
the topological dimension
template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::encode ( )

encode the mesh data structure into a tighter data structure and to avoid pointers in order to serialize it for saving/loading and sending/receiving the mesh

References Feel::boundaryfaces(), Feel::elements(), and Feel::faces().

template<typename Shape , typename T , int Tag>
Mesh< Shape, T, Tag >::element_iterator Feel::Mesh< Shape, T, Tag >::eraseElement ( element_iterator  position,
bool  modify = true 
)

erase element at position position

Parameters
positionposition is a valid dereferenceable iterator of the index.
modifyif true, update mesh data structure and in particular faces
Returns
An iterator pointing to the element immediately following the one that was deleted, or end() if no such element exists.

References Feel::elements(), and Feel::faces().

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::findNeighboringProcessors ( )

Finds all the processors that may contain elements that neighbor my elements. This list is guaranteed to include all processors that border any of my elements, but may include additional ones as well. This method computes bounding boxes for the elements on each processor and checks for overlaps.

References Feel::Sphere::center(), Feel::Sphere::intersects(), Feel::Sphere::radius(), and Feel::Sphere::setRadius().

template<typename C, typename V, int T>
gm_ptrtype const& Feel::Mesh< C, V, T >::gm ( ) const
inline
Returns
geometric mapping
template<typename C, typename V, int T>
gm_ptrtype& Feel::Mesh< C, V, T >::gm ( )
inline
Returns
the geometric mapping
template<typename C, typename V, int T>
gm1_ptrtype const& Feel::Mesh< C, V, T >::gm1 ( ) const
inline
Returns
geometric mapping of order 1
template<typename C, typename V, int T>
gm1_ptrtype& Feel::Mesh< C, V, T >::gm1 ( )
inline
Returns
the geometric mapping of order 1
template<typename C, typename V, int T>
face_processor_type const& Feel::Mesh< C, V, T >::localFaceId ( element_type const &  e,
size_type const  n 
) const
inline
Returns
the face index of the face n in the element e
template<typename C, typename V, int T>
face_processor_type const& Feel::Mesh< C, V, T >::localFaceId ( size_type const  e,
size_type const  n 
) const
inline
Returns
the face index of the face n in the element e
template<typename C, typename V, int T>
face_processor_type& Feel::Mesh< C, V, T >::localFaceId ( element_type const &  e,
size_type const  n 
)
inline
Returns
the face index of the face n in the element e
template<typename C, typename V, int T>
face_processor_type& Feel::Mesh< C, V, T >::localFaceId ( size_type const  e,
size_type const  n 
)
inline
Returns
the face index of the face n in the element e
template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::localrenumber ( )

This function only take sense in the 3D modal case with a simplex mesh. In order to construct a global C^0 expansion, we need to assure that two contiguous elements share the same top vertex ! This can be achieve by a local renumbering of the vertex.

References Feel::elements().

template<typename C, typename V, int T>
size_type Feel::Mesh< C, V, T >::markerDim ( std::string const &  marker) const
inline
Returns
the topological dimension associated to the marker

References Feel::invalid_size_type_value.

template<typename C, typename V, int T>
size_type Feel::Mesh< C, V, T >::markerName ( std::string const &  marker) const
inline
Returns
the id associated to the marker

References Feel::invalid_size_type_value.

template<typename C, typename V, int T>
std::map<std::string, std::vector<size_type> > Feel::Mesh< C, V, T >::markerNames ( ) const
inline
Returns
the marker names
template<typename C, typename V, int T>
value_type Feel::Mesh< C, V, T >::measure ( ) const
inline
Returns
the measure of the mesh (sum of the measure of the elements)
template<typename C, typename V, int T>
value_type Feel::Mesh< C, V, T >::measureBoundary ( ) const
inline
Returns
the measure of the mesh (sum of the measure of the elements)
template<typename C, typename V, int T>
static mesh_ptrtype Feel::Mesh< C, V, T >::New ( )
inlinestatic

generate a new Mesh shared pointer

Returns
the Mesh shared pointer
template<typename C, typename V, int T>
size_type Feel::Mesh< C, V, T >::numGlobalElements ( ) const
inline

the number of elements associated to the current processor

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::partition ( const uint16_type  n_parts = 1)

Call the default partitioner (currently metis_partition()).

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::recv ( int  p,
int  tag 
)

receive the mesh data structure to processor p with tag

template<typename C, typename V, int T>
reference_convex_type Feel::Mesh< C, V, T >::referenceConvex ( ) const
inline
Returns
the reference convex associated with the element of the mesh
template<typename C, typename V, int T>
void Feel::Mesh< C, V, T >::renumber ( )
inline

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

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::send ( int  p,
int  tag 
)

send the mesh data structure to processor p with tag

template<typename C, typename V, int T>
void Feel::Mesh< C, V, T >::setPartitioner ( std::string  partitioner)
inline

set the partitioner to partitioner

template<typename C, typename V, int T>
template<int TheTag = Tag>
trace_mesh<TheTag>::ptrtype Feel::Mesh< C, V, T >::trace ( ) const
inline

creates a mesh by iterating over the elements between begin_elt and and end_elt and adding them the the mesh mesh

Parameters
meshnew mesh to construct
begin_eltbegin iterator
begin_eltend iterator
extraction_policiesnot in use yet

References Feel::boundaryfaces().

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::updateEntitiesCoDimensionOne ( )
protected

Update connectivity of entities of codimension 1

void LocalRenumber

template<typename C, typename V, int T>
void Feel::Mesh< C, V, T >::updateEntitiesCoDimensionOneGhostCell ( )
protected

Update in ghost cells of entities of codimension 1

template<typename Shape , typename T , int Tag>
void Feel::Mesh< Shape, T, Tag >::updateForUse ( )

update the mesh data structure before using it

by default if the number of processors if > 1, we partition the mesh. A different behaviour is controlled by setting properly setComponents(), components()

References Feel::elements(), Feel::elementsRange(), Feel::faces(), Feel::hasElement(), and Feel::invalid_size_type_value.

template<typename C, typename V, int T>
template<typename IteratorRange >
void Feel::Mesh< C, V, T >::updateMarker2WithRange ( IteratorRange const &  range,
flag_type  flag 
)
inline

update the Marker2 with a range of elements or faces if elements -> update marker2 for this elements if faces -> update marker2 for this faces

template<typename C, typename V, int T>
template<typename IteratorRange >
void Feel::Mesh< C, V, T >::updateMarker2WithRange ( IteratorRange const &  range,
flag_type  flag,
mpl::int_< MESH_ELEMENTS  
)
inline

sub method of updateMarker2WithRange : MESH_ELEMENTS

template<typename C, typename V, int T>
template<typename IteratorRange >
void Feel::Mesh< C, V, T >::updateMarker2WithRange ( IteratorRange const &  range,
flag_type  flag,
mpl::int_< MESH_FACES  
)
inline

sub method of updateMarker2WithRange : MESH_FACES

template<typename C, typename V, int T>
template<typename IteratorRange >
void Feel::Mesh< C, V, T >::updateMarker3WithRange ( IteratorRange const &  range,
flag_type  flag 
)
inline

update the Marker3 with a range of elements or faces if elements -> update marker3 for this elements if faces -> update marker3 for this faces

template<typename C, typename V, int T>
template<typename IteratorRange >
void Feel::Mesh< C, V, T >::updateMarker3WithRange ( IteratorRange const &  range,
flag_type  flag,
mpl::int_< MESH_ELEMENTS  
)
inline

sub method of updateMarker3WithRange : MESH_ELEMENTS

template<typename C, typename V, int T>
template<typename IteratorRange >
void Feel::Mesh< C, V, T >::updateMarker3WithRange ( IteratorRange const &  range,
flag_type  flag,
mpl::int_< MESH_FACES  
)
inline

sub method of updateMarker3WithRange : MESH_FACES

Member Data Documentation

template<typename C, typename V, int T>
boost::signals2::signal<void ( MESH_CHANGES )> Feel::Mesh< C, V, T >::meshChanged

mesh changed its connectivity


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

Generated on Fri Oct 25 2013 14:24:31 for Feel++ by doxygen 1.8.4