1#ifndef DUNE_FEM_NONBLOCKMAPPER_HH
2#define DUNE_FEM_NONBLOCKMAPPER_HH
19 template<
class BlockMapper,
int blockSize >
23 namespace __NonBlockMapper
29 template<
class BlockMapper,
int bS >
36 typedef typename BlockMapper::SizeType
SizeType;
50 typedef Base< T > BaseType;
52 template<
class,
template<
class >
class >
56 typedef typename BaseType::Traits
Traits;
66 template<
class Functor >
69 explicit BlockFunctor ( Functor functor )
73 template<
class GlobalKey >
74 void operator() (
int localBlock,
const GlobalKey globalKey )
const
78 const int localEnd = localDof +
blockSize;
79 while( localDof != localEnd )
80 functor_( localDof++, globalDof++ );
94 bool contains (
const int codim )
const {
return blockMapper_.contains( codim ); }
96 bool fixedDataSize (
int codim )
const {
return blockMapper_.fixedDataSize( codim ); }
98 template<
class Functor >
101 blockMapper_.mapEach( element, BlockFunctor< Functor >( std::forward< Functor >( f ) ) );
104 void map (
const ElementType &element, std::vector< GlobalKeyType > &indices )
const
106 indices.resize(
numDofs( element ) );
107 mapEach( element, [ &indices ] (
int local,
GlobalKeyType global ) { indices[ local ] = global; } );
113 blockMapper_.onSubEntity( element, i, c, indices );
118 indices[ i*
blockSize + j ] = indices[ i ];
122 template<
class Entity,
class Functor >
125 blockMapper_.mapEachEntityDof( entity, BlockFunctor< Functor >( std::forward< Functor >( f ) ) );
128 template<
class Entity >
129 void mapEntityDofs (
const Entity &entity, std::vector< GlobalKeyType > &indices )
const
139 template<
class Entity >
146 DUNE_THROW( NotImplemented,
"Method numBlocks() called on non-adaptive block mapper" );
151 DUNE_THROW( NotImplemented,
"Method numberOfHoles() called on non-adaptive block mapper" );
156 DUNE_THROW( NotImplemented,
"Method oldIndex() called on non-adaptive block mapper" );
161 DUNE_THROW( NotImplemented,
"Method newIndex() called on non-adaptive block mapper" );
166 DUNE_THROW( NotImplemented,
"Method oldOffSet() called on non-adaptive block mapper" );
171 DUNE_THROW( NotImplemented,
"Method offSet() called on non-adaptive block mapper" );
176 void update () { blockMapper_.update(); }
188 :
public DofMapper< T, Dune::Fem::AdaptiveDofMapper >
196 typedef typename BaseType::Traits
Traits;
202 using BaseType::blockMapper;
242 template< class BlockMapper, int blockSize, bool adaptive = Capabilities::isAdaptiveDofMapper< BlockMapper >::v >
248 typedef typename std::conditional< adaptive,
260 template<
class BlockMapper,
int blockSize >
262 :
public __NonBlockMapper::template Implementation< BlockMapper, blockSize >::Type
264 typedef typename __NonBlockMapper::template Implementation< BlockMapper, blockSize >::Type BaseType;
269 : BaseType( blockMapper )
277 template<
class BlockMapper,
int innerBlockSize,
int outerBlockSize >
279 :
public NonBlockMapper< BlockMapper, innerBlockSize *outerBlockSize >
286 :
BaseType( blockMapper.blockMapper_ )
294 namespace Capabilities
296 template<
class BlockMapper,
int blockSize >
302 template<
class BlockMapper,
int blockSize >
Definition: bindguard.hh:11
specialize with true if index set implements the interface for consecutive index sets
Definition: common/indexset.hh:42
static const bool v
Definition: common/indexset.hh:49
Definition: space/mapper/capabilities.hh:22
static const bool v
Definition: space/mapper/capabilities.hh:23
Interface for calculating the size of a function space for a grid on a specified level....
Definition: mapper/dofmapper.hh:43
Extended interface for adaptive DoF mappers.
Definition: mapper/dofmapper.hh:219
Definition: nonblockmapper.hh:263
NonBlockMapper(BlockMapper &blockMapper)
Definition: nonblockmapper.hh:268
Definition: nonblockmapper.hh:31
BlockMapper::ElementType ElementType
Definition: nonblockmapper.hh:35
static const int blockSize
Definition: nonblockmapper.hh:39
NonBlockMapper< BlockMapper, bS > DofMapperType
Definition: nonblockmapper.hh:32
BlockMapper::GlobalKeyType GlobalKeyType
Definition: nonblockmapper.hh:37
BlockMapper BlockMapperType
Definition: nonblockmapper.hh:34
BlockMapper::SizeType SizeType
Definition: nonblockmapper.hh:36
Definition: nonblockmapper.hh:49
DofMapper(BlockMapperType &blockMapper)
Definition: nonblockmapper.hh:88
void onSubEntity(const ElementType &element, int i, int c, std::vector< bool > &indices) const
Definition: nonblockmapper.hh:110
Traits::GlobalKeyType GlobalKeyType
Definition: nonblockmapper.hh:63
SizeType size() const
Definition: nonblockmapper.hh:92
void mapEachEntityDof(const Entity &entity, Functor f) const
Definition: nonblockmapper.hh:123
SizeType oldOffSet(int) const
Definition: nonblockmapper.hh:164
void mapEach(const ElementType &element, Functor f) const
Definition: nonblockmapper.hh:99
GlobalKeyType oldIndex(int hole, int) const
Definition: nonblockmapper.hh:154
Traits::BlockMapperType BlockMapperType
Definition: nonblockmapper.hh:58
SizeType offSet(int) const
Definition: nonblockmapper.hh:169
void update()
Definition: nonblockmapper.hh:176
BaseType::Traits Traits
Definition: nonblockmapper.hh:56
static constexpr bool consecutive() noexcept
Definition: nonblockmapper.hh:142
Traits::ElementType ElementType
Definition: nonblockmapper.hh:61
SizeType numDofs(const ElementType &element) const
Definition: nonblockmapper.hh:137
int maxNumDofs() const
Definition: nonblockmapper.hh:135
SizeType numberOfHoles(int) const
Definition: nonblockmapper.hh:149
bool contains(const int codim) const
Definition: nonblockmapper.hh:94
SizeType numBlocks() const
Definition: nonblockmapper.hh:144
void map(const ElementType &element, std::vector< GlobalKeyType > &indices) const
Definition: nonblockmapper.hh:104
bool fixedDataSize(int codim) const
Definition: nonblockmapper.hh:96
static const int blockSize
Definition: nonblockmapper.hh:59
const BlockMapperType & blockMapper() const
Definition: nonblockmapper.hh:174
GlobalKeyType newIndex(int hole, int) const
Definition: nonblockmapper.hh:159
void mapEntityDofs(const Entity &entity, std::vector< GlobalKeyType > &indices) const
Definition: nonblockmapper.hh:129
Traits::SizeType SizeType
Definition: nonblockmapper.hh:62
SizeType numEntityDofs(const Entity &entity) const
Definition: nonblockmapper.hh:140
Definition: nonblockmapper.hh:189
BaseType::Traits Traits
Definition: nonblockmapper.hh:196
SizeType numberOfHoles(const int block) const
Definition: nonblockmapper.hh:216
Traits::SizeType SizeType
Definition: nonblockmapper.hh:205
SizeType numBlocks() const
Definition: nonblockmapper.hh:214
SizeType offSet(const int block) const
Definition: nonblockmapper.hh:234
SizeType oldOffSet(const int block) const
Definition: nonblockmapper.hh:232
static const int blockSize
Definition: nonblockmapper.hh:200
GlobalKeyType oldIndex(const int hole, const int block) const
Definition: nonblockmapper.hh:218
Traits::BlockMapperType BlockMapperType
Definition: nonblockmapper.hh:198
AdaptiveDofMapper(BlockMapperType &blockMapper)
Definition: nonblockmapper.hh:208
Traits::GlobalKeyType GlobalKeyType
Definition: nonblockmapper.hh:206
GlobalKeyType newIndex(const int hole, const int block) const
Definition: nonblockmapper.hh:225
Traits::ElementType ElementType
Definition: nonblockmapper.hh:204
bool consecutive() const
Definition: nonblockmapper.hh:212
Definition: nonblockmapper.hh:244
std::conditional< adaptive, AdaptiveDofMapper< Traits >, DofMapper< Traits > >::type Type
Definition: nonblockmapper.hh:250
Definition: nonblockmapper.hh:280
NonBlockMapper(const NonBlockMapper< BlockMapper, innerBlockSize > &blockMapper)
Definition: nonblockmapper.hh:285