dune-multidomaingrid 2.10-git
Loading...
Searching...
No Matches
Dune::mdgrid::MultiDomainMCMGMapper< GV > Class Template Reference

Implementation class for a multiple codim and multiple geometry type mapper. More...

#include <dune/grid/multidomaingrid/multidomainmcmgmapper.hh>

Inheritance diagram for Dune::mdgrid::MultiDomainMCMGMapper< GV >:
Inheritance graph

Public Types

typedef GV::IndexSet::IndexType IndexType
 
typedef GV::Grid::SubDomainIndex SubDomainIndex
 
typedef GV GridView
 
typedef GV::IndexSet::IndexType Index
 
typedef decltype(std::declval< typename GV::IndexSet >().size(0)) size_type
 

Public Member Functions

 MultiDomainMCMGMapper (const GV &gv, const MCMGLayout &layout)
 
 MultiDomainMCMGMapper (const GV &gv)
 Construct mapper from grid and one of its index sets.
 
template<class EntityType >
int map (SubDomainIndex subDomain, const EntityType &e) const
 Map entity to array index.
 
int map (SubDomainIndex subDomain, const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
 Map subentity of codim 0 entity to array index.
 
int size (SubDomainIndex subDomain) const
 Return total number of entities in the entity set managed by the mapper.
 
template<class EntityType >
bool contains (SubDomainIndex subDomain, const EntityType &e, IndexType &result) const
 Returns true if the entity is contained in the index set.
 
template<int cc>
bool contains (SubDomainIndex subDomain, const typename GV::template Codim< 0 >::Entity &e, int i, IndexType &result) const
 Returns true if the entity is contained in the index set.
 
void update (const GV &gv)
 Recalculates indices after grid adaptation.
 
Index index (const EntityType &e) const
 
Index subIndex (const typename GV::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
 
Index subIndex (const typename G::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
 
size_type size () const
 
size_type size (GeometryType gt) const
 
const std::vector< GeometryType > & types (int codim) const
 
IntegralRange< Indexindices (const EntityType &e) const
 
IntegralRange< Indexindices (const typename GV::template Codim< 0 >::Entity &e, int i, int cc) const
 
bool contains (const EntityType &e, Index &result) const
 
bool contains (const typename GV::template Codim< 0 >::Entity &e, int i, int cc, Index &result) const
 
bool contains (const typename G::Traits::template Codim< 0 >::Entity &e, int i, int cc, GV::IndexSet::IndexType &result) const
 
bool contains (const EntityType &e, IndexType &result) const
 
bool contains (const typename G::Traits::template Codim< 0 >::Entity &e, int i, int cc, IndexType &result) const
 
void update (GV &&gridView)
 
void update (GridView &&gridView)
 
const MCMGLayoutlayout () const
 
const GridViewgridView () const
 

Protected Attributes

std::array< std::vector< IndexType >, GV::Grid::maxSubDomainIndex()>   _offsets 
 

Detailed Description

template<typename GV>
class Dune::mdgrid::MultiDomainMCMGMapper< GV >

Implementation class for a multiple codim and multiple geometry type mapper.

In this implementation of a mapper the entity set used as domain for the map consists of the entities of a subset of codimensions in the given index set. The index set may contain entities of several geometry types. This version is usually not used directly but is used to implement versions for leafwise and levelwise entity sets.

Template parameters are:

GV
A Dune GridView type.
Layout
A helper class with a method contains(), that returns true for all geometry types that are in the domain of the map. The class should be of the following shape
template<int dim>
struct LayoutClass {
bool contains (Dune::GeometryType gt) const {
// Return true if gt is in the domain of the map
}
};
bool setContains(const ArrayBasedSet< SI, capacity > &a, const ArrayBasedSet< SI, capacity > &b)
static bool contains(const Type &attribute)

If you don't want to use the default constructor of the LayoutClass you can construct it yourself and hand it to the respective constructor.

Member Typedef Documentation

◆ IndexType

template<typename GV >
typedef GV::IndexSet::IndexType Dune::mdgrid::MultiDomainMCMGMapper< GV >::IndexType

◆ SubDomainIndex

template<typename GV >
typedef GV::Grid::SubDomainIndex Dune::mdgrid::MultiDomainMCMGMapper< GV >::SubDomainIndex

Constructor & Destructor Documentation

◆ MultiDomainMCMGMapper() [1/2]

template<typename GV >
Dune::mdgrid::MultiDomainMCMGMapper< GV >::MultiDomainMCMGMapper ( const GV gv,
const MCMGLayout layout 
)
inline

◆ MultiDomainMCMGMapper() [2/2]

template<typename GV >
Dune::mdgrid::MultiDomainMCMGMapper< GV >::MultiDomainMCMGMapper ( const GV gv)
inline

Construct mapper from grid and one of its index sets.

Parameters
gridA Dune grid object.
indexsetIndexSet object returned by grid.

Member Function Documentation

◆ contains() [1/2]

template<typename GV >
template<class EntityType >
bool Dune::mdgrid::MultiDomainMCMGMapper< GV >::contains ( SubDomainIndex  subDomain,
const EntityType e,
IndexType result 
) const
inline

Returns true if the entity is contained in the index set.

Parameters
eReference to entity
resultinteger reference where corresponding index is stored if true
Returns
true if entity is in entity set of the mapper

◆ contains() [2/2]

template<typename GV >
template<int cc>
bool Dune::mdgrid::MultiDomainMCMGMapper< GV >::contains ( SubDomainIndex  subDomain,
const typename GV::template Codim< 0 >::Entity e,
int  i,
IndexType result 
) const
inline

Returns true if the entity is contained in the index set.

Parameters
eReference to codim 0 entity
isubentity number
resultinteger reference where corresponding index is stored if true
Returns
true if entity is in entity set of the mapper

◆ map() [1/2]

template<typename GV >
template<class EntityType >
int Dune::mdgrid::MultiDomainMCMGMapper< GV >::map ( SubDomainIndex  subDomain,
const EntityType e 
) const
inline

Map entity to array index.

Parameters
eReference to codim cc entity, where cc is the template parameter of the function.
Returns
An index in the range 0 ... Max number of entities in set - 1.

◆ map() [2/2]

template<typename GV >
int Dune::mdgrid::MultiDomainMCMGMapper< GV >::map ( SubDomainIndex  subDomain,
const typename GV::template Codim< 0 >::Entity e,
int  i,
unsigned int  codim 
) const
inline

Map subentity of codim 0 entity to array index.

Parameters
eReference to codim 0 entity.
iNumber of subentity of e
codimCodimension of the subendity
Returns
An index in the range 0 ... Max number of entities in set - 1.

◆ size()

template<typename GV >
int Dune::mdgrid::MultiDomainMCMGMapper< GV >::size ( SubDomainIndex  subDomain) const
inline

Return total number of entities in the entity set managed by the mapper.

This number can be used to allocate a vector of data elements associated with the entities of the set. In the parallel case this number is per process (i.e. it may be different in different processes).

Returns
Size of the entity set.

◆ update()

template<typename GV >
void Dune::mdgrid::MultiDomainMCMGMapper< GV >::update ( const GV gv)
inline

Recalculates indices after grid adaptation.

After grid adaptation you need to call this to update the stored gridview and recalculate the indices.

Member Data Documentation

◆ _offsets

template<typename GV , bool max_subomain_index_is_static>
std::array<std::vector<IndexType>,GV::Grid::maxSubDomainIndex()> Dune::mdgrid::MCMGMapperStorageProvider< GV, max_subomain_index_is_static >::_offsets
protectedinherited

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