DUNE-ACFEM (unstable)

massmodel.hh
1 #ifndef __DUNE_ACFEM_MODELS_MODULES_MASSMODEL_HH__
2 #define __DUNE_ACFEM_MODELS_MODULES_MASSMODEL_HH__
3 
4 #include "../../expressions/terminal.hh"
5 
6 #include "../modelbase.hh"
7 #include "../expressiontraits.hh"
8 
9 namespace Dune {
10 
11  namespace ACFem::PDEModel {
12 
32  template<class FunctionSpace>
33  class MassModel
34  : public ModelBase<FunctionSpace>
35  , public Expressions::SelfExpression<MassModel<FunctionSpace> >
36  , public MPL::UniqueTags<TypedValueExpression, PositiveExpression, SymmetricModel>
37  {
38  typedef MassModel ThisType;
40  public:
41  using typename BaseType::RangeType;
42 
43  MassModel(const std::string& name = "")
44  : name_(name == "" ? "Mass" : name)
45  {}
46 
47  std::string name() const
48  {
49  return name_;
50  }
51 
53  RangeType linearizedSource(const RangeType& value) const
54  {
55  return value;
56  }
57 
58  protected:
59  std::string name_;
60  };
61 
63 
93  template<class Object>
94  inline auto massModel(const Object& object, const std::string& name = "")
95  {
97  return expressionClosure(ModelType(name));
98  }
99 
101 
103 
105 
106  } // namespace ACFem::PDEModel
107 
108  namespace ACFem {
109 
110  using PDEModel::massModel;
111 
112  }
113 
114 } //Namespace Dune
115 
116 
117 #endif // __DUNE_ACFEM_MODELS_MODULES_MASSMODEL_HH__
Define a simple mass-model, given function-space and grid-part.
Definition: massmodel.hh:37
constexpr decltype(auto) expressionClosure(T &&t)
Do-nothing default implementation for pathologic cases.
Definition: interface.hh:93
RangeType linearizedSource(const RangeType &value) const
The linearized source term as function of local coordinates.
Definition: massmodel.hh:53
auto massModel(const Object &object, const std::string &name="")
Generate a mass model fitting the specified object.
Definition: massmodel.hh:94
Terminals may derive from this class to express that they are expressions.
Definition: terminal.hh:25
A structure defining some basic default types and methods.
Definition: modelbase.hh:41
typename FunctionSpaceType::RangeType RangeType
The type returned by classifyBoundary().
Definition: modelbase.hh:62
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 16, 22:29, 2024)