5 #include <amdis/GridFunctionOperator.hpp> 6 #include <amdis/LocalOperator.hpp> 7 #include <amdis/OperatorAdapter.hpp> 8 #include <amdis/functions/EntitySet.hpp> 9 #include <amdis/operations/Assigner.hpp> 10 #include <amdis/typetree/Traversal.hpp> 11 #include <amdis/typetree/TreePath.hpp> 15 template <
class GB,
class T,
class Traits>
16 template <
class ContextTag,
class Expr,
class TreePath>
18 addOperator(ContextTag contextTag, Expr
const& expr, TreePath path)
20 static_assert( Concepts::PreTreePath<TreePath>,
21 "path must be a valid treepath, or an integer/index-constant");
23 using LocalContext =
typename Impl::ContextTagType<ContextTag>::type;
24 auto op = makeOperator<LocalContext>(expr, this->basis().gridView());
25 if constexpr(std::is_same_v<TreePath,RootTreePath>)
26 assembler_.push(contextTag, std::move(op));
28 assembler_.push(contextTag, OperatorAdapter{std::move(op), makeTreePath(path)});
32 template <
class GB,
class T,
class Traits>
34 REQUIRES_(Concepts::LocalView<LocalView>)>
38 assert(localView.bound());
40 elementVector_.resize(localView.size());
43 auto const& gv = this->basis().gridView();
44 auto const& element = localView.element();
47 auto rhsOp = localAssembler(assembler_);
49 rhsOp.assemble(context, localView.
treeCache(), elementVector_);
56 template <
class GB,
class T,
class Traits>
60 auto localView = this->basis().localView();
62 this->init(this->basis(),
true);
63 for (
auto const& element : entitySet(this->basis())) {
64 localView.bind(element);
65 this->assemble(localView);
Definition: Assigner.hpp:16
Definition: ContextGeometry.hpp:161
Definition: AdaptBase.hpp:6
constexpr bool LocalView
A Dune::Functions::LocalView type.
Definition: Concepts.hpp:181
Geometry const & geometry() const
Return the geometry of the Element.
Definition: ContextGeometry.hpp:195
The restriction of a finite element basis to a single element.
Definition: LocalView.hpp:14
TreeCache const & treeCache() const
Cached version of the local ansatz tree.
Definition: LocalView.hpp:36