KASKADE 7 development version
Loading...
Searching...
No Matches
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>

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.
typedef GridView::Grid Grid
 Type of grid.
typedef GridView::IndexSet IndexSet
 Type of IndexSet.
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.
typedef Grid::ctype ctype
 Coordinate Type.
typedef LocalToGlobalMapper Mapper
 corresponding mapper
template<int m>
using Element_t = FunctionSpaceElement<Self,m>
 Defines the element function type.
using SfValueType = typename Evaluator::VarArg::ValueType
 type of shape function values

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.
 FEFunctionSpace (GridManagerBase< Grid > &gridman_, Mapper &&m)
 Constructs a finite element space from a directly given mapper.
 FEFunctionSpace (FEFunctionSpace< LocalToGlobalMapper > const &fs)
 Copy constructor.
 ~FEFunctionSpace ()
LocalToGlobalMapper const & mapper () const
 Provides read access to the node manager.
LocalToGlobalMapper & mapper ()
 Provides read-write access to the node manager.
template<int m>
Element_t< m > element () const
 Creates a new function in this function space.
General discretization information
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.
int order (Cell< GridView > const &cell) const
 Provides the polynomial order of shape functions on the given cell.
int maxOrder () const
 Returns the maximum polynomial order of the shape functions on any cell in the grid.
Underlying grid information
Grid const & grid () const
 Provides access to the grid on which this finite element space is defined.
GridManagerBase< Grid > & gridManager () const
 Access to the GridManager.
IndexSet const & indexSet () const
 Provides access to the index set defining the part of the grid on which the space is defined.
GridView const & gridView () const
 Provides access to the index set defining the potential support of the space.
Evaluation of functions
Evaluator evaluator (ShapeFunctionCache< Grid, Scalar > *cache=nullptr, int deriv=1) const
 Creates a new evaluator for this space.
std::vector< std::pair< size_t, SfValueType > > linearCombination (Evaluator const &evaluator, bool cleaned=false) const
 Returns the coefficients of the linear combination of global DoFs that define the value at the position specified by the given evaluator.
std::vector< std::pair< size_t, SfValueType > > linearCombination (Cell< GridView > const &cell, LocalPosition< GridView > const &xi, bool cleaned=false) const
 Returns the coefficients of the linear combination of global DoFs that define the value at the given position.
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.

Public Attributes

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

Static Public Attributes

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

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 1181 of file functionspace.hh.

Member Typedef Documentation

◆ ctype

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

Coordinate Type.

Definition at line 1203 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 1246 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 1200 of file functionspace.hh.

◆ Grid

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

Type of grid.

Definition at line 1189 of file functionspace.hh.

◆ GridView

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

Type of grid view.

Definition at line 1187 of file functionspace.hh.

◆ IndexSet

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

Type of IndexSet.

Definition at line 1191 of file functionspace.hh.

◆ Mapper

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

corresponding mapper

Definition at line 1206 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 1194 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 1572 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 1592 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.
int order(Cell< GridView > const &cell) const
Provides the polynomial order of shape functions on the given cell.
FEFunctionSpace(GridManagerBase< Grid > &gridMan, GridView const &gridView_, Args... args)
Constructs a finite element space from a GridManager, a grid view, and possibly extra arguments passe...
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 1614 of file functionspace.hh.

◆ FEFunctionSpace() [3/3]

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

Copy constructor.

Definition at line 1626 of file functionspace.hh.

◆ ~FEFunctionSpace()

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

Definition at line 1635 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 1649 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 1718 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 1733 of file functionspace.hh.

◆ 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 1679 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 1685 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 1696 of file functionspace.hh.

Referenced by Kaskade::FEFunctionSpace< DiscontinuousLagrangeMapper< double, Grid > >::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 1691 of file functionspace.hh.

◆ 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,
bool cleaned = false ) 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 1785 of file functionspace.hh.

◆ linearCombination() [2/3]

template<class LocalToGlobalMapper>
std::vector< std::pair< size_t, SfValueType > > Kaskade::FEFunctionSpace< LocalToGlobalMapper >::linearCombination ( Evaluator const & evaluator,
bool cleaned = false ) 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.

Parameters
evaluatorthe evaluator for the current cell and located at the current local position
cleanedif true, terms with (almost) zero coefficient are removed

Definition at line 1750 of file functionspace.hh.

Referenced by Kaskade::FEFunctionSpace< DiscontinuousLagrangeMapper< double, Grid > >::linearCombination(), and Kaskade::FEFunctionSpace< DiscontinuousLagrangeMapper< double, Grid > >::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 1808 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 1710 of file functionspace.hh.

◆ mapper() [2/2]

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

◆ maxOrder()

template<class LocalToGlobalMapper>
int Kaskade::FEFunctionSpace< LocalToGlobalMapper >::maxOrder ( ) const
inline

Returns the maximum polynomial order of the shape functions on any cell in the grid.

Definition at line 1662 of file functionspace.hh.

◆ order()

template<class LocalToGlobalMapper>
int Kaskade::FEFunctionSpace< LocalToGlobalMapper >::order ( Cell< GridView > const & cell) const
inline

Provides the polynomial order of shape functions on the given cell.

Definition at line 1654 of file functionspace.hh.

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 1226 of file functionspace.hh.

◆ dim

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

Grid dimension.

Definition at line 1209 of file functionspace.hh.

◆ dimworld

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

spatial dimension

Definition at line 1212 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 1897 of file functionspace.hh.

◆ sfComponents

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

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