KASKADE 7 development version
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Kaskade::FEFunctionSpace< LocalToGlobalMapper > Class Template Reference

A representation of a finite element function space defined over a domain covered by a grid.
More...

#include <functionspace.hh>

Detailed Description

template<class LocalToGlobalMapper>
class Kaskade::FEFunctionSpace< LocalToGlobalMapper >

A representation of a finite element function space defined over a domain covered by a grid.

Elements of the space are defined in terms of shape functions defined over cells (codim 0 entities) of the grid and a LocalToglobalMapper (also known as node manager) combining local shape function coefficients on different cells to one global degree of freedom. Depending on the LocalToGlobalMapper, the finite element functions may be globally continuous or discontinuous, and may support pointwise evaluation of gradients besides the pointwise evaluation of function values.

The FEFunctionSpace defines an element type (a class that holds a certain function from the space) as well as evaluation cache classes that store global indices of local shape functions and values and possibly derivatives of shape functions at certain integration points.

See also
LocalToGlobalMapperConcept

Definition at line 1116 of file functionspace.hh.

Classes

struct  Element
 DEPRECATED use Element_t<m> instead. More...
 
struct  Evaluator
 A helper class that stores all informations necessary to evaluate FE functions at a certain point. More...
 

Public Types

using GridView = typename LocalToGlobalMapper::GridView
 Type of grid view. More...
 
typedef GridView::Grid Grid
 Type of grid. More...
 
typedef GridView::IndexSet IndexSet
 Type of IndexSet. More...
 
typedef LocalToGlobalMapper::Scalar Scalar
 
using field_type = Scalar
 The scalar field type on which the linear (function) space is based. This is provided for consistency with Dune. More...
 
typedef Grid::ctype ctype
 Coordinate Type. More...
 
typedef LocalToGlobalMapper Mapper
 corresponding mapper More...
 
template<int m>
using Element_t = FunctionSpaceElement< Self, m >
 Defines the element function type. More...
 
using SfValueType = typename Evaluator::VarArg::ValueType
 type of shape function values More...
 

Public Member Functions

template<typename... Args>
 FEFunctionSpace (GridManagerBase< Grid > &gridMan, GridView const &gridView_, Args... args)
 Constructs a finite element space from a GridManager, a grid view, and possibly extra arguments passed to the node manager. More...
 
 FEFunctionSpace (GridManagerBase< Grid > &gridman_, Mapper &&m)
 Constructs a finite element space from a directly given mapper. More...
 
 FEFunctionSpace (FEFunctionSpace< LocalToGlobalMapper > const &fs)
 Copy constructor. More...
 
 ~FEFunctionSpace ()
 
size_t degreesOfFreedom () const
 Returns the dimension of the function space, i.e. the number of degrees of freedom of a one-component function from this space. More...
 
Grid const & grid () const
 Provides access to the grid on which this finite element space is defined. More...
 
GridManagerBase< Grid > & gridManager () const
 Access to the GridManager. More...
 
IndexSet const & indexSet () const
 Provides access to the index set defining the part of the grid on which the space is defined. More...
 
GridView const & gridView () const
 Provides access to the index set defining the potential support of the space. More...
 
LocalToGlobalMapper const & mapper () const
 Provides read access to the node manager. More...
 
LocalToGlobalMapper & mapper ()
 Provides read-write access to the node manager. More...
 
Evaluator evaluator (ShapeFunctionCache< Grid, Scalar > *cache=nullptr, int deriv=1) const
 Creates a new evaluator for this space. More...
 
template<int m>
Element_t< m > element () const
 Creates a new function in this function space. More...
 
std::vector< std::pair< size_t, SfValueType > > linearCombination (Evaluator const &evaluator) const
 Returns the coefficients of the linear combination of global DoFs that define the value at the position specified by the given evaluator. More...
 
std::vector< std::pair< size_t, SfValueType > > linearCombination (Cell< GridView > const &cell, LocalPosition< GridView > const &xi) const
 Returns the coefficients of the linear combination of global DoFs that define the value at the given position. More...
 
std::vector< std::pair< size_t, SfValueType > > linearCombination (GlobalPosition< GridView > const &x) const
 Returns the coefficients of the linear combination of global DoFs that define the value at the given global position. More...
 

Public Attributes

boost::signals2::signal< void(typename TransferData< Self >::TransferMatrix const *) > requestToRefine
 Signal for refinement. More...
 

