dune-grid
2.11
Toggle main menu visibility
Loading...
Searching...
No Matches
dune
grid
geometrygrid
idset.hh
Go to the documentation of this file.
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_GEOGRID_IDSET_HH
6
#define DUNE_GEOGRID_IDSET_HH
7
8
#include <
dune/grid/common/indexidset.hh
>
9
10
namespace
Dune
11
{
12
13
namespace
GeoGrid
14
{
15
16
// IdSet
17
// -----
18
19
template
<
class
Gr
id
,
class
HostIdSet >
20
class
IdSet
21
:
public
Dune::IdSet
< Grid, IdSet< Grid, HostIdSet >, typename HostIdSet::IdType >
22
{
23
typedef
IdSet< Grid, HostIdSet >
This;
24
typedef
Dune::IdSet< Grid, This, typename HostIdSet::IdType >
Base;
25
26
typedef
typename
std::remove_const< Grid >::type::Traits Traits;
27
28
public
:
29
typedef
typename
HostIdSet::IdType
IdType
;
30
31
using
Base::subId
;
32
33
IdSet
()
34
: hostIdSet_( 0 )
35
{}
36
37
explicit
IdSet
(
const
HostIdSet &hostIdSet )
38
: hostIdSet_( &hostIdSet )
39
{}
40
41
IdSet
(
const
This &other )
42
: hostIdSet_( other.hostIdSet_ )
43
{}
44
45
const
This &
operator=
(
const
This &other )
46
{
47
hostIdSet_ = other.hostIdSet_;
48
return
*
this
;
49
}
50
51
template
<
int
codim >
52
IdType
id
(
const
typename
Traits::template
Codim< codim >::Entity
&entity )
const
53
{
54
return
entity.impl().id( hostIdSet() );
55
}
56
57
template
<
class
Entity >
58
IdType
id
(
const
Entity
&entity )
const
59
{
60
return
id< Entity::codimension >
( entity );
61
}
62
63
IdType
subId
(
const
typename
Traits::template
Codim< 0 >::Entity
&entity,
int
i,
unsigned
int
codim )
const
64
{
65
return
hostIdSet().subId( Grid::template getHostEntity< 0 >( entity ), i, codim );
66
}
67
68
explicit
operator
bool ()
const
{
return
bool( hostIdSet_ ); }
69
70
private
:
71
const
HostIdSet &hostIdSet ()
const
72
{
73
assert( *
this
);
74
return
*hostIdSet_;
75
}
76
77
const
HostIdSet *hostIdSet_;
78
};
79
80
}
// namespace GeoGrid
81
82
}
// namespace Dune
83
84
#endif
// #ifndef DUNE_GEOGRID_IDSET_HH
Dune
Include standard header files.
Definition
agrid.hh:60
Dune::GeoGrid
namespace containing the implementations of GeometryGrid
Definition
geometrygrid/backuprestore.hh:20
Dune::IdSet
Id Set Interface.
Definition
common/indexidset.hh:447
Dune::IdSet::subId
IdType subId(const typename Codim< 0 >::Entity &e, int i, unsigned int codim) const
Get id of subentity i of co-dimension codim of a co-dimension 0 entity.
Definition
common/indexidset.hh:481
Dune::IdSet::Codim
Export the type of the entity used as parameter in the id(...) method.
Definition
common/indexidset.hh:457
Dune::GeoGrid::Entity
DUNE-conform implementation of the entity.
Definition
geometrygrid/entity.hh:694
Dune::GeoGrid::IdSet::IdSet
IdSet()
Definition
idset.hh:33
Dune::GeoGrid::IdSet::IdSet
IdSet(const HostIdSet &hostIdSet)
Definition
idset.hh:37
Dune::GeoGrid::IdSet::id
IdType id(const Entity &entity) const
Definition
idset.hh:58
Dune::GeoGrid::IdSet::subId
IdType subId(const typename Traits::template Codim< 0 >::Entity &entity, int i, unsigned int codim) const
Definition
idset.hh:63
Dune::GeoGrid::IdSet::id
IdType id(const typename Traits::template Codim< codim >::Entity &entity) const
Definition
idset.hh:52
Dune::GeoGrid::IdSet::IdSet
IdSet(const This &other)
Definition
idset.hh:41
Dune::GeoGrid::IdSet::operator=
const This & operator=(const This &other)
Definition
idset.hh:45
Dune::GeoGrid::IdSet< const Grid, typename HostGrid::Traits::GlobalIdSet >::IdType
typename HostGrid::Traits::GlobalIdSet::IdType IdType
Definition
idset.hh:29
indexidset.hh
Provides base classes for index and id sets.
Generated by
1.17.0