DUNE-ACFEM (unstable)
modeltraits.hh
68 using NonLinearTag = CheckMethodTag<(IsLinearMethodTag<tag>::value ? (tag-1) : tag == fluxDivergence ? flux : tag)>;
97 IndexConstant<sequenceMask(FilteredSequence<NonLinearClosureFunctor<methods>, AllMethodTags>{})>;
263 static constexpr std::size_t closure = SequenceMask<pointIndex, valueIndex, jacobianIndex>::value;
272 static constexpr std::size_t closure = SequenceMask<pointIndex, valueIndex, jacobianIndex, hessianIndex>::value;
281 static constexpr std::size_t closure = SequenceMask<pointIndex, valueIndex, jacobianIndex>::value;
292 static constexpr std::size_t varying = SequenceMask<pointIndex, valueIndex, jacobianIndex>::value;
304 static constexpr std::size_t varying = SequenceMask<pointIndex, valueIndex, jacobianIndex>::value;
329 using LinearizedMethodTag = std::integral_constant<std::enable_if_t<tag != fluxDivergence, MethodTag>, tag+1>;
376 decltype(std::declval<Model>().flux(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
381 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<flux>&, const ArgumentMask<ArgMaskValue>&,
389 decltype(std::declval<Model>().linearizedFlux(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
394 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<linearizedFlux>&, const ArgumentMask<ArgMaskValue>&,
402 decltype(std::declval<Model>().fluxDivergence(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
407 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<fluxDivergence>&, const ArgumentMask<ArgMaskValue>&,
415 decltype(std::declval<Model>().source(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
420 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<source>&, const ArgumentMask<ArgMaskValue>&,
428 decltype(std::declval<Model>().linearizedSource(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
433 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<linearizedSource>&, const ArgumentMask<ArgMaskValue>&,
441 decltype(std::declval<Model>().robinFlux(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
446 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<robinFlux>&, const ArgumentMask<ArgMaskValue>&,
454 decltype(std::declval<Model>().linearizedRobinFlux(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
459 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<linearizedRobinFlux>&, const ArgumentMask<ArgMaskValue>&,
467 decltype(std::declval<Model>().singularFlux(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
472 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<singularFlux>&, const ArgumentMask<ArgMaskValue>&,
479 decltype(std::declval<Model>().linearizedSingularFlux(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
484 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<linearizedSingularFlux>&, const ArgumentMask<ArgMaskValue>&,
492 decltype(std::declval<Model>().dirichlet(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
497 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<dirichlet>&, const ArgumentMask<ArgMaskValue>&,
504 decltype(std::declval<Model>().linearizedDirichlet(std::declval<const decltype(std::get<I>(std::declval<Tuple>()))&>()...))
509 static std::true_type methodIntrospection(const Model&, const MethodTagConstant<linearizedDirichlet>&, const ArgumentMask<ArgMaskValue>&,
552 using FilteredSignatures = FilteredSequence<SignatureFilter<Model, tag>, MethodSignatures<tag> >;
598 struct ApplyHelper<T, tag, std::enable_if_t<HasMethod<Model, CheckMethodTag<tag>::value>::value> >
631 using MethodSignatureClosure = TraitsHelper::MethodSignatureClosure<CheckMethodTag<tag>::value>;
698 static constexpr std::size_t dimDomain = static_cast<std::size_t>(FunctionSpaceType::dimDomain);
700 static constexpr std::size_t dimRangeRange = static_cast<std::size_t>(RangeFunctionSpaceType::dimRange);
701 static constexpr std::size_t dimDomainRange = static_cast<std::size_t>(DomainFunctionSpaceType::dimRange);
835 using IsPiecewiseConstant = typename IsPiecewiseConstantFunctor::template Apply<MethodTag, CheckMethodTag<tag>::value>;
846 using IsLinear = typename IsLinearFunctor::template Apply<MethodTag, CheckMethodTag<tag>::value>;
860 using IsAffineLinear = typename IsAffineLinearFunctor::template Apply<MethodTag, CheckMethodTag<tag>::value>;
870 static constexpr bool isAffineLinear = AccumulateSequence<LogicalAndFunctor, TransformedSequence<IsAffineLinearFunctor, Methods> >::value;
873 static constexpr bool isLinear = AccumulateSequence<LogicalAndFunctor, TransformedSequence<IsLinearFunctor, Methods> >::value;
879 static constexpr bool isLoad = AccumulateSequence<LogicalAndFunctor, TransformedSequence<IsLoadFunctor, Methods> >::value;
885 static constexpr bool isPiecewiseConstant = AccumulateSequence<LogicalAndFunctor, TransformedSequence<IsPiecewiseConstantFunctor, Methods> >::value;
902 using ModelHasMethod = typename ModelTraits<Model>::template HasMethod<ModelIntrospection::CheckMethodTag<tag>::value>;
906 using ModelMethodExists = typename ModelTraits<Model>::template Exists<ModelIntrospection::CheckMethodTag<tag>::value>;
911 typename ModelTraits<Model>::template CallSignature<ModelIntrospection::CheckMethodTag<tag>::value>;
920 typename ModelTraits<Model>::template CallSignatureClosure<ModelIntrospection::CheckMethodTag<tag>::value>;
Integral constant holding an argument mask.
Definition: modeltraits.hh:112
IndexConstant< value &linArgsMask > LinearizationSignature
The part of the mask referring to the point of linearization.
Definition: modeltraits.hh:129
ArgumentMask()
Default constructor.
Definition: modeltraits.hh:123
static constexpr value_type linearizationSignature()
The part of the mask referring to the point of linearization.
Definition: modeltraits.hh:132
static constexpr value_type signature()
The part of the mask referring to the arguments except the point of linearization.
Definition: modeltraits.hh:145
IndexConstant< value &~linArgsMask > Signature
The part of the mask referring to the arguments except the point of linearization.
Definition: modeltraits.hh:140
ArgumentMask(const BaseType &)
Allow implicit initialization from base type.
Definition: modeltraits.hh:126
Constant< typename Seq::value_type, AccumulateSequenceHelper< Seq, F >::value > AccumulateSequence
Accumulate the values of the sequence according to the supplied functor.
Definition: accumulate.hh:73
std::tuple_element_t< N, std::decay_t< TupleLike > > TupleElement
Forward to std::tuple_element<N, std::decay_t<T> >
Definition: access.hh:125
constexpr std::size_t size()
Gives the number of elements in tuple-likes and std::integer_sequence.
Definition: size.hh:73
TransformSequence< Seq, Sequence< typename Seq::value_type >, IdentityFunctor, UnaryFilterFunctor< F, typename Seq::value_type > > FilteredSequence
Create a new sequence by filtering out certain elements.
Definition: filter.hh:115
MakeSequence< std::size_t, N, Offset, Stride, Repeat > MakeIndexSequence
Make a sequence of std::size_t elements.
Definition: generators.hh:34
constexpr bool hasBit(const std::size_t &mask, const std::size_t &bit)
std::true_type if Mask has Bit set.
Definition: mask.hh:92
constexpr auto sequenceMask(const IndexSequence< I... > &)
Generate a bit-mask from the given index-sequence.
Definition: mask.hh:82
typename SubMaskSequenceHelper< IndexSequence<>, MaskSequence< Mask >, MaskSequence< RequiredMask > >::type SubMaskSequence
Generate a sequence of pair-wise distinct sub-bitmasks starting from a given bit-mask.
Definition: submask.hh:79
IndexConstant< SequenceMaskHelper< I... >::value > SequenceMask
Generate a bit-mask from the given index-sequence.
Definition: mask.hh:78
TransformSequence< Seq, Seq, F, AcceptEqualFunctor< false > > CatTransformUnique
Concat the result of TransformUnique with the original sequence.
Definition: transform.hh:295
integral_constant< T, V > Constant
Short-cut for any integral constant.
Definition: types.hh:40
Constant< bool, V > BoolConstant
Short-cut for integral constant of type bool.
Definition: types.hh:48
std::integer_sequence< T, V... > Sequence
Sequence of any type of integer values.
Definition: types.hh:56
Constant< std::size_t, V > IndexConstant
Short-cut for integral constant of type std::size_t.
Definition: types.hh:44
BoolConstant< false > FalseType
Alias for std::false_type.
Definition: types.hh:110
MakeIndexSequence< numMethodTags > AllMethodTags
Sequence of all supported methods.
Definition: modeltraits.hh:75
MethodTagConstant<(MethodTag) tag > CheckMethodTag
Alias, used where we want to express that we do check the value.
Definition: modeltraits.hh:45
MethodTag
An enum in order to parametrize the call-signature introspection.
Definition: modeltraits.hh:23
IndexConstant< sequenceMask(FilteredSequence< NonLinearClosureFunctor< methods >, AllMethodTags >{})> NonLinearMethodsClosure
Compute a bit-mask corresponding to the "closure" of non-linear methods.
Definition: modeltraits.hh:97
TraitsHelper::template ModelMethods< std::decay_t< Model > > Methods
Shortcut to the methods implemented by the model.
Definition: modeltraits.hh:638
Sequence< MethodTag, Tags... > MethodTagSequence
Sequence alias for method-tags.
Definition: modeltraits.hh:72
ArgumentPositions
Positions of the respective arguments inside the argument closure tuple.
Definition: modeltraits.hh:102
TraitsHelper::template MethodCallSignatures< std::decay_t< Model > > MethodCallSignatures
Shortcut the the call-signature tuple.
Definition: modeltraits.hh:646
TraitsHelper::MethodSignatureClosure< CheckMethodTag< tag >::value > MethodSignatureClosure
Type alias extracting the "closure" of all supported call-signatures.
Definition: modeltraits.hh:631
TraitsHelper::MethodSignaturesClosureType MethodSignaturesClosureType
A sequence with the closure patterns for each method.
Definition: modeltraits.hh:634
constexpr bool isZero
Shortcut identifying a zero model.
Definition: modeltraits.hh:642
typename TraitsHelper::SupportedCallSignatures< tag >::Type MethodSignatures
Type alias extracting the index_sequence holding all allowed call-signatures for the given tag.
Definition: modeltraits.hh:625
CheckMethodTag<(IsLinearMethodTag< tag >::value ? tag :(tag==fluxDivergence ? linearizedFlux :tag+1))> LinearizedTag
Compute the tag value of the respective linearized method.
Definition: modeltraits.hh:61
CheckMethodTag<(IsLinearMethodTag< tag >::value ?(tag-1) :tag==fluxDivergence ? flux :tag)> NonLinearTag
Compute the tag value of the respective non-linear method.
Definition: modeltraits.hh:68
Constant< MethodTag, tag > MethodTagConstant
Wrap into integral_constant in order to have a type.
Definition: modeltraits.hh:39
BoolConstant< CheckMethodTag< tag >::value &1 > IsLinearMethodTag
Evaluate to std::true_type for tags corresponding to linear methods.
Definition: modeltraits.hh:49
ModelIntrospection::MethodSignaturesClosureType ModelMethodClosureSignatures
A sequence with the closure signatures for all methods.
Definition: modeltraits.hh:926
typename ModelTraits< Model >::template Exists< ModelIntrospection::CheckMethodTag< tag >::value > ModelMethodExists
Check for either non-linear or linearized method.
Definition: modeltraits.hh:906
Fem::QuadraturePointWrapper< Quadrature > QuadraturePoint
Shortcut.
Definition: quadraturepoint.hh:23
ModelIntrospection::AllMethodTags ModelAdmissibleMethods
A sequence with the tags of all possible model-methods.
Definition: modeltraits.hh:923
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
typename ModelTraits< Model >::template HasMethod< ModelIntrospection::CheckMethodTag< tag >::value > ModelHasMethod
Check for method.
Definition: modeltraits.hh:902
typename ModelTraits< Model >::template CallSignature< ModelIntrospection::CheckMethodTag< tag >::value > ModelMethodSignature
Call signature for given model and method.
Definition: modeltraits.hh:911
typename ModelTraits< Model >::template CallSignatureClosure< ModelIntrospection::CheckMethodTag< tag >::value > ModelMethodSignatureClosure
Compute the closure call-signature for the given model for a call to the method designated by tag,...
Definition: modeltraits.hh:920
STL namespace.
Gets the type of the n-th element of a tuple-like or the std::integral_constant corresponding to the ...
Definition: access.hh:42
typename IsLoadFunctor::template Apply< MethodTag, CheckMethodTag< tag >::value > IsLoad
Method defines only a load contribution.
Definition: modeltraits.hh:819
typename ExistsFunctor::template Apply< MethodTag, CheckMethodTag< tag >::value > Exists
Linearized or non-linearized method is implemented.
Definition: modeltraits.hh:801
typename IsPiecewiseConstantFunctor::template Apply< MethodTag, CheckMethodTag< tag >::value > IsPiecewiseConstant
Method does not depend on the quadrature point.
Definition: modeltraits.hh:835
typename BaseType::ModelMethods< Model > Methods
The index sequence with all implemented methods.
Definition: modeltraits.hh:757
TupleElement< tag, BaseType::MethodReturnType< Model > > ReturnType
Generate the return type for the given method tag.
Definition: modeltraits.hh:745
typename IsAffineLinearFunctor::template Apply< MethodTag, CheckMethodTag< tag >::value > IsAffineLinear
Linear method does not need point of linearization.
Definition: modeltraits.hh:860
typename IsLinearFunctor::template Apply< MethodTag, CheckMethodTag< tag >::value > IsLinear
Non-linear method is not implemented.
Definition: modeltraits.hh:846
![Creative Commons License](https://i.creativecommons.org/l/by-sa/4.0/80x15.png)