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

Convenience base class for the easy definition of variational functionals and weak formulations. More...

#include <functional_aux.hh>

Detailed Description

template<ProblemType Type>
class Kaskade::FunctionalBase< Type >

Convenience base class for the easy definition of variational functionals and weak formulations.

Variational functionals and weak formulations need to provide meta information template classes D1 and D2 that give the assembler static information about the block structure of the problem. It is easy to forget parts of these meta data, in particular if they do not affect your current problem (yet they need to be defined for syntactical reasons).

Problem definitions may inherit this convenience base class, which defines safe but maybe inefficient defaults. These can be partially overridden as in the following example.

class Functional: public FunctionalBase<VariationalFunctional> {
...
template <int row, int col>
struct D2: public FunctionalBase<VariationalFunctional>::template D2<row,col> {
static bool symmetric = true;
};
...
};
Convenience base class for the easy definition of variational functionals and weak formulations.
Static a priori default information about the matrix blocks.

\seealso VariationalFunctional

Template Parameters
Typethe kind of variational problem, either VariationalFunctional or WeakFormulation

Definition at line 62 of file functional_aux.hh.

Classes

struct  B2
 
struct  D1
 Static a priori default information about the right hand side blocks. More...
 
struct  D2
 Static a priori default information about the matrix blocks. More...
 

Public Member Functions

template<class T >
bool inDomain (T const &) const
 
template<class Cell >
int integrationOrder (Cell const &, int shapeFunctionOrder, bool) const
 Default implementation specifying the integration order. More...
 
template<class Face >
bool considerFace (Face const &) const
 Default implementation for which faces are to be considered for assembly in case an InnerBoundaryCache is present. More...
 
template<int , int >
double makePositiveThreshold () const
 Defines the eigenvalue threshold when enforcing positivity of local stiffness matrices. More...
 

Static Public Attributes

static constexpr ProblemType type = Type
 

Member Function Documentation

◆ considerFace()

template<ProblemType Type>
template<class Face >
bool Kaskade::FunctionalBase< Type >::considerFace ( Face const &  ) const
inline

Default implementation for which faces are to be considered for assembly in case an InnerBoundaryCache is present.

The default implementation is conservative, i.e. it assumes all faces should be considered. Redefine this in the actual implementation of the variational functional if only some faces need to be assembled.

Returns
true

Definition at line 182 of file functional_aux.hh.

◆ inDomain()

template<ProblemType Type>
template<class T >
bool Kaskade::FunctionalBase< Type >::inDomain ( T const &  ) const
inline

Definition at line 71 of file functional_aux.hh.

◆ integrationOrder()

template<ProblemType Type>
template<class Cell >
int Kaskade::FunctionalBase< Type >::integrationOrder ( Cell const &  ,
int  shapeFunctionOrder,
bool   
) const
inline

Default implementation specifying the integration order.

This is a conservative choice for linear problems, with an integration order of twice the shape function order.

Definition at line 166 of file functional_aux.hh.

◆ makePositiveThreshold()

template<ProblemType Type>
template<int , int >
double Kaskade::FunctionalBase< Type >::makePositiveThreshold ( ) const
inline

Defines the eigenvalue threshold when enforcing positivity of local stiffness matrices.

This default implementation defines this in principle as zero (i.e. aiming at positive semidefiniteness in its usual ldefinition), but accounts for some roundoff error during eigenvalue computation assuming assembly in double precision.

This method needs to be defined if D2<,>::makePositive == true.

Definition at line 197 of file functional_aux.hh.

Member Data Documentation

◆ type

template<ProblemType Type>
constexpr ProblemType Kaskade::FunctionalBase< Type >::type = Type
staticconstexpr

Definition at line 66 of file functional_aux.hh.


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