1#ifndef __DUNE_ACFEM_MODELS_MODULES_BULKFORCESMODEL_HH__
2#define __DUNE_ACFEM_MODELS_MODULES_BULKFORCESMODEL_HH__
4#include "../modelexpressionbase.hh"
5#include "../zeromodel.hh"
39 template<
class Gr
idFunction>
41 :
public ModelExpression<BulkForcesFunctionModel<GridFunction> >
48 typedef GridFunction BulkForcesFunctionImpType;
49 typedef typename TraitsType::BulkForcesFunctionType BulkForcesFunctionType;
50 typedef typename BulkForcesFunctionImpType::FunctionSpaceType FunctionSpaceType;
51 typedef typename BulkForcesFunctionImpType::GridPartType GridPartType;
54 const std::string& name =
"")
55 : function_(function),
56 name_(name ==
"" ?
"- (" + function_().name() +
", . )" : name)
59 std::string name()
const
64 BulkForcesFunctionType bulkForcesFunction(
const GridPartType& gridPart)
const
71 const std::string name_;
74 template<
class Gr
idFunction>
76 :
public DefaultModelTraits<typename GridFunction::DiscreteFunctionSpaceType::FunctionSpaceType,
77 typename GridFunction::GridPartType>
81 DefaultModelTraits<
typename GridFunction::DiscreteFunctionSpaceType::FunctionSpaceType,
82 typename GridFunction::GridPartType>
91 typedef decltype(*std::declval<GridFunction>()) BulkForcesFunctionType;
95 template<
class FunctionSpace,
class Gr
idPart>
97 :
public ZeroModel<FunctionSpace, GridPart>
101 typedef FunctionSpace FunctionSpaceType;
102 typedef GridPart GridPartType;
106 const std::string& name =
"")
107 :
BaseType(name ==
"" ?
"- (" +
asImp(function).name() +
", . )" : name)
124 template<
class Gr
idFunction>
126 bulkForcesModel(
const Fem::Function<typename GridFunction::FunctionSpaceType, GridFunction>& f,
127 const std::string& name =
"")
Default model implementation.
Definition: modelinterface.hh:330
Interface class for second order elliptic models.
Definition: modelinterface.hh:192
A grid-function always returning 0.
Definition: constantfunction.hh:352
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
BulkForcesFunctionModel< GridFunction > bulkForcesModel(const Fem::Function< typename GridFunction::FunctionSpaceType, GridFunction > &f, const std::string &name="")
Generate a BulkForcesFunctionModel for the "right hand side".
Definition: bulkforcesmodel.hh:126
StructureFlags
Definition: bulkforcesmodel.hh:85
Wrap an existing GridFunction into a model which only conatains this ModelConstituent.
Definition: bulkforcesmodel.hh:42
A structure defining some trivial default values for the template structure ModelTraits<ModelType>,...
Definition: modelinterface.hh:57
Traits-template which has to be specialized for each individual model.
Definition: modelinterface.hh:48