1#ifndef DUNE_FEM_COMBINEDDOFSTORAGE_HH
2#define DUNE_FEM_COMBINEDDOFSTORAGE_HH
5#include <dune/fem/space/common/dofstorage.hh>
6#include <dune/fem/storage/subvector.hh>
16 template<
class ContainedMapper,
int N, DofStoragePolicy policy >
22 template<
class ContainedMapper ,
int N >
29 typedef ContainedMapper ContainedMapperType;
37 template<
class ContainedMapper,
int N >
41 typedef ContainedMapper ContainedMapperType;
66 return combinedIndex / containedSize();
72 return combinedIndex % containedSize();
79 return containedIndex + (component * containedSize());
83 const ContainedMapperType &mapper_;
85 int containedSize ()
const
87 return mapper_.size();
93 template<
class MapperImp,
int N, DofStoragePolicy policy >
94 class CombinedSubMapper
95 :
public Fem :: IndexMapperInterface< CombinedSubMapper< MapperImp, N, policy > >
97 typedef CombinedSubMapper< MapperImp, N , policy > ThisType;
101 typedef MapperImp ContainedMapperType;
104 CombinedSubMapper (
const ContainedMapperType& mapper,
unsigned int component )
106 component_( component ),
107 utilGlobal_(mapper_, policy == PointBased ? N : mapper.
size() )
109 assert(component_ < N);
112 CombinedSubMapper(
const ThisType& ) =
default;
113 CombinedSubMapper(ThisType&& ) =
default;
114 ThisType& operator=(
const ThisType& ) =
delete;
115 ThisType& operator=(ThisType&& ) =
delete;
118 unsigned int size ()
const
120 return mapper_.size();
123 unsigned int range ()
const
128 unsigned int operator[] (
unsigned int index )
const
130 utilGlobal_.newSize( mapper_.size() );
131 return utilGlobal_.combinedDof(index, component_);
135 const ContainedMapperType& mapper_;
136 const unsigned int component_;
137 mutable DofConversionType utilGlobal_;
void newSize(int size)
Set new size after adaptation.
Definition: combineddofstorage.hh:59
int component(int combinedIndex) const
Definition: combineddofstorage.hh:64
int combinedDof(int containedIndex, int component) const
Definition: combineddofstorage.hh:77
CombinedDofConversionUtility(const ContainedMapperType &mapper, int size)
constructor
Definition: combineddofstorage.hh:48
int containedDof(int combinedIndex) const
Number of the (scalar) base function belonging to base function index.
Definition: combineddofstorage.hh:70
static DofStoragePolicy policy()
Find out what type of policy this is.
Definition: combineddofstorage.hh:53
Definition: combineddofstorage.hh:17
Specialisation for PointBased approach.
Definition: dofstorage.hh:101
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