KASKADE 7 development version
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ > Class Template Reference

A local to global mapper implementation for boundary spaces, with functions defined on the domain boundary (or parts of it) only. More...

#include <boundaryspace.hh>

Detailed Description

template<template< class, class > class Implementation_, class Scalar_, class GridView_>
class Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >

A local to global mapper implementation for boundary spaces, with functions defined on the domain boundary (or parts of it) only.

This works by restriction of the shape and ansatz functions. From the regular shapefunctions those are removed which are zero on boundary faces. (For cells which have no boundary intersection all shape functions are removed.) Therefore, those boundary functions can be also seen as FE functions over the entire domain whose support is restricted to a neighbourhood of the boundary.

Unfortunately even continuous boundary functions will be discontinuous if considered as functions over the entire domain. See the following

                         f   2    f
                     1    f     f    3
                           f  f
               bbbbbbbbbbbb * bbbbbbbbbbbbbbbbbb

Since cell 2 touches the boundary only at vertex * all shapefunctions of cell 2 will be removed. Therefore, the ansatz function belonging to node * will be discontinuous (its support will be cell 1 and cell 3).

This means that at the moment boundary functions should not be passed as second argument to interpolateGlobally, since there the function values on vertices are averaged leading to results which are probably unexpected (depending on what you expect). TODO: Fix this. (If you have done you can also slightly simplify writeVTK() and the assignment operator for FunctionSpaceElement.)

Template Parameters
Implementation_Underlying FE mapper (e.g. ContinuousLagrangeMapper or ContinuousHierarchicMapper)
Scalar_Type of scalars.
GridView_Type of the corresponding grid view.

Definition at line 160 of file boundaryspace.hh.

Inheritance diagram for Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >:
Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type, BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >

Classes

struct  Element
 Type of the FunctionSpaceElement, associated to the FEFunctionSpace. More...
 

Public Types

typedef Scalar_ Scalar
 
typedef GridView_ GridView
 
typedef BoundarySpace_Detail::ShapeFunctionSetRestriction< Implementation >::type ShapeFunctionSetImplementation
 
typedef int ConstructorArgument
 
typedef Implementation::Grid Grid
 
using Cell = Kaskade::Cell< Grid >
 
typedef Implementation::ShapeFunctionSet ShapeFunctionSet
 
typedef Implementation::Converter Converter
 
typedef Implementation::Combiner Combiner
 
typedef GridView::IndexSet IndexSet
 
typedef std::pair< size_t, int > IndexPair
 
typedef RangeView< GlobalIndexIterator > GlobalIndexRange
 
typedef RangeView< SortedIndexIterator > SortedIndexRange
 

Public Member Functions

 BoundaryMapper (GridView const &gridView, int order)
 BoundaryMapper: Create a boundary mapper over the entire boundary. More...
 
 BoundaryMapper (GridView const &gridView, int order, std::vector< int > const &boundaryIds_, std::vector< int > const &usedIds_)
 BoundaryMapper: Create a boundary mapper over parts of the boundary. More...
 
template<class T , class Functor >
 BoundaryMapper (GridView const &gridView, int order, std::vector< T > const &boundaryIds_, std::vector< T > const &usedIds_, Functor boundaryIdsToInts)
 
bool inDomain (typename GridView::Intersection const &face) const
 
int numFaces ()
 numFaces: Counts number of faces on which this boundaryMapper is defined. This costs some time so use with care. More...
 
GridView const & gridView () const
 Returns the grid view used. More...
 
int maxOrder () const
 Returns the maximal polynomial order of shape functions encountered in any cell. More...
 
GlobalIndexRange initGlobalIndexRange () const
 Returns an empty range just for initialization purposes, since RangeView is not default constructible. More...
 
GlobalIndexRange globalIndices (Cell const &cell) const
 Returns an immutable sequence containing the global indices of the shape functions associated to this cell. More...
 
GlobalIndexRange globalIndices (size_t n) const
 Returns an immutable sequence containing the global indices of the shape functions associated to this cell. More...
 
SortedIndexRange sortedIndices (Cell const &cell) const
 Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index order. More...
 
SortedIndexRange sortedIndices (size_t n) const
 Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index order. More...
 
size_t size () const
 Returns the number of global degrees of freedom managed. More...
 
ShapeFunctionSet const & shapefunctions (Cell const &cell, bool contained=false) const
 Returns the set of shape functions defined on this cell. More...
 
