Commit 0b00518d authored by Carsten Gräser's avatar Carsten Gräser

Stop passing old style functions to local interpolation

All functions passed to some
`LocalFiniteElement::LocalInterpolation::interpolate()`
now provide `operator()` such that we don't get deprecation
warnings for these from dune-localfunctions.

In some locations the functions may be used externally
such that `evaluate()` is kept for now.
parent 79118037
......@@ -237,12 +237,14 @@ public:
{}
// forward the evaluation into the other geometry
template<class X, class Y>
void evaluate(const X& x, Y& y) const
template<class X>
auto operator()(const X& x) const
{
function_.evaluate(geometry_.global(x), y);
return function_(geometry_.global(x));
}
private:
const Function function_;
......
......@@ -175,6 +175,13 @@ class CachedComponentWrapper :
}
}
RangeType operator()(const DomainType& x) const
{
RangeType y;
evaluate(x,y);
return y;
}
protected:
const Imp& asImp () const
......
......@@ -76,6 +76,11 @@ class LocalBasisDerivativeFunction :
y = D[0][j_];
}
RangeType operator()(const DomainType& x) const
{
return jacobianFunction_(x)[0][j_];
}
private:
JacobianFunction jacobianFunction_;
int j_;
......
......@@ -27,14 +27,13 @@ using namespace Dune;
*/
template <int dim>
struct CoordinateFunction
: public Dune::VirtualFunction<FieldVector<double,dim>, FieldVector<double,1> >
{
CoordinateFunction(int d)
: d_(d)
{}
void evaluate(const FieldVector<double, dim>& x, FieldVector<double,1>& out) const {
out[0] = x[d_];
FieldVector<double,1> operator()(const FieldVector<double, dim>& x) const {
return x[d_];
}
int d_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment