discreteFunction.localFunction is deprecated from now on.
For a long time localFunctions were obtained by calling
LocalFunction lf = discreteFunction.localFunction( entity );
This will soon be deprecated, because of several reasons. To provide the above feature the implementation of LocalFunction had to be quite complicated and does not work efficiently with all types of DiscreteFunctions. Furthermore, such local functions cannot used in conjunction with interpolations from dune-localfunctions where a std::vector is expected.
To circumvent the above call one should from now on use ConstLocalFunction, LocalContribution, MutableLocalFunction and TemporaryLocalFunction. Except for TemporaryLocalFunction, all take a discrete function as argument in the constructor, e.g.
ConstLocalFunction< DiscreteFunction > constLf( df );
TemporaryLocalFunction< DiscreteFunctionSpace > tempLf( space );
// element iteration
for (const auto& e : df.space() )
{
// similar to discreteFunction.localFunction( entity )
auto guard = bindGuard( constLf, e );
// use as before
...
}
The feature is implemented in !384 (merged) and will soon be merged.
Example then places in dune-fem will be:
- dune/fem/space/common/interpolate.hh
- dune/fem/space/common/restrictprolonginterface.hh