DUNE-FEM (unstable)

Dune::Fem::hpDG::DiscontinuousGalerkinBlockMapper< GridPart, LocalKeys > Struct Template Reference

An \(hp\)-adaptive Dune::Fem::DofMapper. More...

#include <dune/fem/space/hpdg/blockmapper.hh>

Public Types

using SizeType = typename BaseType::SizeType
 size type
 
using GlobalKeyType = typename BaseType::GlobalKeyType
 global key type
 
using GridPartType = GridPart
 grid part type
 
using ElementType = typename BaseType::ElementType
 element type
 
using LocalKeysType = LocalKeys
 basis function sets type
 
using KeyType = typename LocalKeysType::KeyType
 key type
 
using DofManagerType = DofManager< GridType >
 dof manager type
 
typedef Traits::DofMapperType DofMapperType
 type of the DofMapper implementation
 

Public Member Functions

bool consecutive () const
 return true if compress will affect data
 
SizeType oldOffSet (const int block) const
 return old offsets for given block
 
SizeType offSet (const int block) const
 return current offsets for given block
 
SizeType numBlocks () const
 return number of supported blocks
 
void update ()
 update DoF mapping after grid modification More...
 
bool contains (const int codim) const
 returns true if DoFs for given codimension exist More...
 
bool fixedDataSize (const int codim) const
 Check, whether the data in a codimension has fixed size.
 
template<class Functor >
void mapEach (const ElementType &element, Functor f) const
 map each local DoF number to a global key More...
 
template<class Entity , class Functor >
void mapEachEntityDof (const Entity &entity, Functor f) const
 map each local DoF number to a global key More...
 
Construction
template<class Function >
 DiscontinuousGalerkinBlockMapper (const GridPartType &gridPart, const LocalKeysType &localKeys, const KeyType &value, Function function)
 
 DiscontinuousGalerkinBlockMapper (const GridPartType &gridPart, const LocalKeysType &localKeys, const KeyType &value)
 
Copying and assignment
 DiscontinuousGalerkinBlockMapper (const ThisType &)=delete
 copy constructor
 
 DiscontinuousGalerkinBlockMapper (ThisType &&)=default
 move constructor
 
ThisType & operator= (const ThisType &)=delete
 assignment operator
 
ThisType & operator= (ThisType &&)=default
 move assignment operator
 
Adaptation interface
template<class Element >
std::enable_if<(std::is_same< Element, ElementType >::value||std::is_same< Element, GridElementType >::value), const KeyType & >::type key (const Element &element) const
 get key currently assigned to an entity
 
void mark (const KeyType &key, const ElementType &element)
 set key to be assigned to an entity after next call to adapt()
 
KeyType getMark (const ElementType &element) const
 get key to be assigned to an entity after next call to adapt()
 
template<class Function >
bool adapt (Function function)
 please doc me
 
bool adapt ()
 please doc me
 

Public interface for adaptation managers

const DofManagerTypedofManager () const
 return DOF manager
 
void insertEntity (const GridElementType &gridElement)
 add DOFs for element
 
void removeEntity (const GridElementType &gridElement)
 mark DOFs for removal
 
void insertNewEntity (const GridElementType &gridElement)
 add DOFs for new element
 
void resize ()
 
bool compress ()
 compress DOF mapping
 
template<class Traits >
void write (OutStreamInterface< Traits > &)
 this mapper has no I/O capabilities
 
template<class Traits >
void read (InStreamInterface< Traits > &)
 this mapper has no I/O capabilities
 
void backup () const
 this mapper has no I/O capabilities
 
void restore ()
 this mapper has no I/O capabilities
 

Interface methods

SizeType size () const
 return number of dofs
 
int maxNumDofs () const
 return upper bound for number of dofs
 
SizeType numDofs (const ElementType &element) const
 return number of dofs for given element
 
template<class Entity >
SizeType numEntityDofs (const Entity &entity) const
 return number of dofs for given element
 
void onSubEntity (const ElementType &element, int i, int c, std::vector< bool > &indices) const
 
void onSubEntity (const ElementType &element, int i, int c, std::vector< char > &indices) const
 
template<class Function >
void mapEach (const ElementType &element, Function function) const
 map local dof to global key
 
