Loading [MathJax]/extensions/tex2jax.js

DUNE MultiDomainGrid (2.8)

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