Dune Core Modules (2.6.0)

yaspgrididset.hh
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_GRID_YASPGRIDIDSET_HH
4 #define DUNE_GRID_YASPGRIDIDSET_HH
5 
6 
7 namespace Dune {
8 
9  //========================================================================
14  //========================================================================
15 
16  template<class GridImp>
17  class YaspGlobalIdSet : public IdSet<GridImp,YaspGlobalIdSet<GridImp>,
18  typename std::remove_const<GridImp>::type::PersistentIndexType >
19  /*
20  We used the remove_const to extract the Type from the mutable class,
21  because the const class is not instantiated yet.
22  */
23  {
25 
26  public:
28  typedef typename std::remove_const<GridImp>::type::PersistentIndexType IdType;
29 
31 
34  {}
35 
37  /*
38  We use the remove_const to extract the Type from the mutable class,
39  because the const class is not instantiated yet.
40  */
41  template<int cd>
42  IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
43  {
44  return GridImp::getRealImplementation(e).persistentIndex();
45  }
46 
48  /*
49  We use the remove_const to extract the Type from the mutable class,
50  because the const class is not instantiated yet.
51  */
52  IdType subId (const typename std::remove_const<GridImp>::type::Traits::template Codim< 0 >::Entity &e,
53  int i, unsigned int codim ) const
54  {
55  return GridImp::getRealImplementation(e).subPersistentIndex(i,codim);
56  }
57 
58  };
59 
60 } // namespace Dune
61 
62 #endif // DUNE_GRID_YASPGRIDIDSET_HH
Id Set Interface.
Definition: indexidset.hh:441
persistent, globally unique Ids
Definition: yaspgrididset.hh:23
IdType subId(const typename std::remove_const< GridImp >::type::Traits::template Codim< 0 >::Entity &e, int i, unsigned int codim) const
get id of subentity
Definition: yaspgrididset.hh:52
std::remove_const< GridImp >::type::PersistentIndexType IdType
define the type used for persistent indices
Definition: yaspgrididset.hh:28
YaspGlobalIdSet()
Only default-constructible.
Definition: yaspgrididset.hh:33
IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
get id of an entity
Definition: yaspgrididset.hh:42
Dune namespace.
Definition: alignedallocator.hh:10
Static tag representing a codimension.
Definition: dimension.hh:22
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 26, 22:29, 2024)