1#ifndef __DUNE_ACFEM_MODELS_MODULES_FORCESFUNCTIONALMODEL_HH__
2#define __DUNE_ACFEM_MODELS_MODULES_FORCESFUNCTIONALMODEL_HH__
4#include "../modelexpressionbase.hh"
39 template<
class LinearFunctional>
41 :
public ModelExpression<ForcesFunctionalModel<LinearFunctional> >
48 typedef LinearFunctional LinearFunctionalType;
49 typedef typename LinearFunctionalType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
53 typename LinearFunctionalType::TraitsType>&
55 const std::string& name =
"")
56 : functional_(functional),
57 name_(
"-" + (name ==
"" ? functional_().name() :
"name"))
60 std::string name()
const
65 template<
class DiscreteFunctionSpace>
66 typename TraitsType::template ForcesFunctionalTraits<DiscreteFunctionSpace>::FunctionalType
67 forcesFunctional(
const DiscreteFunctionSpace& space)
const
69 return *functional_();
74 const std::string name_;
77 template<
class LinearFunctional>
79 :
public DefaultModelTraits<typename LinearFunctional::DiscreteFunctionSpaceType::FunctionSpaceType,
80 typename LinearFunctional::GridPartType>
84 DefaultModelTraits<
typename LinearFunctional::DiscreteFunctionSpaceType::FunctionSpaceType,
85 typename LinearFunctional::GridPartType>
102 template<
class DiscreteFunctionSpace>
103 struct ForcesFunctionalTraits
113 typedef decltype(*std::declval<typename BaseType::FunctionalType>()) FunctionalType;
118 template<
class DiscreteFunctionSpace>
120 :
public ZeroModel<typename DiscreteFunctionSpace::FunctionSpaceType,
121 typename DiscreteFunctionSpace::GridPartType>
124 ZeroModel<
typename DiscreteFunctionSpace::FunctionSpaceType,
125 typename DiscreteFunctionSpace::GridPartType>
128 typedef DiscreteFunctionSpace DiscreteFunctionSpaceType;
133 typename LinearFunctionalType::TraitsType>&
135 const std::string& name =
"")
136 :
BaseType(
"-" + (name ==
"" ?
asImp(functional).name() : name))
Default model implementation.
Definition: modelinterface.hh:330
Interface class for a discrete linear functional.
Definition: linearfunctional.hh:52
Interface class for second order elliptic models.
Definition: modelinterface.hh:192
This is the famous "do-nothing" functional.
Definition: zerofunctional.hh:42
Define a simple zero model to optimize expression templates.
Definition: zeromodel.hh:28
const Implementation & asImp(const Fem::BartonNackmanInterface< Interface, Implementation > &arg)
Up-cast to the implementation for any Fem::BartonNackmanInterface.
Definition: expressionoperations.hh:71
StructureFlags
Definition: forcesfunctionalmodel.hh:88
A structure defining some trivial default values for the template structure ModelTraits<ModelType>,...
Definition: modelinterface.hh:57
Utiliy class to aid in the definition of ModelInterface::ForcesFunctionalTraits.
Definition: modelinterface.hh:551
Wrap an existing DiscreteLinearFunctional into a model which only conatains this ModelConstituent.
Definition: forcesfunctionalmodel.hh:42
Traits-template which has to be specialized for each individual model.
Definition: modelinterface.hh:48