DUNE-ACFEM (2.5.1)

massmodel.hh
1#ifndef __DUNE_ACFEM_MODELS_MODULES_MASSMODEL_HH__
2#define __DUNE_ACFEM_MODELS_MODULES_MASSMODEL_HH__
3
4#include "../operatorparts/modeladapter.hh"
5
6namespace Dune {
7
8 namespace ACFem {
9
29 template<class FunctionSpace>
31 : public OperatorPartsExpression<MassOperatorParts<FunctionSpace> >
32 {
37 public:
38 typedef FunctionSpace FunctionSpaceType;
39
40 typedef typename FunctionSpaceType::DomainType DomainType;
41 typedef typename FunctionSpaceType::RangeType RangeType;
42 typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType;
43 typedef typename FunctionSpaceType::HessianRangeType HessianRangeType;
44
45 enum {
46 dimDomain = FunctionSpaceType::dimDomain,
47 dimRange = FunctionSpaceType::dimRange
48 };
49
50 typedef typename FunctionSpaceType::DomainFieldType DomainFieldType;
51 typedef typename FunctionSpaceType::RangeFieldType RangeFieldType;
52
53 MassOperatorParts(const std::string& name = "")
54 : name_(name == "" ? "Mass" : name)
55 {}
56
57 std::string name() const
58 {
59 return name_;
60 }
61
63 template<class Entity, class Point>
64 void linearizedSource(const RangeType& uBar,
65 const JacobianRangeType& DuBar,
66 const Entity& entity,
67 const Point &x,
68 const RangeType& value,
69 const JacobianRangeType& jacobian,
70 RangeType& result) const
71 {
72 result = value;
73 }
74
75 protected:
76 const std::string name_;
77 };
78
79 template<class FunctionSpace>
80 struct OperatorPartsTraits<MassOperatorParts<FunctionSpace> >
81 : public DefaultOperatorPartsTraits<FunctionSpace>
82 {
85 {
86 isLinear = true,
87 isSymmetric = true,
88 isSemiDefinite = true
89 };
90
93 hasFlux = false,
94 hasSources = true,
95 hasRobinFlux = false,
96 };
97 };
98
100
111 template<class Object>
112 static inline
113 MassOperatorParts<typename Object::FunctionSpaceType>
114 massOperatorParts(const Object& object, const std::string& name = "")
115 {
117 return OperatorPartsType(name);
118 }
119
145 template<class Object>
146 static inline
147 OperatorPartsAdapterModel<MassOperatorParts<typename Object::FunctionSpaceType>,
148 typename Object::GridPartType>
149 massModel(const Object& object, const std::string& name = "")
150 {
152 typedef typename Object::GridPartType GridPartType;
153 return OperatorPartsAdapterModel<OperatorPartsType, GridPartType>(OperatorPartsType(name));
154 }
155
157
159
161
162 } // namespace ACFem
163
164} //Namespace Dune
165
166
167#endif // __DUNE_ACFEM_MODELS_MODULES_MASSMODEL_HH__
Default model implementation.
Definition: operatorparts.hh:387
Define a simple mass-model, given function-space and grid-part.
Definition: massmodel.hh:32
Interface class for second order elliptic models.
Definition: operatorparts.hh:92
static MassOperatorParts< typename Object::FunctionSpaceType > massOperatorParts(const Object &object, const std::string &name="")
Generate OperatorParts for a (weak, of course) Mass.
Definition: massmodel.hh:114
ConstituentFlags
Provide information about the constituents of the model.
Definition: massmodel.hh:92
void linearizedSource(const RangeType &uBar, const JacobianRangeType &DuBar, const Entity &entity, const Point &x, const RangeType &value, const JacobianRangeType &jacobian, RangeType &result) const
The linearized source term as function of local coordinates.
Definition: massmodel.hh:64
static OperatorPartsAdapterModel< MassOperatorParts< typename Object::FunctionSpaceType >, typename Object::GridPartType > massModel(const Object &object, const std::string &name="")
Generate a mass model fitting the specified object.
Definition: massmodel.hh:149
StructureFlags
Static flags for the overall structure of the operator.
Definition: massmodel.hh:85
Traits-template which has to be specialized for each individual model.
Definition: operatorparts.hh:36
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Aug 13, 22:30, 2024)