Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::TwoSpacesMap< SpaceType > Class Template Reference

This class provides a correspondancy map between two spaces and particularly between a sequential space Xs defined on a submesh of the parallel space Xp. More...

+ Collaboration diagram for Feel::TwoSpacesMap< SpaceType >:

Public Types

typedef space_type::element_type element_type
 
typedef mpl::range_c< int, 0, n_spaces > rangespace_type
 
typedef std::shared_ptr< space_type > space_ptrtype
 
typedef SpaceType space_type
 
template<int T>
using subelement_type = typename subspace_type< T >::element_type
 
template<int T>
using subspace_ptrtype = std::shared_ptr< subspace_type< T > >
 
template<int T>
using subspace_type = typename space_type::template sub_functionspace< T >::type
 

Public Member Functions

void build ()
 build the map, depending if the spaces are composite or not
 
void build (mpl::false_)
 build the map, non-composite spaces
 
void build (mpl::true_)
 build the map, composite spaces
 
int clusterToSequential (size_type const &p_dof)
 
void init (space_ptrtype _Xs, space_ptrtype _Xp)
 initialize the map between _Xs and _Xp
 
int parallelToSequential (size_type const &p_dof)
 
void project (element_type &us, element_type const &up)
 project the parallel vector up on the sequential vector us
 
template<int N>
void project (subelement_type< N > &us, subelement_type< N > const &up)
 Project the parallel vector up from the N-th subspace on the sequential vector us.
 
std::pair< int, int > sequentialToParallel (size_type const &s_dof)
 
 TwoSpacesMap (int s=1)
 Default Constructor.
 
 TwoSpacesMap (space_ptrtype _Xs, space_ptrtype _Xp, int s=1)
 Constructor from spaces.
 

Static Public Attributes

static const bool is_composite = space_type::is_composite
 
static const int n_spaces = space_type::nSpaces
 

Detailed Description

template<typename SpaceType>
class Feel::TwoSpacesMap< SpaceType >

This class provides a correspondancy map between two spaces and particularly between a sequential space Xs defined on a submesh of the parallel space Xp.

For any dof in Xs the class provides the index which has the corresponding dof in parallel and the index of this dof in Xp.

Member Function Documentation

◆ clusterToSequential()

template<typename SpaceType >
int Feel::TwoSpacesMap< SpaceType >::clusterToSequential ( size_type const &  p_dof)
Returns
the sequential index corresponding to the given global cluster dof p_dof The sequential index is broadcasted to all proc

References Feel::globalRank(), Feel::TwoSpacesMap< SpaceType >::parallelToSequential(), and Feel::Environment::worldComm().

◆ parallelToSequential()

template<typename SpaceType >
int Feel::TwoSpacesMap< SpaceType >::parallelToSequential ( size_type const &  p_dof)
Returns
the sequential index corresponding to the given global process dof p_dof Return -1 if the p_dof is not found

Referenced by Feel::TwoSpacesMap< SpaceType >::clusterToSequential().

◆ sequentialToParallel()

template<typename SpaceType >
std::pair< int, int > Feel::TwoSpacesMap< SpaceType >::sequentialToParallel ( size_type const &  s_dof)
Returns
a pair <proc,p_dof> corresponding to the given s_dof. proc is the number of the process where is located the global process p_dof

Referenced by Feel::TwoSpacesMap< SpaceType >::project().