7#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH
8#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDFINITEELEMENTMIXIN_HH
10namespace Dune::Functions::Impl {
19template<
class FEImplementation,
class ReferenceLocalBasisTraits>
20class TransformedLocalBasis
23 using Traits = ReferenceLocalBasisTraits;
25 TransformedLocalBasis(FEImplementation
const& feImpl)
36 return feImpl_->size();
40 void evaluateFunction(
const typename Traits::DomainType &x,
41 std::vector<typename Traits::RangeType> &out)
const
43 feImpl_->referenceLocalBasis().evaluateFunction(x, rangeBuffer_);
45 feImpl_->transform(rangeBuffer_, out);
54 void evaluateJacobian(
const typename Traits::DomainType &x,
55 std::vector<typename Traits::JacobianType> &out)
const
57 feImpl_->referenceLocalBasis().evaluateJacobian(x, jacobianBuffer_);
59 feImpl_->transform(jacobianBuffer_, out);
73 std::enable_if_t<std::is_same_v<TT, typename Traits::HessianType>,
int> = 0>
74 void evaluateHessian(
const typename Traits::DomainType &x,
75 std::vector<TT> &out)
const
77 feImpl_->referenceLocalBasis().evaluateHessian(x, hessianBuffer_);
79 feImpl_->transform(hessianBuffer_, out);
89 void partial(std::array<unsigned int, Traits::dimDomain>
const &order,
90 const typename Traits::DomainType &x,
91 std::vector<typename Traits::RangeType> &out)
const
93 feImpl_->referenceLocalBasis().partial(order, x, rangeBuffer_);
95 feImpl_->transform(rangeBuffer_, out);
99 auto order()
const {
return feImpl_->referenceLocalBasis().order(); }
102 FEImplementation
const* feImpl_;
103 mutable std::vector<typename Traits::RangeType> rangeBuffer_;
104 mutable std::vector<typename Traits::JacobianType> jacobianBuffer_;
105 mutable std::vector<typename Traits::HessianType> hessianBuffer_;
141template<
class FEImplementation,
class ReferenceLocalBasisTraits>
142class TransformedFiniteElementMixin
145 TransformedFiniteElementMixin()
146 : tlb_(this->asImpl())
149 TransformedFiniteElementMixin(TransformedFiniteElementMixin
const& other)
150 : TransformedFiniteElementMixin()
153 const FEImplementation& asImpl()
const
155 return *(
static_cast<FEImplementation const*
>(
this));
158 auto const& localBasis()
const
164 TransformedLocalBasis<FEImplementation, ReferenceLocalBasisTraits> tlb_;
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75