5#include <dune/grid/utility/hierarchicsearch.hh>
7#include <amdis/algorithm/Transform.hpp>
8#include <amdis/gridfunctions/GridFunction.hpp>
9#include <amdis/linearalgebra/VectorFacade.hpp>
14template <
class C,
class GB,
class TP,
class R>
15typename DiscreteFunction<C const,GB,TP,R>::Range DiscreteFunction<C const,GB,TP,R>::
16 operator()(Domain
const& x)
const
18 using Grid =
typename GlobalBasis::GridView::Grid;
19 using IS =
typename GlobalBasis::GridView::IndexSet;
21 auto const& gv = this->basis().gridView();
22 Dune::HierarchicSearch<Grid,IS> hsearch{gv.grid(), gv.indexSet()};
24 auto element = hsearch.findEntity(x);
25 auto geometry = element.geometry();
26 auto localFct = localFunction(*
this);
27 localFct.bind(element);
28 return localFct(geometry.local(x));
33template <
class C,
class GB,
class TP,
class R>
34 template <
class Expr,
class Tag>
38 auto const& basis = this->basis();
39 auto const& treePath = this->treePath();
44 interpolate(this->coefficients(), gf);
49template <
class C,
class GB,
class TP,
class R>
50 template <
class Expr,
class Tag>
55 Coefficients tmp(coefficients());
57 Self tmpView{tmp, this->basis(), this->treePath()};
61 coefficients() = std::move(tmp);
A mutable view on the subspace of a DOFVector,.
Definition: DiscreteFunction.hpp:45
void interpolate(Expr &&expr, Tag strategy={})
Interpolation of GridFunction to DOFVector.
Definition: DiscreteFunction.inc.hpp:52
void interpolate_noalias(Expr &&expr, Tag strategy={})
Interpolation of GridFunction to DOFVector, assuming that there is no reference to this DOFVector in ...
Definition: DiscreteFunction.inc.hpp:36
decltype(auto) makeGridFunction(PreGridFct const &preGridFct, GridView const &gridView)
Generator for Gridfunctions from Expressions (PreGridfunctions)
Definition: GridFunction.hpp:168
Definition: SimpleInterpolator.hpp:80