DUNE PDELab (git)

yaspgrididset.hh
1// SPDX-FileCopyrightText: Copyright © 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
Id Set Interface.
Definition: indexidset.hh:447
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
Dune namespace.
Definition: alignedallocator.hh:13
Static tag representing a codimension.
Definition: dimension.hh:24
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)