Static Public Attributes

static int const dim = Grid::dimension
 Grid dimension. More...
 
static int const dimworld = Grid::dimensionworld
 spatial dimension More...
 
static int const sfComponents = Mapper::ShapeFunctionSet::comps
 The number of components of shape functions. More...
 
static int const continuity = Mapper::continuity
 Tells how often elements are globally continuously differentiable. More...
 

Member Typedef Documentation

◆ ctype

template<class LocalToGlobalMapper >
typedef Grid::ctype Kaskade::FEFunctionSpace< LocalToGlobalMapper >::ctype

Coordinate Type.

Definition at line 1138 of file functionspace.hh.

◆ Element_t

template<class LocalToGlobalMapper >
template<int m>
using Kaskade::FEFunctionSpace< LocalToGlobalMapper >::Element_t = FunctionSpaceElement<Self,m>

Defines the element function type.

Template Parameters
mnumber of "components" A "component" is understood as a full shape function value. This can be a multi-component value as well. With vectorial shape functions (e.g. Nedelec edge elements), m==2 means you end up with 2*dim entries of type Scalar in the function's values.

Definition at line 1181 of file functionspace.hh.

◆ field_type

template<class LocalToGlobalMapper >
using Kaskade::FEFunctionSpace< LocalToGlobalMapper >::field_type = Scalar

The scalar field type on which the linear (function) space is based. This is provided for consistency with Dune.

Definition at line 1135 of file functionspace.hh.

◆ Grid

template<class LocalToGlobalMapper >
typedef GridView::Grid Kaskade::FEFunctionSpace< LocalToGlobalMapper >::Grid

Type of grid.

Definition at line 1124 of file functionspace.hh.

◆ GridView

template<class LocalToGlobalMapper >
using Kaskade::FEFunctionSpace< LocalToGlobalMapper >::GridView = typename LocalToGlobalMapper::GridView

Type of grid view.

Definition at line 1122 of file functionspace.hh.

◆ IndexSet

template<class LocalToGlobalMapper >
typedef GridView::IndexSet Kaskade::FEFunctionSpace< LocalToGlobalMapper >::IndexSet

Type of IndexSet.

Definition at line 1126 of file functionspace.hh.

◆ Mapper

template<class LocalToGlobalMapper >
typedef LocalToGlobalMapper Kaskade::FEFunctionSpace< LocalToGlobalMapper >::Mapper

corresponding mapper

Definition at line 1141 of file functionspace.hh.

◆ Scalar

template<class LocalToGlobalMapper >
typedef LocalToGlobalMapper::Scalar Kaskade::FEFunctionSpace< LocalToGlobalMapper >::Scalar

The scalar field type on which the linear (function) space is based.

Definition at line 1129 of file functionspace.hh.

◆ SfValueType

template<class LocalToGlobalMapper >
using Kaskade::FEFunctionSpace< LocalToGlobalMapper >::SfValueType = typename Evaluator::VarArg::ValueType

type of shape function values

Definition at line 1502 of file functionspace.hh.

Constructor & Destructor Documentation

◆ FEFunctionSpace() [1/3]

template<class LocalToGlobalMapper >
template<typename... Args>
Kaskade::FEFunctionSpace< LocalToGlobalMapper >::FEFunctionSpace ( GridManagerBase< Grid > &  gridMan,
GridView const &  gridView_,
Args...  args 
)
inline

Constructs a finite element space from a GridManager, a grid view, and possibly extra arguments passed to the node manager.

Note that the grid has to exist during the whole lifetime of the function space.

The construction from a GridManager, rather than a Grid makes sure, that the FEFunctionSpace is informed about grid modifications, such that data can be transfered from the original grid to the modified grid.

Parameters
argsa parameter pack that is forwarded to the local to global mapper. If LocalToGlobalMapper is a LagrangeMapper or a HierarchicMapper, then the last argument arg denotes the polynomial order of the finite element space.

Definition at line 1522 of file functionspace.hh.

◆ FEFunctionSpace() [2/3]

template<class LocalToGlobalMapper >
Kaskade::FEFunctionSpace< LocalToGlobalMapper >::FEFunctionSpace ( GridManagerBase< Grid > &  gridman_,
Mapper &&  m 
)
inline

Constructs a finite element space from a directly given mapper.

This allows constructing a function space without specifying its complete type, which is inferred from the mapper argument (since C++17).

