5#include <dune/common/concept.hh>
6#include <dune/functions/common/typeerasure.hh>
8#include <amdis/LocalOperator.hpp>
9#include <amdis/common/ConceptsBase.hpp>
14template <
class GV,
class LC,
class C>
18 using LocalContext = LC;
19 using ElementContainer = C;
22template <
class Traits,
class... Nodes>
23struct OperatorDefinition
25 using GridView =
typename Traits::GridView;
30 virtual ~Interface() =
default;
31 virtual void update(GridView
const&) = 0;
32 virtual LocalOperator<
Traits,Nodes...> asLocalOperator()
const = 0;
37 struct Model :
public Impl
40 void update(GridView
const& gv)
final { this->get().update(gv); }
41 LocalOperator<
Traits,Nodes...> asLocalOperator() const final {
42 return localOperator(this->get()); }
48 using LOpConcept =
typename LocalOperatorDefinition<
Traits,Nodes...>::Concept;
51 auto require(Op&& op) ->
decltype
53 op.update(std::declval<GridView>()),
54 Dune::Concept::requireConcept<LOpConcept>(localOperator(op))
58 using Base = Dune::Functions::TypeErasureBase<Interface,Model>;
77template <
class Traits,
class... Nodes>
79 :
public Impl::OperatorDefinition<Traits,Nodes...>::Base
81 using Definition = Impl::OperatorDefinition<
Traits,Nodes...>;
82 using Super =
typename Definition::Base;
86 using GridView =
typename Traits::GridView;
90 template <
class Impl, Dune::disableCopyMove<Operator,Impl> = 0>
94 static_assert(Concepts::models<
typename Definition::Concept(
Impl)>,
95 "Implementation does not model the Operator concept.");
104 this->asInterface().update(gv);
110 return op.asInterface().asLocalOperator();
114template <
class LocalContext,
class Op,
class GV>
115auto makeOperator(Op op, GV
const& gridView)
The base class for a local operator to be used in a Assembler.
Definition: LocalOperator.hpp:75
The base class for an operator to be used in an Assembler.
Definition: Operator.hpp:80
Operator(Impl &&impl)
Constructor. Pass any type supporting the OperatorInterface.
Definition: Operator.hpp:91
void update(GridView const &gv)
Update the operator data on a GridView.
Definition: Operator.hpp:102
friend LocalOperator< Traits, Nodes... > localOperator(Operator const &op)
Transform an operator into a local-operator.
Definition: Operator.hpp:108
Operator()=default
Default Constructor.