KASKADE 7 development version
|
Classes to define groups of variables. More...
Classes | |
struct | Kaskade::VariableDescription< spaceId, components, Id > |
A class storing elementary information about a single variable.This includes the number of components, the id and name of the variable, and the index of the associated FEFunctionSpace from which the variable comes. More... | |
struct | Kaskade::Variable< A, B, C > |
A class defining elementary information about a single variable. More... | |
class | Kaskade::VariableSet< VSDescriptions > |
A class for storing a heterogeneous collection of FunctionSpaceElement s. More... | |
class | Kaskade::VariableSetDescription< SpaceList, VariableList > |
A class that stores information about a set of variables. More... | |
Typedefs | |
template<class VariableSet , class Method > | |
using | EvaluateVariables = decltype(evaluateVariables(std::declval< VariableSet >(), std::declval< typename VariableSet::Descriptions::Evaluators >(), std::declval< Method >())) |
The type of evaluated variables as returned by evaluateVariables. More... | |
using | Kaskade::ValueMethod = decltype(valueMethod) |
The type of the valueMethod helper functor. More... | |
using | Kaskade::DerivativeMethod = decltype(derivativeMethod) |
The type of the derivativeMethod helper functor. More... | |
Functions | |
template<class Variables , class Functions , class Evaluators , class Method > | |
auto | Kaskade::evaluateFunctions (Functions const &fs, Evaluators const &eval, Method const &method=Method()) |
A function evaulating all functions in a variable set using the provided method. More... | |
template<class VariableSet , class Method > | |
auto | Kaskade::evaluateVariables (VariableSet const &vars, typename VariableSet::Descriptions::Evaluators const &eval, Method const &method=Method()) |
A function evaulating all functions in a variable set using the provided method. More... | |
template<class ... Spaces> | |
auto | makeSpaceList (Spaces *... spaces) |
Creates a list of finite element spaces in the required format. Usage example (for Stokes flow): More... | |
template<class SpaceList , class VariableList > | |
VariableSetDescription< SpaceList, VariableList > | makeVariableSetDescription (SpaceList const &spaces, VariableList const &vars) |
Creates a variable set description from given spaces and variables. More... | |
Variables | |
template<class VarSetDesc , int varIdx> | |
constexpr int | spaceIndex = VarSetDesc::template spaceIndex<varIdx> |
The index of the finite element space of the variable with given index within the list of spaces. More... | |
constexpr auto | valueMethod = [](auto const& f, auto const& eval) { return f.value(eval); } |
Helper method for evaluating whole variable sets. More... | |
constexpr auto | derivativeMethod = [](auto const& f, auto const& eval) { return f.derivative(eval); } |
Helper method for evaluating whole variable sets. More... | |
Classes to define groups of variables.
In a PDE system, several variables occur. In the Stokes equation, e.g., velocity and pressure. In optimal control, it is the state \( y \), the control \( u \) , and one or more multipliers, e.g., \( \lambda \). These variables can live in different spaces, or in the same. In optimal control of elliptic equations, it is usually \( y,\lambda \in H^1(\Omega) \) and \( u \in L^2(\Omega)\).
For setting up the PDE problem, we need to define which variables occur, and in which space each lives. First we define the spaces that are involved:
Next we define the variables that occur, and tell which space they live in by indexing into the space list. Additionally, the number of components are required, and a name can be given:
As a treat, you don't have to remember whether SpaceIndex or Components comes first - they can be switched.
And finally, both are tied together:
This variable set description tells the assembler how to treat the problem, and usually tells the problem definition the finite element spaces in which the variables live.
At some point usually one needs the index or type of the space to which a variable in a variable set belongs. This is provided by spaceIndex and Space, respectively:
In domain and boundary caches, all or some of the variables need to be evaluated from a sequence of evaluators, usually in the evaluateA method. This is provided by the value and derivative methods of the variable set:
using Kaskade::DerivativeMethod = typedef decltype(derivativeMethod) |
The type of the derivativeMethod helper functor.
Definition at line 1039 of file variables.hh.
using EvaluateVariables = decltype(evaluateVariables(std::declval<VariableSet>(), std::declval<typename VariableSet::Descriptions::Evaluators>(), std::declval<Method>())) |
The type of evaluated variables as returned by evaluateVariables.
This is a boost::fusion sequence of functions' values resulting from evaluating all functions in a given variable set.
VariableSet | the type of the variable set (i.e. VariableSet<...>) |
Method | a polymorphic Functor type with call operator (Function const&, Evaluator const&) used for evaluating. |
Definition at line 1006 of file variables.hh.
using Kaskade::ValueMethod = typedef decltype(valueMethod) |
The type of the valueMethod helper functor.
Definition at line 1033 of file variables.hh.
auto Kaskade::evaluateFunctions | ( | Functions const & | fs, |
Evaluators const & | eval, | ||
Method const & | method = Method() |
||
) |
A function evaulating all functions in a variable set using the provided method.
Variables | a heterogeneous sequence of variable descriptions (defines the mapping of functions to evaluators) |
Functions | a heterogeneous sequence of FE functions (or function views) |
Evaluators | the heterogeneous container of evaluators for the variable set |
Method | a polymorphic Functor type with call operator (Function const&, Evaluator const&) |
fs | the functions to be evaluated. |
eval | the evaluators to be used for function evaluation |
method | the functor performing the actual evaluation |
evaluateVariables valueMethod ValueMethod derivativeMethod DerivativeMethod
Definition at line 948 of file variables.hh.
auto Kaskade::evaluateVariables | ( | VariableSet const & | vars, |
typename VariableSet::Descriptions::Evaluators const & | eval, | ||
Method const & | method = Method() |
||
) |
A function evaulating all functions in a variable set using the provided method.
VariableSet | the type of the variable set to be evaluated (i.e. VariableSet<...>) |
Method | a polymorphic Functor type with call operator (Function const&, Evaluator const&) |
vars | the variable set to be evaluated. |
eval | a heterogeneous sequence of evaluators to be used for function evaluation |
method | the functor performing the actual evaluation (usually valueMethod or derivativeMethod) |
Definition at line 988 of file variables.hh.
Referenced by Kaskade::SemiImplicitEulerStep< PE >::DomainCache::evaluateAt().
|
related |
Creates a list of finite element spaces in the required format. Usage example (for Stokes flow):
This creates a boost::fusion vector of pointers to const spaces, as expected by VariableSetDescription.
Definition at line 892 of file variables.hh.
|
related |
Creates a variable set description from given spaces and variables.
spaces | a boost::fusion vector of pointers to the (const) spaces referenced by the variables |
vars | a boost::fusion sequence of Variable objects describing the variables in the set |
Definition at line 911 of file variables.hh.
|
constexpr |
Helper method for evaluating whole variable sets.
Use this in calling evaluateVariables when evaluating the functions' derivatives.
Definition at line 1027 of file variables.hh.
|
related |
The index of the finite element space of the variable with given index within the list of spaces.
Definition at line 874 of file variables.hh.
|
constexpr |
Helper method for evaluating whole variable sets.
Use this in calling evaluateVariables when evaluating the functions' values.
Definition at line 1018 of file variables.hh.
Referenced by Kaskade::SemiImplicitEulerStep< PE >::DomainCache::evaluateAt(), and Kaskade::GridIterateDetail::gridIterateRange().