ShapeFunctionSet const & shapefunctions (size_t n) const
 Returns the set of shape functions defined on this cell. More...
 
ShapeFunctionSetshapefunctions_non_const (Cell const &cell)
 
ShapeFunctionSetshapefunctions_non_const (size_t n)
 
ShapeFunctionSet const & lowerShapeFunctions (Cell const &cell) const
 
Combiner combiner (Cell const &cell, size_t index) const
 Returns a combiner for the given leaf cell. More...
 
std::pair< bool, size_t > unrestrictedToRestrictedIndex (size_t unrestrictedIndex)
 
void update ()
 (Re)computes the internal data. More...
 

Static Public Member Functions

static SortedIndexRange initSortedIndexRange ()
 Returns an empty range just for initialization, since RangeView is not default constructible. More...
 

Static Public Attributes

static int const continuity = 0
 
static constexpr int dim = GridView::dimension
 
static bool const globalSupport
 Whether the ansatz functions have global support (i.e. lead to dense matrices). More...
 

Protected Attributes

BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type implementation
 

Member Typedef Documentation

◆ Cell

using Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::Cell = Kaskade::Cell<Grid>
inherited

Definition at line 208 of file scalarspace.hh.

◆ Combiner

typedef Implementation::Combiner Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::Combiner
inherited

Definition at line 211 of file scalarspace.hh.

◆ ConstructorArgument

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
typedef int Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::ConstructorArgument

Definition at line 172 of file boundaryspace.hh.

◆ Converter

typedef Implementation::Converter Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::Converter
inherited

Definition at line 210 of file scalarspace.hh.

◆ GlobalIndexRange

typedef RangeView<GlobalIndexIterator> Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::GlobalIndexRange
inherited

Definition at line 228 of file scalarspace.hh.

◆ Grid

typedef Implementation::Grid Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::Grid
inherited

Definition at line 207 of file scalarspace.hh.

◆ GridView

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
typedef GridView_ Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::GridView

Definition at line 170 of file boundaryspace.hh.

◆ IndexPair

typedef std::pair<size_t,int> Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::IndexPair
inherited

Definition at line 215 of file scalarspace.hh.

◆ IndexSet

typedef GridView::IndexSet Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::IndexSet
inherited

Definition at line 214 of file scalarspace.hh.

◆ Scalar

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
typedef Scalar_ Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::Scalar

Definition at line 169 of file boundaryspace.hh.

◆ ShapeFunctionSet

typedef Implementation::ShapeFunctionSet Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::ShapeFunctionSet
inherited

Definition at line 209 of file scalarspace.hh.

◆ ShapeFunctionSetImplementation

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
typedef BoundarySpace_Detail::ShapeFunctionSetRestriction<Implementation>::type Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::ShapeFunctionSetImplementation

Definition at line 171 of file boundaryspace.hh.

◆ SortedIndexRange

typedef RangeView<SortedIndexIterator> Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::SortedIndexRange
inherited

Definition at line 229 of file scalarspace.hh.

Constructor & Destructor Documentation

◆ BoundaryMapper()

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
template<class T , class Functor >
Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::BoundaryMapper ( GridView const &  gridView,
int  order,
std::vector< T > const &  boundaryIds_,
std::vector< T > const &  usedIds_,
Functor  boundaryIdsToInts 
)
inline

Definition at line 214 of file boundaryspace.hh.

Member Function Documentation

◆ combiner()

Combiner Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::combiner ( Cell const &  cell,
size_t  index 
) const
inlineinherited

Returns a combiner for the given leaf cell.

Parameters
cellthe grid cell for which the combiner is requested
indexthe index of the cell

Definition at line 370 of file scalarspace.hh.

◆ globalIndices() [1/2]

GlobalIndexRange Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::globalIndices ( Cell const &  cell) const
inlineinherited

Returns an immutable sequence containing the global indices of the shape functions associated to this cell.

Global indices start at 0 and are consecutive - in the range returned here, an unordered subset is contained.

Definition at line 274 of file scalarspace.hh.

◆ globalIndices() [2/2]

GlobalIndexRange Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::globalIndices ( size_t  n) const
inlineinherited

Returns an immutable sequence containing the global indices of the shape functions associated to this cell.

Global indices start at 0 and are consecutive - in the range returned here, an unordered subset is contained.

Definition at line 285 of file scalarspace.hh.

◆ gridView()

GridView const & Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::gridView ( ) const
inlineinherited