A degrees of freedom manager for globally continuous FEFunctionSpace s of piecewise polynomials.
A representation of a finite element function space defined over a domain covered by a grid.
GridView const & gridView() const
Provides access to the index set defining the potential support of the space.
Parameters
mthe mapper, which is moved into the function space

Definition at line 1544 of file functionspace.hh.

◆ FEFunctionSpace() [3/3]

template<class LocalToGlobalMapper >
Kaskade::FEFunctionSpace< LocalToGlobalMapper >::FEFunctionSpace ( FEFunctionSpace< LocalToGlobalMapper > const &  fs)
inline

Copy constructor.

Definition at line 1556 of file functionspace.hh.

◆ ~FEFunctionSpace()

template<class LocalToGlobalMapper >
Kaskade::FEFunctionSpace< LocalToGlobalMapper >::~FEFunctionSpace ( )
inline

Definition at line 1565 of file functionspace.hh.

Member Function Documentation

◆ degreesOfFreedom()

template<class LocalToGlobalMapper >
size_t Kaskade::FEFunctionSpace< LocalToGlobalMapper >::degreesOfFreedom ( ) const
inline

Returns the dimension of the function space, i.e. the number of degrees of freedom of a one-component function from this space.

Definition at line 1574 of file functionspace.hh.

Referenced by Kaskade::makeAuxiliarySpaceMultigridStack().

◆ element()

template<class LocalToGlobalMapper >
template<int m>
Element_t< m > Kaskade::FEFunctionSpace< LocalToGlobalMapper >::element ( ) const
inline

Creates a new function in this function space.

Template Parameters
mthe number of components The returned function is initialized to zero.

Definition at line 1621 of file functionspace.hh.

◆ evaluator()

template<class LocalToGlobalMapper >
Evaluator Kaskade::FEFunctionSpace< LocalToGlobalMapper >::evaluator ( ShapeFunctionCache< Grid, Scalar > *  cache = nullptr,
int  deriv = 1 
) const
inline

Creates a new evaluator for this space.

Parameters
cachean (optional) shape function cache to be used
derivnumber of highest requested derivatives

Definition at line 1613 of file functionspace.hh.

Referenced by Kaskade::FEFunctionSpace< LocalToGlobalMapper >::linearCombination().

◆ grid()

template<class LocalToGlobalMapper >
Grid const & Kaskade::FEFunctionSpace< LocalToGlobalMapper >::grid ( ) const
inline

Provides access to the grid on which this finite element space is defined.

Definition at line 1580 of file functionspace.hh.

◆ gridManager()

template<class LocalToGlobalMapper >
GridManagerBase< Grid > & Kaskade::FEFunctionSpace< LocalToGlobalMapper >::gridManager ( ) const
inline

Access to the GridManager.

Todo:
why is this a const function returning a non-const grid manager reference?

Definition at line 1586 of file functionspace.hh.

Referenced by Kaskade::prolongationStack().

◆ gridView()

template<class LocalToGlobalMapper >
GridView const & Kaskade::FEFunctionSpace< LocalToGlobalMapper >::gridView ( ) const
inline

Provides access to the index set defining the potential support of the space.

Definition at line 1596 of file functionspace.hh.

Referenced by Kaskade::FEFunctionSpace< LocalToGlobalMapper >::Evaluator::gridView(), Kaskade::FEFunctionSpace< LocalToGlobalMapper >::linearCombination(), and Kaskade::prolongationStack().

◆ indexSet()

template<class LocalToGlobalMapper >
IndexSet const & Kaskade::FEFunctionSpace< LocalToGlobalMapper >::indexSet ( ) const
inline

Provides access to the index set defining the part of the grid on which the space is defined.

Definition at line 1591 of file functionspace.hh.

Referenced by Kaskade::FEFunctionSpace< LocalToGlobalMapper >::Evaluator::moveTo().

◆ linearCombination() [1/3]

template<class LocalToGlobalMapper >
std::vector< std::pair< size_t, SfValueType > > Kaskade::FEFunctionSpace< LocalToGlobalMapper >::linearCombination ( Cell< GridView > const &  cell,
LocalPosition< GridView > const &  xi 
) const
inline

Returns the coefficients of the linear combination of global DoFs that define the value at the given position.

Let \( u(x) = \sum_j u_j \varphi_j(x) \) and \( J(x) := \{ j\in \mathbf{N} \mid x\in \mathrm{supp} \varphi_j \} \). Then this method returns \( \{ (j,\varphi_j(x)) \mid j \in J(x) \} \). This provides information about which global dof affects the value at a certain position, and how much.

