DUNE-FEM (unstable)

indexset.hh
1#ifndef DUNE_FEM_GRIDPART_GEOMETRYGRIDPART_INDEXSET_HH
2#define DUNE_FEM_GRIDPART_GEOMETRYGRIDPART_INDEXSET_HH
3
4#include <vector>
5
7
8#include <dune/grid/common/gridenums.hh>
10
11namespace Dune
12{
13
14 namespace Fem
15 {
16
17 // GeometryGridPartIndexSet
18 // ----------
19
20 template< class HostIndexSet >
21 class GeometryGridPartIndexSet
22 {
23 typedef GeometryGridPartIndexSet< HostIndexSet > This;
24
25 public:
26 typedef typename HostIndexSet::IndexType IndexType;
27
28 explicit GeometryGridPartIndexSet ( const HostIndexSet &hostIndexSet )
29 : hostIndexSet_( &hostIndexSet )
30 {}
31
32 int size ( const GeometryType &type ) const { return hostIndexSet().size( type ); }
33 int size ( const int codim ) const { return hostIndexSet().size( codim ); }
34
35 template< class Entity >
36 int index ( const Entity &entity ) const
37 {
38 return hostIndexSet().index( entity.impl().hostEntity() );
39 }
40
41 template< class Entity >
42 int subIndex ( const Entity &entity, const int local, const unsigned int codim ) const
43 {
44 return hostIndexSet().subIndex( entity.impl().hostEntity(), local, codim );
45 }
46
47 const std::vector< GeometryType > &geomTypes ( const int codim ) const
48 {
49 return hostIndexSet().geomTypes( codim );
50 }
51
52 template< class Entity >
53 bool contains ( const Entity &entity ) const
54 {
55 return hostIndexSet().contains( entity.impl().hostEntity() );
56 }
57
58 bool consecutive () const { return hostIndexSet().consecutive(); }
59 bool persistent () const { return hostIndexSet().persistent(); }
60
61 int numberOfHoles ( const int codim ) const { return hostIndexSet().numberOfHoles( codim ); }
62
63 int oldIndex ( const int hole, const int codim ) const
64 {
65 return hostIndexSet().oldIndex( hole, codim );
66 }
67
68 int newIndex ( const int hole, const int codim ) const
69 {
70 return hostIndexSet().newIndex( hole, codim );
71 }
72
73 std::string name () const { return "GeometryGridPart::IndexSet" ; }
74
75 private:
76 const HostIndexSet &hostIndexSet () const
77 {
78 assert( hostIndexSet_ );
79 return *hostIndexSet_;
80 }
81
82 const HostIndexSet *hostIndexSet_;
83 };
84
85 } // namespace Fem
86
87} // namespace Dune
88
89#endif // #ifndef DUNE_FEM_GRIDPART_GEOMETRYGRIDPART_INDEXSET_HH
Provides base classes for index and id sets.
Dune namespace.
Definition: alignedallocator.hh:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
constexpr std::bool_constant<((II==value)||...)> contains(std::integer_sequence< T, II... >, std::integral_constant< T, value >)
Checks whether or not a given sequence contains a value.
Definition: integersequence.hh:137
Traits for type conversions and type information.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)