template<class Entity , class Function >
void mapEachEntityDof (const Entity &entity, Function function) const
 map local dof to global key
 
SizeType numberOfHoles (const int block) const
 return number of holes during compression
 
GlobalKeyType oldIndex (const int hole, const int block) const
 return old index of given hole during compression
 
GlobalKeyType newIndex (const int hole, const int block) const
 return new index of given hole during compression
 
static constexpr bool contains (const int codim)
 return true if dofs are associated to codimension
 
static constexpr bool fixedDataSize (int codim)
 return true if number of dofs is fixed for given codimension
 
static constexpr bool consecutive ()
 return true (this mapper yields a consecutive DOF numbering)
 
static constexpr SizeType oldOffSet (const int block)
 return 0 (this mapper has no offset)
 
static constexpr SizeType offSet (const int block)
 return 0 (this mapper has no offset)
 
static constexpr SizeType numBlocks ()
 return 1 (this mapper has one block)
 

Detailed Description

template<class GridPart, class LocalKeys>
struct Dune::Fem::hpDG::DiscontinuousGalerkinBlockMapper< GridPart, LocalKeys >

An \(hp\)-adaptive Dune::Fem::DofMapper.

Template Parameters
GridParta Dune::Fem::GridPart type
LocalKeyssee documentation below
Note
The second template parameter is required to provide the following member methods:
struct LocalKeys
{
// type of key
using KeyType = ImplementationDefined;
// type of data
using DataType = ImplementationDefined;
// return maximum number of dofs associated with an entity
std::size_t maxBlocks () const;
// return maximum number of dofs for given type and key
std::size_t blocks ( GeometryType type, const KeyType &key ) const;
// map key to data type
DataType encode ( const KeyType &key ) const;
// map data to key type
KeyType decode ( const DataType &data ) const;
};
typename LocalKeysType::KeyType KeyType
key type
Definition: blockmapper.hh:120
std::enable_if<(std::is_same< Element, ElementType >::value||std::is_same< Element, GridElementType >::value), const KeyType & >::type key(const Element &element) const
get key currently assigned to an entity
Definition: blockmapper.hh:319

Member Function Documentation

◆ contains()

template<class DofMapperTraits >
bool Dune::Fem::DofMapper< DofMapperTraits >::contains ( const int  codim) const
inlineinherited

returns true if DoFs for given codimension exist

Parameters
[in]codimcodimension to check
Returns
true if DoFs for codimension exist

◆ mapEach()

template<class DofMapperTraits >
template<class Functor >
void Dune::Fem::DofMapper< DofMapperTraits >::mapEach ( const ElementType element,
Functor  f 
) const
inlineinherited

map each local DoF number to a global key

Parameters
[in]elementelement, the DoFs belong to
[in]ffunctor to call for each DoF

The functor has to be a copyable object satisfying the following interface:

struct Functor
{
// application operator
template< class GlobalKey >
void operator() ( const int localDoF, const GlobalKey &globalDoF );
};

For each DoF to be mapped, this method will call the application operator once.

Note
There is no guarantee on the order, in which the functor is applied.
The global key has to be compatible with the Dof storage.

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION.

◆ mapEachEntityDof()

template<class DofMapperTraits >
template<class Entity , class Functor >
void Dune::Fem::DofMapper< DofMapperTraits >::mapEachEntityDof ( const Entity entity,
Functor  f 
) const
inlineinherited

map each local DoF number to a global key

Parameters
[in]entityentity, the DoFs belong to
[in]ffunctor to call for each DoF

The functor has to be a copyable object satisfying the following interface:

struct Functor
{
// application operator
template< class GlobalKey >
void operator() ( const int localDoF, const GlobalKey &globalKey );
};

For each DoF to be mapped, this method will call the application operator once.

Note
There is no guarantee on the order, in which the functor is applied.
The global key has to be compatible with the Dof storage.

References CHECK_AND_CALL_INTERFACE_IMPLEMENTATION.

◆ update()

void Dune::Fem::AdaptiveDofMapper< DiscontinuousGalerkinBlockMapperTraits< GridPart, LocalKeys > >::update ( )
inlineinherited

update DoF mapping after grid modification

Adaptive DoF mappers are considered to be always up to date and this method does nothing.


The documentation for this struct was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 6, 22:30, 2024)