KASKADE 7 development version
|
A class that stores information about a set of variables. More...
#include <variables.hh>
A class that stores information about a set of variables.
PDE systems usually involve a set of variables \( u_1, \dots, u_n \), e.g., velocity and pressure in the Stokes equation. This class describes the properties of such variable sets and provides meta information such as types of variable sets, their function spaces, or their dimension, as well as convenience methods for constructing variable sets or coefficient vector sets.
SpaceList | a boost::fusion container of FEFunctionSpace s |
VariableList | a boost::fusion container of VariableDescription s. Note that the variable ids will be ignored and ids according to the position of the variable in the vector will be used instead. |
Definition at line 536 of file variables.hh.
Classes | |
class | CoefficientVectorRepresentation |
Typedefs for coefficient vector representations of contiguous subranges of the variables. More... | |
struct | Components |
DEPRECATED, use components instead. More... | |
struct | SpaceIndex |
DEPRECATED, use spaceIndex instead. More... | |
Public Types | |
typedef SpaceList | Spaces |
type of boost::fusion::vector of FEFunctionSpace s needed More... | |
using | Variables = typename Variables_Detail::ImplicitIdVariableDescriptions< VariableList >::type |
type of boost::fusion vector of VariableDescription s More... | |
typedef Variables_Detail::VariableRangeCreator< Variables, ConstructElement< Spaces > >::type | RepresentationData |
Type that contains a set of variables inside a boost vector, together with all the data. More... | |
typedef Kaskade::VariableSet< VariableSetDescription< Spaces, VariableList > > | VariableSet |
Type that contains a set of variable values with some functionality, such as simple vector arithmetic and so on (cf. class VariableSet) More... | |
typedef SpaceType< Spaces, 0 >::type::Scalar | Scalar |
scalar field type More... | |
typedef SpaceType< Spaces, 0 >::type::Grid | Grid |
Grid type. More... | |
typedef SpaceType< Spaces, 0 >::type::GridView | GridView |
Grid view type. More... | |
typedef SpaceType< Spaces, 0 >::type::IndexSet | IndexSet |
IndexSet type. More... | |
typedef boost::fusion::result_of::as_vector< typenameboost::fusion::result_of::transform< Spaces, GetEvaluators< ShapeFunctionCache< Grid, Scalar > > >::type >::type | Evaluators |
The boost::fusion sequence of evaluators belonging to this variable set. More... | |
template<int idx> | |
using | Space = std::remove_pointer_t< typename boost::fusion::result_of::value_at_c< Spaces, SpaceIndex< idx >::spaceIndex >::type > |
The type of finite element space of the i-th variable. More... | |
Public Member Functions | |
GridManagerBase< Grid > const & | gridManager () const |
The gridManager keeping the grid on which we operate. More... | |
Constructors | |
template<class RAIter > | |
VariableSetDescription (Spaces const &spaces_, RAIter nameIt) | |
Constructor, giving each variable a name (e.g. for output purposes) More... | |
VariableSetDescription (Spaces const &spaces_, std::vector< std::string > names_) | |
Constructor. More... | |
template<class RAIter > | |
VariableSetDescription (Spaces const &spaces_, RAIter nameIt, RAIter roleIt) | |
Constructor specifying for each variable both a name and a role. More... | |
VariableSetDescription (Spaces const &spaces_, std::vector< std::string > names_, std::vector< std::string > roles_) | |
Constructor specifying for each variable both a name and a role. More... | |
VariableSetDescription (Spaces const &spaces_) | |
Constructor without naming the variables. More... | |
Public Attributes | |
Spaces | spaces |
A heterogeneous sequence of pointers to (const) spaces involved. More... | |
GridView const & | gridView |
The grid view on which the variables live. More... | |
IndexSet const & | indexSet |
index set More... | |
std::array< std::string, noOfVariables > | names |
A sequence of variable names. More... | |
std::array< std::string, noOfVariables > | roles |
Static Public Attributes | |
static int const | noOfVariables = boost::fusion::result_of::size<Variables>::type::value |
Number of variables in this set. More... | |
static int const | continuity = Variables_Detail::Continuity<Variables,Spaces>::value |
minimal continuity of any variable in the set More... | |
template<int idx> | |
static constexpr int | spaceIndex = boost::fusion::result_of::value_at_c<Variables,idx>::type::spaceIndex |
space index of the i'th variable More... | |
Related Functions | |
(Note that these are not member functions.) | |
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... | |
Creation of variable sets and coefficient vectors | |
template<int first = 0, int last = noOfVariables> | |
using | CoefficientVector = typename CoefficientVectorRepresentation< first, last >::type |
The type of coefficient vectors of variable sets (and subsets). More... | |
template<int first = 0, int last = noOfVariables> | |
auto | zeroCoefficientVector () const |
Returns a zero initialized coefficient vector for variables [first,last[. More... | |
VariableSet | variableSet () const |
Returns a zero-initialized variable set. More... | |
Size and Dimension queries | |
template<int i> | |
static constexpr int | components = boost::fusion::result_of::value_at_c<Variables,i>::type::m |
number of components of i'th variable More... | |
size_t | degreesOfFreedom (int first=0, int last=noOfVariables) const |
Computes the total number of scalar degrees of freedom collected in the variables [first,last). More... | |
static size_t | degreesOfFreedom (Spaces const &spaces, int first, int last) |
Computes the total number of scalar degrees of freedom collected in the variables [first,last). More... | |
static std::array< size_t, noOfVariables > | variableDimensions (Spaces const &spaces, int first=0, int last=noOfVariables) |
Computes for each variable the number of scalar degrees of freedom. More... | |
using Kaskade::VariableSetDescription< SpaceList, VariableList >::CoefficientVector = typename CoefficientVectorRepresentation<first,last>::type |
The type of coefficient vectors of variable sets (and subsets).
This is a LinearProductSpace of Dune::BlockVector, with appropriate entry dimension.
first | index of first variable in the set (default: 0) |
last | one behind index of last variable in the set (default: number of variables) |
Definition at line 780 of file variables.hh.
typedef boost::fusion::result_of::as_vector<typenameboost::fusion::result_of::transform<Spaces,GetEvaluators<ShapeFunctionCache<Grid,Scalar>>>::type>::type Kaskade::VariableSetDescription< SpaceList, VariableList >::Evaluators |
The boost::fusion sequence of evaluators belonging to this variable set.
Definition at line 593 of file variables.hh.
typedef SpaceType<Spaces,0>::type::Grid Kaskade::VariableSetDescription< SpaceList, VariableList >::Grid |
Grid type.
Definition at line 571 of file variables.hh.
typedef SpaceType<Spaces,0>::type::GridView Kaskade::VariableSetDescription< SpaceList, VariableList >::GridView |
Grid view type.
Definition at line 573 of file variables.hh.
typedef SpaceType<Spaces,0>::type::IndexSet Kaskade::VariableSetDescription< SpaceList, VariableList >::IndexSet |
IndexSet type.
Definition at line 575 of file variables.hh.
typedef Variables_Detail::VariableRangeCreator<Variables,ConstructElement<Spaces>>::type Kaskade::VariableSetDescription< SpaceList, VariableList >::RepresentationData |
Type that contains a set of variables inside a boost vector, together with all the data.
This is a boost::fusion::vector with Dune::BlockVector entries.
Definition at line 550 of file variables.hh.
typedef SpaceType<Spaces,0>::type::Scalar Kaskade::VariableSetDescription< SpaceList, VariableList >::Scalar |
scalar field type
Definition at line 569 of file variables.hh.
using Kaskade::VariableSetDescription< SpaceList, VariableList >::Space = std::remove_pointer_t<typename boost::fusion::result_of::value_at_c<Spaces,SpaceIndex<idx>::spaceIndex>::type> |
The type of finite element space of the i-th variable.
Definition at line 727 of file variables.hh.
typedef SpaceList Kaskade::VariableSetDescription< SpaceList, VariableList >::Spaces |
type of boost::fusion::vector of FEFunctionSpace s needed
Definition at line 540 of file variables.hh.
using Kaskade::VariableSetDescription< SpaceList, VariableList >::Variables = typename Variables_Detail::ImplicitIdVariableDescriptions<VariableList>::type |
type of boost::fusion vector of VariableDescription s
Definition at line 543 of file variables.hh.
typedef Kaskade::VariableSet<VariableSetDescription<Spaces,VariableList> > Kaskade::VariableSetDescription< SpaceList, VariableList >::VariableSet |
Type that contains a set of variable values with some functionality, such as simple vector arithmetic and so on (cf. class VariableSet)
Construct an object r of this type from a given VariableSetDescription vsd by:
or by
Definition at line 566 of file variables.hh.
|
inline |
Constructor, giving each variable a name (e.g. for output purposes)
Definition at line 602 of file variables.hh.
|
inline |
Constructor.
spaces | a heterogeneous sequence of pointers to the (const) involved spaces. This is copied internally and need not persist. |
names | contains a name for each variable. |
Definition at line 614 of file variables.hh.
|
inline |
Constructor specifying for each variable both a name and a role.
Definition at line 625 of file variables.hh.
|
inline |
Constructor specifying for each variable both a name and a role.
Definition at line 634 of file variables.hh.
|
inline |
Constructor without naming the variables.
Definition at line 641 of file variables.hh.
|
inline |
Computes the total number of scalar degrees of freedom collected in the variables [first,last).
For each affected variable, the number of components is multiplied with the degrees of freedom of its FE space.
Definition at line 661 of file variables.hh.
Referenced by Kaskade::VariableSetDescription< SpaceList, VariableList >::degreesOfFreedom(), Kaskade::HigherOrderRecovery< Grid, Space >::getErrorFunction(), and Kaskade::Limex< Eq >::step().
|
inlinestatic |
Computes the total number of scalar degrees of freedom collected in the variables [first,last).
For each affected variable, the number of components is multiplied with the degrees of freedom of its FE space.
Definition at line 671 of file variables.hh.
|
inline |
The gridManager keeping the grid on which we operate.
Definition at line 817 of file variables.hh.
|
inlinestatic |
Computes for each variable the number of scalar degrees of freedom.
Definition at line 681 of file variables.hh.
Referenced by Kaskade::VariableSetDescription< SpaceList, VariableList >::degreesOfFreedom().
|
inline |
Returns a zero-initialized variable set.
Definition at line 795 of file variables.hh.
|
inline |
Returns a zero initialized coefficient vector for variables [first,last[.
Definition at line 786 of file variables.hh.
|
staticconstexpr |
number of components of i'th variable
Definition at line 692 of file variables.hh.
|
static |
minimal continuity of any variable in the set
This is the number of how often all the functions are continuously differentiable. 0 means globally continuous with discontinuous derivatives. -1 denotes bounded but discontinuous functions.
Definition at line 586 of file variables.hh.
GridView const& Kaskade::VariableSetDescription< SpaceList, VariableList >::gridView |
The grid view on which the variables live.
Definition at line 812 of file variables.hh.
Referenced by Kaskade::EmbeddedErrorEstimator< VariableSetDescription, Scaling >::estimate(), and Kaskade::MartinsErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSystemSolver_H, LinearSystemSolver_L, LinearSolverA_H, LinearSolverA_L, RefinementStrategy >::operator()().
IndexSet const& Kaskade::VariableSetDescription< SpaceList, VariableList >::indexSet |
index set
Definition at line 820 of file variables.hh.
Referenced by Kaskade::coarsening(), and Kaskade::EmbeddedErrorEstimator< VariableSetDescription, Scaling >::estimate().
std::array<std::string,noOfVariables> Kaskade::VariableSetDescription< SpaceList, VariableList >::names |
A sequence of variable names.
Definition at line 825 of file variables.hh.
Referenced by Kaskade::VariableSetDescription< SpaceList, VariableList >::VariableSetDescription().
|
static |
Number of variables in this set.
Definition at line 578 of file variables.hh.
Referenced by Kaskade::coarsening(), Kaskade::EmbeddedErrorEstimator< VariableSetDescription, Scaling >::estimate(), and Kaskade::VariableSetDescription< SpaceList, VariableList >::VariableSetDescription().
std::array<std::string,noOfVariables> Kaskade::VariableSetDescription< SpaceList, VariableList >::roles |
Definition at line 827 of file variables.hh.
Referenced by Kaskade::VariableSetDescription< SpaceList, VariableList >::VariableSetDescription().
|
staticconstexpr |
space index of the i'th variable
For querying the space index of variables, a more convenient method is to use the global spaceIndex templated value:
idx | the variable index |
Definition at line 714 of file variables.hh.
Spaces Kaskade::VariableSetDescription< SpaceList, VariableList >::spaces |
A heterogeneous sequence of pointers to (const) spaces involved.
Definition at line 807 of file variables.hh.
Referenced by Kaskade::AnotherHBErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSolverLA, LinearSolverHA, LinearSolverHU, LinearSolverLU, RefinementStrategy, lump >::AnotherHBErrorEstimator(), Kaskade::coarsening(), Kaskade::VariableSetDescription< SpaceList, VariableList >::degreesOfFreedom(), Kaskade::EmbeddedErrorEstimator< VariableSetDescription, Scaling >::estimate(), Kaskade::VariableSetDescription< SpaceList, VariableList >::gridManager(), Kaskade::VariableSetDescription< SpaceList, VariableList >::CoefficientVectorRepresentation< first, last >::init(), Kaskade::MartinsErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSystemSolver_H, LinearSystemSolver_L, LinearSolverA_H, LinearSolverA_L, RefinementStrategy >::MartinsErrorEstimator(), Kaskade::Limex< Eq >::step(), Kaskade::StupidHBErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, LinearSolverHA, RefinementStrategy >::StupidHBErrorEstimator(), Kaskade::VariableSetDescription< SpaceList, VariableList >::variableDimensions(), Kaskade::YetAnotherHBErrorEstimator< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, RefinementStrategy, lump, components, ReferenceSolution, ReferenceOperator >::YetAnotherHBErrorEstimator(), Kaskade::YetAnotherHBErrorEstimator_Elasticity< Functional, VariableSetDescription, ExtensionVariableSetDescription, ExtensionSpace, NormFunctional, RefinementStrategy, lump, components >::YetAnotherHBErrorEstimator_Elasticity(), and Kaskade::VariableSetDescription< SpaceList, VariableList >::zeroCoefficientVector().