Loading [MathJax]/extensions/tex2jax.js

DUNE MultiDomainGrid (2.10)

idsets.hh
1#ifndef DUNE_MULTIDOMAINGRID_IDSETS_HH
2#define DUNE_MULTIDOMAINGRID_IDSETS_HH
3
4#include <type_traits>
5
6#include <dune/grid/common/indexidset.hh>
7
8namespace Dune {
9
10namespace mdgrid {
11
12template<typename HostGrid, typename MDGridTraits>
13class MultiDomainGrid;
14
15template<typename GridImp, typename WrappedIdSet>
16class IdSetWrapper :
17 public Dune::IdSet<GridImp,IdSetWrapper<GridImp,WrappedIdSet>,
18 typename WrappedIdSet::IdType>
19{
20
21 template<typename,typename>
22 friend class MultiDomainGrid;
23
24 using HostGrid = typename std::remove_const_t<GridImp>::HostGrid;
25 using Codim0Entity = typename std::remove_const_t<GridImp>::Traits::template Codim<0>::Entity;
26
27public:
28
29 typedef typename WrappedIdSet::IdType IdType;
30
31 template<int codim>
32 IdType id(const typename std::remove_const_t<GridImp>::Traits::template Codim<codim>::Entity& e) const {
33 return _wrappedIdSet->id(_grid.hostEntity(e));
34 }
35
36 template<typename Entity>
37 IdType id(const Entity& e) const {
38 return _wrappedIdSet->id(_grid.hostEntity(e));
39 }
40
41 template<int codim>
42 IdType subId(const Codim0Entity& e, int i) const {
43 return _wrappedIdSet->subId(_grid.hostEntity(e),i,codim);
44 }
45
46 IdType subId(const Codim0Entity& e, int i, unsigned int codim) const {
47 return _wrappedIdSet->subId(_grid.hostEntity(e),i,codim);
48 }
49
50private:
51
52 const GridImp& _grid;
53 const WrappedIdSet* _wrappedIdSet;
54
55 IdSetWrapper(const GridImp& grid) :
56 _grid(grid),
57 _wrappedIdSet(NULL)
58 {}
59
60 void update(const WrappedIdSet& idSet) {
61 _wrappedIdSet = &idSet;
62 }
63
64};
65
66} // namespace mdgrid
67
68} // namespace Dune
69
70#endif // DUNE_MULTIDOMAINGRID_IDSETS_HH
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 3, 22:46, 2025)