The same information can be extracted more efficiently but with less convenience from an evaluator.

Definition at line 1667 of file functionspace.hh.

◆ linearCombination() [2/3]

template<class LocalToGlobalMapper >
std::vector< std::pair< size_t, SfValueType > > Kaskade::FEFunctionSpace< LocalToGlobalMapper >::linearCombination ( Evaluator const &  evaluator) const
inline

Returns the coefficients of the linear combination of global DoFs that define the value at the position specified by the given evaluator.

Let \( u(x) = \sum_j u_j \varphi_j(x) \) and \( J(x) := \{ j\in \mathbf{N} \mid x\in \mathrm{supp} \varphi_j \} \). Then this method returns \( \{ (j,\varphi_j(x)) \mid j \in J(x) \} \). This provides information about which global dof affects the value at a certain position, and how much.

The same information can be extracted more efficiently but with slightly less convenience directly from the evaluator.

Definition at line 1638 of file functionspace.hh.

Referenced by Kaskade::FEFunctionSpace< LocalToGlobalMapper >::linearCombination().

◆ linearCombination() [3/3]

template<class LocalToGlobalMapper >
std::vector< std::pair< size_t, SfValueType > > Kaskade::FEFunctionSpace< LocalToGlobalMapper >::linearCombination ( GlobalPosition< GridView > const &  x) const
inline

Returns the coefficients of the linear combination of global DoFs that define the value at the given global position.

Let \( u(x) = \sum_j u_j \varphi_j(x) \) and \( J(x) := \{ j\in \mathbf{N} \mid x\in \mathrm{supp} \varphi_j \} \). Then this method returns \( \{ (j,\varphi_j(x)) \mid j \in J(x) \} \). This provides information about which global dof affects the value at a certain position, and how much.

The same information can be extracted much more efficiently but with less convenience from cell and local position.

Definition at line 1689 of file functionspace.hh.

◆ mapper() [1/2]

template<class LocalToGlobalMapper >
LocalToGlobalMapper & Kaskade::FEFunctionSpace< LocalToGlobalMapper >::mapper ( )
inline

Provides read-write access to the node manager.

Definition at line 1606 of file functionspace.hh.

◆ mapper() [2/2]

template<class LocalToGlobalMapper >
LocalToGlobalMapper const & Kaskade::FEFunctionSpace< LocalToGlobalMapper >::mapper ( ) const
inline

Member Data Documentation

◆ continuity

template<class LocalToGlobalMapper >
int const Kaskade::FEFunctionSpace< LocalToGlobalMapper >::continuity = Mapper::continuity
static

Tells how often elements are globally continuously differentiable.

E.g., 0 means a globally continuous, but not differentiable function, -1 means a discontinuous function (with finite values), -2 may contain Dirac functionals etc.

Definition at line 1161 of file functionspace.hh.

◆ dim

template<class LocalToGlobalMapper >
int const Kaskade::FEFunctionSpace< LocalToGlobalMapper >::dim = Grid::dimension
static

Grid dimension.

Definition at line 1144 of file functionspace.hh.

◆ dimworld

template<class LocalToGlobalMapper >
int const Kaskade::FEFunctionSpace< LocalToGlobalMapper >::dimworld = Grid::dimensionworld
static

spatial dimension

Definition at line 1147 of file functionspace.hh.

◆ requestToRefine

template<class LocalToGlobalMapper >
boost::signals2::signal<void (typename TransferData<Self>::TransferMatrix const*) > Kaskade::FEFunctionSpace< LocalToGlobalMapper >::requestToRefine
mutable

Signal for refinement.

This signal is emitted after mesh refinement/coarsening. Clients are informed with a transfer matrix that allows to compute the new FE coefficients from the old ones. This is used by FEFunctions belonging to this space. Clients may start the transfer process asynchonously and return before completion.

If no transfer matrix is given (nullptr), clients are supposed to block until the transfer is finished.

Definition at line 1774 of file functionspace.hh.

◆ sfComponents

template<class LocalToGlobalMapper >
int const Kaskade::FEFunctionSpace< LocalToGlobalMapper >::sfComponents = Mapper::ShapeFunctionSet::comps
static

The number of components of shape functions.

Definition at line 1152 of file functionspace.hh.


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