diff --git a/dune/python/grid/function.hh b/dune/python/grid/function.hh index 67982f088fcfce4c51512a7501eaf87b97977fc4..55bf2f215f6fd953dd831723c46c016f1d5ef836 100644 --- a/dune/python/grid/function.hh +++ b/dune/python/grid/function.hh @@ -149,6 +149,14 @@ namespace Dune pybind11::keep_alive< 0, 1 >(), pybind11::keep_alive< 0, 2 >() ); + cls.def( "__call__", [] ( const GridFunction &self, const Element &element ) { + LocalCoordinate x ( 0.5 ); + auto lf = localFunction(self); + lf.bind(element); + auto y = detail::callLocalFunction< LocalCoordinate >( lf, x, PriorityTag<2>() ); + lf.unbind(); + return int(y); + }, "element"_a ); cls.def( "__call__", [] ( const GridFunction &self, const Element &element, LocalCoordinate &x ) { auto lf = localFunction(self); lf.bind(element);