DUNE-ACFEM (unstable)

expressiontraits.hh
1 #ifndef __DUNE_ACFEM_MODELS_EXPRESSIONTRAITS_HH__
2 #define __DUNE_ACFEM_MODELS_EXPRESSIONTRAITS_HH__
3 
4 #include "../expressions/traitsdefault.hh"
5 #include "../tensors/tensorbase.hh"
6 #include "../functions/functiontraits.hh"
7 
8 #include "expressionoperations.hh"
9 #include "modeltraits.hh"
10 //#include "closuretraits.hh"
11 #include "definiteness.hh"
12 #include "symmetry.hh"
13 
14 namespace Dune
15 {
16 
17  namespace ACFem
18  {
19 
37  template<class Model>
38  struct ExpressionTraits<Model,
39  std::enable_if_t<IsPDEModel<Model>::value>,
40  TraitsPriority::Secondary>
41  : ConditionalType<ModelTraits<Model>::isZero,
42  ZeroExpressionTraits<Model>,
43  BaseExpressionTraits<Model> >
44  {
45  using Definiteness = decltype(definiteness(std::declval<Model>()));
46  static constexpr bool isSymmetric = decltype(PDEModel::isSymmetric(std::declval<Model>()))::value;
47  };
48 
49  namespace PDEModel {
50 
55  template<class Model>
56  using EffectiveModel = ConditionalType<IsClosureExpression<Model>::value,
57  Expressions::Operand<0, Model>,
58  Model>;
59 
64  template<class Model>
65  using EffectiveModelTraits = ModelTraits<EffectiveModel<Model> >;
66 
68  template<class T>
69  using IsProperPDEModel = BoolConstant<(IsPDEModel<T>::value && !Expressions::IsPromotedTopLevel<T>::value)>;
70 
72  template<class T>
73  using IsProperMultiplicationOperand =
74  BoolConstant<(!Expressions::IsPromotedTopLevel<T>::value
75  &&
76  ((IsTensor<T>::value && TensorTraits<T>::rank == 0)
77  || GridFunction::RangeTensorTraits<T>::rank == 0))>;
78 
82  template<class T, class SFINAE = void>
84  : TensorTraits<typename ModelTraits<T>::RangeType>
85  {};
86 
87  template<class T>
88  struct RangeTensorTraits<T, std::enable_if_t<ModelTraits<T>::dimRange == 1> >
89  : TensorTraits<typename ModelTraits<T>::RangeFieldType>
90  {};
91 
96  template<class Model>
97  using SkeletonSymmetrizeDefault =
98  Sign<(ModelMethodExists<EffectiveModel<Model>, ModelIntrospection::flux>::value
99  &&
100  EffectiveModelTraits<Model>::template IsAffineLinear<ModelIntrospection::flux>::value
101  &&
103 
104  } // PDEModel::
105 
107 
109 
111 
112  } // namespace ACFem
113 
114 } // namespace Dune
115 
116 #endif // __DUNE_ACFEM_MODELS_EXPRESSIONTRAITS_HH__
Constant< bool, V > BoolConstant
Short-cut for integral constant of type bool.
Definition: types.hh:48
typename ModelTraits< Model >::template Exists< ModelIntrospection::CheckMethodTag< tag >::value > ModelMethodExists
Check for either non-linear or linearized method.
Definition: modeltraits.hh:906
ModelIntrospection::template IsModel< Model > IsPDEModel
std::true_type if Model is derived from ModelBase.
Definition: modeltraits.hh:894
ModelIntrospection::Traits< Model > ModelTraits
Traits class for models.
Definition: modeltraits.hh:898
Default expression traits definition is a recursion in order to ease disambiguation.
Definition: expressiontraits.hh:54
TensorTraits for the RangeType of a model, keeping scalar decay of 1d vectors into account.
Definition: expressiontraits.hh:85
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 3, 22:32, 2024)