Returns the grid view used.

Definition at line 244 of file scalarspace.hh.

◆ inDomain()

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
bool Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::inDomain ( typename GridView::Intersection const &  face) const
inline

Definition at line 220 of file boundaryspace.hh.

Referenced by Kaskade::integrateOverBoundary().

◆ initGlobalIndexRange()

GlobalIndexRange Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::initGlobalIndexRange ( ) const
inlineinherited

Returns an empty range just for initialization purposes, since RangeView is not default constructible.

Definition at line 261 of file scalarspace.hh.

◆ initSortedIndexRange()

static SortedIndexRange Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::initSortedIndexRange ( )
inlinestaticinherited

Returns an empty range just for initialization, since RangeView is not default constructible.

Definition at line 294 of file scalarspace.hh.

◆ lowerShapeFunctions()

ShapeFunctionSet const & Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::lowerShapeFunctions ( Cell const &  cell) const
inlineinherited

Definition at line 357 of file scalarspace.hh.

◆ maxOrder()

int Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::maxOrder ( ) const
inlineinherited

Returns the maximal polynomial order of shape functions encountered in any cell.

Definition at line 252 of file scalarspace.hh.

◆ shapefunctions() [1/2]

ShapeFunctionSet const & Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::shapefunctions ( Cell const &  cell,
bool  contained = false 
) const
inlineinherited

Returns the set of shape functions defined on this cell.

Parameters
cellthe codim 0 entity of the grid for wich the shape functions are to be retrieved
containedif true, the method may assume that the cell is contained in the index set of the space. (The other case occurs during interpolation between different grids).

Definition at line 331 of file scalarspace.hh.

◆ shapefunctions() [2/2]

ShapeFunctionSet const & Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::shapefunctions ( size_t  n) const
inlineinherited

Returns the set of shape functions defined on this cell.

Definition at line 347 of file scalarspace.hh.

◆ shapefunctions_non_const() [1/2]

ShapeFunctionSet & Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::shapefunctions_non_const ( Cell const &  cell)
inlineinherited

Definition at line 339 of file scalarspace.hh.

◆ shapefunctions_non_const() [2/2]

ShapeFunctionSet & Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::shapefunctions_non_const ( size_t  n)
inlineinherited

Definition at line 352 of file scalarspace.hh.

◆ size()

size_t Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::size ( ) const
inlineinherited

Returns the number of global degrees of freedom managed.

Note that this does not correspond directly to the number of coefficients in a FE function (if the FE function has more than one component).

Definition at line 323 of file scalarspace.hh.

◆ sortedIndices() [1/2]

SortedIndexRange Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::sortedIndices ( Cell const &  cell) const
inlineinherited

Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index order.

Definition at line 303 of file scalarspace.hh.

◆ sortedIndices() [2/2]

SortedIndexRange Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::sortedIndices ( size_t  n) const
inlineinherited

Returns an immutable sequence of (global index, local index) pairs sorted in ascending global index order.

Definition at line 311 of file scalarspace.hh.

◆ unrestrictedToRestrictedIndex()

std::pair< bool, size_t > Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::unrestrictedToRestrictedIndex ( size_t  unrestrictedIndex)
inlineinherited

Definition at line 379 of file scalarspace.hh.

◆ update()

void Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::update ( )
inlineinherited

(Re)computes the internal data.

This has to be called after grid modifications and on construction.

Definition at line 389 of file scalarspace.hh.

Member Data Documentation

◆ continuity

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
int const Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::continuity = 0
static

Definition at line 173 of file boundaryspace.hh.

◆ dim

template<template< class, class > class Implementation_, class Scalar_ , class GridView_ >
constexpr int Kaskade::BoundaryMapper< Implementation_, Scalar_, GridView_ >::dim = GridView::dimension
staticconstexpr

Definition at line 174 of file boundaryspace.hh.

◆ globalSupport

bool const Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::globalSupport
staticinherited

Whether the ansatz functions have global support (i.e. lead to dense matrices).

Definition at line 234 of file scalarspace.hh.

◆ implementation

BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type Kaskade::UniformScalarMapper< BoundarySpace_Detail::ChooseMapper< Implementation_< Scalar_, GridView_ > >::type , BoundarySpace_Detail::GetSFDataType< Implementation_< Scalar_, GridView_ > >::type >::implementation
protectedinherited

Definition at line 528 of file scalarspace.hh.


The documentation for this class was generated from the following file: