DUNE-ACFEM (2.5.1)

modeladapter.hh
1#ifndef __DUNE_ACFEM_MODELADAPTER_HH__
2#define __DUNE_ACFEM_MODELADAPTER_HH__
3
4#include "operatorparts.hh"
5#include "../modelexpressionbase.hh"
6
7namespace Dune {
8
9 namespace ACFem {
10
11 template<class OperatorParts, class GridPart>
12 class OperatorPartsAdapterModel
13 : public ModelExpression<OperatorPartsAdapterModel<OperatorParts, GridPart> >
14 {
15 typedef OperatorPartsAdapterModel ThisType;
16 typedef DefaultModel<ThisType> BaseType;
17 typedef ModelInterface<ThisType> InterfaceType;
18 typedef ModelTraits<ThisType> TraitsType;
19
20 public:
21 typedef OperatorParts OperatorPartsType;
22 typedef typename OperatorPartsType::FunctionSpaceType FunctionSpaceType;
23 typedef GridPart GridPartType;
24 typedef typename BaseType::EntityType EntityType;
25
26 typedef typename FunctionSpaceType::DomainType DomainType;
27 typedef typename FunctionSpaceType::RangeType RangeType;
28 typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType;
29 typedef typename FunctionSpaceType::HessianRangeType HessianRangeType;
30
31 enum {
32 dimDomain = FunctionSpaceType::dimDomain,
33 dimRange = FunctionSpaceType::dimRange
34 };
35
36 typedef typename FunctionSpaceType::DomainFieldType DomainFieldType;
37 typedef typename FunctionSpaceType::RangeFieldType RangeFieldType;
38
39 OperatorPartsAdapterModel(OperatorPartsType&& parts)
40 : operatorParts_(parts)
41 {}
42
43 std::string name() const {
44 return operatorParts_.name();
45 }
46
47 OperatorPartsType operatorParts() const {
48 return operatorParts_;
49 }
50
51 protected:
52 OperatorPartsType operatorParts_;
53 };
54
55 template<class OperatorParts, class GridPart>
56 struct ModelTraits<OperatorPartsAdapterModel<OperatorParts, GridPart> >
57 : public DefaultModelTraits<typename OperatorParts::FunctionSpaceType, GridPart>
58 {
59 typedef OperatorParts OperatorPartsType;
60 };
61
62 template<class OperatorParts, class GridPart>
63 OperatorPartsAdapterModel<OperatorParts, GridPart>
64 operatorPartsAdapterModel(const OperatorParts& operatorParts, const GridPart& gridPart)
65 {
66 return OperatorPartsAdapterModel<OperatorParts, GridPart>(operatorParts);
67 }
68
69 }
70}
71
72#endif // __DUNE_ACFEM_MODELADAPTER_HH__
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Mar 12, 23:28, 2025)