1#ifndef DUNE_MULTIDOMAINGRID_SUBDOMAINGRID_INDEXSETS_HH
2#define DUNE_MULTIDOMAINGRID_SUBDOMAINGRID_INDEXSETS_HH
4#include <unordered_map>
11#include <dune/grid/common/indexidset.hh>
22template<
typename MDGr
id>
26template<
typename Gr
idImp,
typename MDIndexSet>
28 public Dune::IndexSet<GridImp,IndexSetWrapper<GridImp,MDIndexSet>,
29 typename MDIndexSet::IndexType,
30 typename MDIndexSet::Types>
33 template<
typename,
typename>
36 template<
typename MDGr
id>
39 template<
typename,
typename,
typename>
42 template<
typename,
typename,
int, PartitionIteratorType,
typename>
47 using HostGrid =
typename std::remove_const_t<GridImp>::HostGrid;
48 using MDGrid =
typename std::remove_const_t<GridImp>::MultiDomainGrid;
49 using ctype =
typename std::remove_const_t<GridImp>::ctype;
53 typedef typename MDIndexSet::Types
Types;
55 using SubDomainIndex =
typename std::remove_const_t<GridImp>::SubDomainIndex;
57 static const int dimension = std::remove_const_t<GridImp>::dimension;
61 using Codim0Entity =
typename std::remove_const_t<GridImp>::Traits::template Codim<0>::Entity;
66 IndexType index(
const typename std::remove_const_t<GridImp>::Traits::template Codim<codim>::Entity& e)
const {
67 return _mdIndexSet.template index<codim>(_grid.domain(),_grid.multiDomainEntity(e));
70 template<
typename Entity>
72 return _mdIndexSet.template index<Entity::codimension>(_grid.domain(),_grid.multiDomainEntity(e));
75 template<
int cc,
typename Entity>
77 return _mdIndexSet.template subIndex<cc>(_grid.domain(),_grid.multiDomainEntity(e),i,codim);
80 template<
typename Entity>
82 return _mdIndexSet.subIndex(_grid.domain(),_grid.multiDomainEntity(e),i,codim);
86 return _mdIndexSet.types(_grid.domain(),codim);
90 return _mdIndexSet.sizeForSubDomain(_grid.domain(),type);
94 return _mdIndexSet.sizeForSubDomain(_grid.domain(),codim);
97 template<
typename EntityType>
99 return _mdIndexSet.contains(_grid.domain(),_grid.multiDomainEntity(e));
103 return (_grid == rhs._grid && &_mdIndexSet == &rhs._mdIndexSet);
108 _mdIndexSet(mdIndexSet)
113 const GridImp& _grid;
114 const MDIndexSet& _mdIndexSet;
116 template<
typename EntityType>
117 bool containsHostEntity(
const EntityType& he)
const {
118 return _mdIndexSet.containsForSubDomain(_grid.domain(),he);
121 template<
typename EntityType>
122 bool containsMultiDomainEntity(
const EntityType& mde)
const {
123 return _mdIndexSet.contains(_grid.domain(),mde);
Definition: multidomaingrid.hh:8
Definition: subdomaingrid.hh:203
Definition: subdomaingrid/indexsets.hh:31
MDIndexSet::Types Types
Definition: subdomaingrid/indexsets.hh:53
IndexSetWrapper(const GridImp &grid, const MDIndexSet &mdIndexSet)
Definition: subdomaingrid/indexsets.hh:106
IndexType size(GeometryType type) const
Definition: subdomaingrid/indexsets.hh:89
MDIndexSet::IndexType IndexType
Definition: subdomaingrid/indexsets.hh:56
IndexType subIndex(const Entity &e, int i, unsigned int codim) const
Definition: subdomaingrid/indexsets.hh:81
typename std::remove_const_t< GridImp >::SubDomainIndex SubDomainIndex
Definition: subdomaingrid/indexsets.hh:55
Types types(int codim) const
Definition: subdomaingrid/indexsets.hh:85
IndexType size(int codim) const
Definition: subdomaingrid/indexsets.hh:93
bool operator==(const IndexSetWrapper &rhs) const
Definition: subdomaingrid/indexsets.hh:102
bool contains(const EntityType &e) const
Definition: subdomaingrid/indexsets.hh:98
IndexType index(const typename std::remove_const_t< GridImp >::Traits::template Codim< codim >::Entity &e) const
Definition: subdomaingrid/indexsets.hh:66
IndexType subIndex(const Entity &e, int i, unsigned int codim) const
Definition: subdomaingrid/indexsets.hh:76
IndexType index(const Entity &e) const
Definition: subdomaingrid/indexsets.hh:71
static const int dimension
Definition: subdomaingrid/indexsets.hh:57
Definition: subdomaingrid/intersection.hh:19
Definition: subdomaingrid/iterator.hh:28