DUNE-ACFEM (2.5.1)

zeromodel.hh
1#ifndef __DUNE_ACFEM_MODELS_MODULES_ZEROMODEL_HH__
2#define __DUNE_ACFEM_MODELS_MODULES_ZEROMODEL_HH__
3
4#include "modelexpressionbase.hh"
5#include "operatorparts/zerooperatorparts.hh"
6
7namespace Dune {
8
9 namespace ACFem {
10
25 template<class FunctionSpace, class GridPart>
27 : public ZeroModelExpression<ZeroModel<FunctionSpace, GridPart> >
28 {
29 typedef ZeroModel ThisType;
33 public:
34 typedef typename TraitsType::OperatorPartsType OperatorPartsType;
35
36 ZeroModel(const std::string& name = "0")
37 : name_(name)
38 {}
39
40 std::string name() const
41 {
42 return name_;
43 }
44
45 OperatorPartsType operatorParts() const
46 {
47 return OperatorPartsType(name_);
48 }
49
50 protected:
51 const std::string name_;
52 };
53
54 template<class FunctionSpace, class GridPart>
55 struct ModelTraits<ZeroModel<FunctionSpace, GridPart> >
56 : public DefaultModelTraits<FunctionSpace, GridPart>
57 {
58 typedef ZeroOperatorParts<FunctionSpace> OperatorPartsType;
59 };
60
69 template<class Object>
70 static inline
71 ZeroModel<typename Object::FunctionSpaceType, typename Object::GridPartType>
72 zeroModel(const Object& object, const std::string& name = "0")
73 {
75 }
76
78
80
82
83 } // namespace ACFem
84
85} //Namespace Dune
86
87
88#endif // __DUNE_ACFEM_MODELS_MODULES_ZEROMODEL_HH__
Default model implementation.
Definition: modelinterface.hh:330
Interface class for second order elliptic models.
Definition: modelinterface.hh:192
Define a simple zero model to optimize expression templates.
Definition: zeromodel.hh:28
Define a simple zero model to optimize expression templates.
Definition: zerooperatorparts.hh:31
static ZeroModel< typename Object::FunctionSpaceType, typename Object::GridPartType > zeroModel(const Object &object, const std::string &name="0")
Generate a Zero-model fitting the specified object.
Definition: zeromodel.hh:72
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
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Aug 13, 22:30, 2024)