KASKADE 7 development version
|
A class for storing a heterogeneous collection of FunctionSpaceElement s. More...
#include <variables.hh>
A class for storing a heterogeneous collection of FunctionSpaceElement s.
Descriptions | a VariableSetDescription class |
Basic vector operations and I/O are supported.
The type of a VariableSet is defined via a VariableSetDescription, which contains information about the variables in form of a boost::fusion::vector of FEFunctionSpace s and VariableDescription s. The type of a VariableSet can be determined by VariableSetDescription::VariableSet.
VariableSet s contains a collection of FunctionSpaceElement s (vars) and a reference to its VariableSetDescription (descriptions). Simultaneous evaluation of all functions is supported by evaluateVariables.
Usually, solutions are stored in VariableSets. Access to data is via the public member variable data, which is a boost::fusion::vector of FunctionSpaceElement s
Definition at line 339 of file variables.hh.
Public Types | |
typedef VSDescriptions | Descriptions |
Type of the VariableSetDescription. More... | |
typedef VSDescriptions::RepresentationData | Functions |
boost::fusion::vector of data elements (of type FunctionSpaceElement) More... | |
typedef LinearProductSpace< Scalar, Functions > | LinearSpace |
typedef Scalar | field_type |
typedef VSDescriptions::RepresentationData | Sequence |
boost::fusion::vector of element vectors. More... | |
using | Component = std::remove_reference_t< typename boost::fusion::result_of::at_c< Sequence const, m >::type > |
The type of the m-th component. More... | |
Public Member Functions | |
VariableSet (Self const &vs) | |
Copy constructor. More... | |
VariableSet (Descriptions const &d) | |
Constructor. More... | |
Self & | operator= (Self const &v) |
Assignment. More... | |
template<class S > | |
Self & | operator= (S const &s) |
Assignment from other (compatible) types. More... | |
size_t | dim () const |
Number of scalar degrees of freedom. This computes the total number of degrees of freedom, i.e. the sum of the dimensions of the components. More... | |
Self & | operator+= (LinearProductSpace< Scalar, SequenceY > const &y) |
In place addition. More... | |
Self & | operator-= (Self const &y) |
In place subtraction. More... | |
Self & | axpy (Scalar a, Self const &y) |
this <- this + a*y More... | |
void | read (InIterator i) |
DEPRECATED use vectorFromSequence instead. More... | |
void | read (int rbegin, int rend, InIterator i) |
Reads the coefficients of the subrange [rbegin,rend[ sequentially from an input iterator. The InIterator's value type must be convertible to field_type. More... | |
void | write (OutIterator i) const |
DEPRECATED use vectorToSequence instead. More... | |
void | write (int rbegin, int rend, DataOutIter i) const |
Writes the coefficients of the subrange [rbegin,rend[ sequentially to an output iterator. The InIterator's value type must be convertible to field_type. More... | |
Evaluation of variables | |
template<int i, class Evaluators > | |
auto | value (Evaluators const &evals) const |
Value of an individual variable in the set. More... | |
template<int i> | |
auto | value (Cell< GridView > const &cell, LocalPosition< GridView > const &xi) const |
Value of an individual variable in the set. More... | |
template<int i> | |
auto | value (GlobalPosition< GridView > const &x) const |
Value of an individual variable in the set. More... | |
template<int i, class Evaluators > | |
auto | derivative (Evaluators const &evals) const |
Derivative of an individual variable in the set. More... | |
template<int i> | |
auto | derivative (Cell< GridView > const &cell, LocalPosition< GridView > const &xi) const |
Derivative of an individual variable in the set. More... | |
template<int i> | |
auto | derivative (GlobalPosition< GridView > const &x) const |
derivative of an individual variable in the set. \WARNING This method is comparatively DEAD SLOW. More... | |
template<int i, class Evaluators > | |
auto | hessian (Evaluators const &evals) const |
Hessian of an individual variable in the set. More... | |
template<int i> | |
auto | hessian (Cell< GridView > const &cell, LocalPosition< GridView > const &xi) const |
Hessian of an individual variable in the set. More... | |
template<int i> | |
auto | hessian (GlobalPosition< GridView > const &x) const |
Hessian of an individual variable in the set. \WARNING This method is comparatively DEAD SLOW. More... | |
Assignment | |
Self & | operator*= (Scalar a) |
Scaling. More... | |
Scalar products and norms | |
field_type | operator* (Self const &y) const |
Scalar product. More... | |
field_type | dot (Self const &y) const |
Scalar product. More... | |
double | two_norm2 () const |
squared euclidean norm More... | |
double | two_norm () const |
euclidean norm More... | |
Public Attributes | |
Descriptions const & | descriptions |
Descriptions of variable set, of type VariableSetDescription (lots of useful infos) More... | |
Sequence | data |
Data. More... | |
Related Functions | |
(Note that these are not member functions.) | |
auto const & | component (LinearProductSpace< Scalar, Sequence > const &x) |
Provides access to the m-th component of a product space. More... | |
auto | cartesianProduct (X0 const &x0, Xs const &... xs) |
Creates a cartesian product of the given vectors, i.e. a LinearProductSpace object. More... | |
OutIter | vectorToSequence (LinearProductSpace< Scalar, VSDescriptions::RepresentationData > const &v, OutIter i) |
writes the coefficients of a vector to a flat scalar sequence <Scalar,Seq> More... | |
InIter | vectorFromSequence (LinearProductSpace< Scalar, VSDescriptions::RepresentationData > &v, InIter i) |
reads the coefficients of a vector from a flat scalar sequence <Scalar,Seq> More... | |
|
inherited |
The type of the m-th component.
Definition at line 104 of file linearspace.hh.
typedef VSDescriptions Kaskade::VariableSet< VSDescriptions >::Descriptions |
Type of the VariableSetDescription.
Definition at line 344 of file variables.hh.
|
inherited |
Definition at line 94 of file linearspace.hh.
typedef VSDescriptions::RepresentationData Kaskade::VariableSet< VSDescriptions >::Functions |
boost::fusion::vector of data elements (of type FunctionSpaceElement)
Definition at line 347 of file variables.hh.
typedef LinearProductSpace<Scalar,Functions> Kaskade::VariableSet< VSDescriptions >::LinearSpace |
Definition at line 359 of file variables.hh.
|
inherited |
boost::fusion::vector of element vectors.
Definition at line 97 of file linearspace.hh.
|
inline |
Copy constructor.
Definition at line 362 of file variables.hh.
Referenced by Kaskade::BWErrorIndicator(), Kaskade::Giant< Grid, Equation, VariableSet, Spaces >::giantGbit(), and Kaskade::NleqSolver< Grid, Equation, VariableSet, Spaces >::nleqErr().
|
inlineexplicit |
Constructor.
This creates a zero-initialized set of variables.
d | the VariableSetDescription object (has to exist during the lifetime of this VariableSet). |
Definition at line 372 of file variables.hh.
|
inlineinherited |
this <- this + a*y
Definition at line 233 of file linearspace.hh.
|
inline |
Derivative of an individual variable in the set.
Definition at line 463 of file variables.hh.
|
inline |
Derivative of an individual variable in the set.
Definition at line 453 of file variables.hh.
|
inline |
derivative of an individual variable in the set. \WARNING This method is comparatively DEAD SLOW.
Definition at line 473 of file variables.hh.
|
inlineinherited |
Number of scalar degrees of freedom. This computes the total number of degrees of freedom, i.e. the sum of the dimensions of the components.
Definition at line 154 of file linearspace.hh.
|
inlineinherited |
Scalar product.
Definition at line 302 of file linearspace.hh.
|
inline |
Hessian of an individual variable in the set.
Definition at line 492 of file variables.hh.
|
inline |
Hessian of an individual variable in the set.
Definition at line 482 of file variables.hh.
|
inline |
Hessian of an individual variable in the set. \WARNING This method is comparatively DEAD SLOW.
Definition at line 502 of file variables.hh.
|
inlineinherited |
Scalar product.
For two vectors \( (x_i)_{i=0,\dots,n-1} \) and \( (y_i)_{i=0,\dots,n-1}\) this computes and returns the euclidean scalar product
\[ \sum_{i=0}^{n-1} \langle x_i , y_i \rangle. \]
For the entries' scalar products, the operator*() is called.
Definition at line 292 of file linearspace.hh.
|
inlineinherited |
Definition at line 213 of file linearspace.hh.
|
inlineinherited |
In place addition.
Definition at line 221 of file linearspace.hh.
|
inlineinherited |
In place subtraction.
Definition at line 227 of file linearspace.hh.
|
inline |
Assignment from other (compatible) types.
Compatible types are those for which the base class LinearProductSpace<...> has a matching assignment operator. This includes, in particular, the coefficient vector representation Descriptions::CoefficientVectorRepresentation::type, i.e. a LinearProductSpace<Scalar,DuneBlockVector<...>> with matching entries and lengths.
Definition at line 399 of file variables.hh.
|
inline |
Assignment.
Definition at line 383 of file variables.hh.
|
inlineinherited |
DEPRECATED use vectorFromSequence instead.
Reads the coefficients sequentially from an input iterator. The InIterator's value type must be convertible to field_type.
Definition at line 245 of file linearspace.hh.
|
inlineinherited |
Reads the coefficients of the subrange [rbegin,rend[ sequentially from an input iterator. The InIterator's value type must be convertible to field_type.
Definition at line 255 of file linearspace.hh.
|
inlineinherited |
euclidean norm
Definition at line 318 of file linearspace.hh.
|
inlineinherited |
squared euclidean norm
Definition at line 310 of file linearspace.hh.
|
inline |
Value of an individual variable in the set.
i | the index of the variable to evaluate |
cell | the cell in which to evaluate the variable |
xi | the local coordinate within the cell at which to evaluate |
Definition at line 432 of file variables.hh.
|
inline |
Value of an individual variable in the set.
i | the index of the variable to evaluate |
Evaluators | a boost::fusion sequence of evaluators, corresponding to the list of spaces of this variable set |
Definition at line 417 of file variables.hh.
|
inline |
Value of an individual variable in the set.
i | the index of the variable to evaluate |
x | the global coordinate within the geometry at which to evaluate \WARNING This method is comparatively DEAD SLOW. |
Definition at line 444 of file variables.hh.
|
inlineinherited |
Writes the coefficients of the subrange [rbegin,rend[ sequentially to an output iterator. The InIterator's value type must be convertible to field_type.
Definition at line 274 of file linearspace.hh.
|
inlineinherited |
DEPRECATED use vectorToSequence instead.
Writes the coefficients sequentially to an output iterator (flattening). The field_type must be convertible to the OutIterator's value type.
Definition at line 264 of file linearspace.hh.
|
related |
Creates a cartesian product of the given vectors, i.e. a LinearProductSpace object.
Definition at line 478 of file linearspace.hh.
|
related |
Provides access to the m-th component of a product space.
This simplifies the access to individual components of a product space, e.g., a variable set of finite element functions. Instead of
one can write
m | the index of the component (nonnegative) |
Scalar | a scalar type |
Sequence | a boost::fusion sequence type |
Definition at line 457 of file linearspace.hh.
|
related |
reads the coefficients of a vector from a flat scalar sequence <Scalar,Seq>
Definition at line 505 of file linearspace.hh.
|
related |
writes the coefficients of a vector to a flat scalar sequence <Scalar,Seq>
Definition at line 493 of file linearspace.hh.
|
inherited |
Data.
Definition at line 328 of file linearspace.hh.
Descriptions const& Kaskade::VariableSet< VSDescriptions >::descriptions |
Descriptions of variable set, of type VariableSetDescription (lots of useful infos)
Definition at line 510 of file variables.hh.
Referenced by Kaskade::BWErrorFunction< Description, Grid, Functional, FunctionalSimpl >::getErrorFunction(), Kaskade::BWErrorFunction< Description, Grid, Functional, FunctionalSimpl >::getFullErrorFunction(), Kaskade::Bridge::VectorTraits< VariableSet< Descr > >::getRole(), Kaskade::gridIterate(), Kaskade::projectHierarchically(), Kaskade::Bridge::VectorTraits< VariableSet< Descr > >::read(), Kaskade::uniformEmbeddedErrorEstimation(), Kaskade::Bridge::VectorTraits< VariableSet< Descr > >::write(), Kaskade::writeAMIRAFile(), Kaskade::writePartialFile(), Kaskade::Bridge::VectorTraits< VariableSet< Descr > >::writeToFile(), and Kaskade::writeVTK().