dune-grid 2.9.0
yaspgrididset.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
2// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4// vi: set et ts=4 sw=2 sts=2:
5#ifndef DUNE_GRID_YASPGRIDIDSET_HH
6#define DUNE_GRID_YASPGRIDIDSET_HH
7
8
9namespace Dune {
10
11 //========================================================================
16 //========================================================================
17
18 template<class GridImp>
19 class YaspGlobalIdSet : public IdSet<GridImp,YaspGlobalIdSet<GridImp>,
20 typename std::remove_const<GridImp>::type::PersistentIndexType >
21 /*
22 We used the remove_const to extract the Type from the mutable class,
23 because the const class is not instantiated yet.
24 */
25 {
27
28 public:
30 typedef typename std::remove_const<GridImp>::type::PersistentIndexType IdType;
31
32 using IdSet<GridImp, This, IdType>::subId;
33
36 {}
37
39 /*
40 We use the remove_const to extract the Type from the mutable class,
41 because the const class is not instantiated yet.
42 */
43 template<int cd>
44 IdType id (const typename std::remove_const<GridImp>::type::Traits::template Codim<cd>::Entity& e) const
45 {
46 return e.impl().persistentIndex();
47 }
48
50 /*
51 We use the remove_const to extract the Type from the mutable class,
52 because the const class is not instantiated yet.
53 */
54 IdType subId (const typename std::remove_const<GridImp>::type::Traits::template Codim< 0 >::Entity &e,
55 int i, unsigned int codim ) const
56 {
57 return e.impl().subPersistentIndex(i,codim);
58 }
59
60 };
61
62} // namespace Dune
63
64#endif // DUNE_GRID_YASPGRIDIDSET_HH
Include standard header files.
Definition: agrid.hh:60
Id Set Interface.
Definition: indexidset.hh:452
persistent, globally unique Ids
Definition: yaspgrididset.hh:25
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:54
std::remove_const< GridImp >::type::PersistentIndexType IdType
define the type used for persistent indices
Definition: yaspgrididset.hh:30
YaspGlobalIdSet()
Only default-constructible.
Definition: yaspgrididset.hh:35
IdType id(const typename std::remove_const< GridImp >::type::Traits::template Codim< cd >::Entity &e) const
get id of an entity
Definition: yaspgrididset.hh:44