Skip to content

WIP: add bindable local function to dune-fem

Martin Nolte requested to merge feature/bindable-localfunction into master

To make dune-fem compatible with other DUNE modules, like dune-functions, dune-pdelab, or the VTKWriter in dune-grid, we add a new interface for obtaining local functions:

const auto lf = localFunction( df );
for( const auto &entity : df.space() )
{
  lf.bind( entity );

  // evaluate lf (dune-functions style):
  const DomainType x( 0.5 );
  const auto value = lf( x );

  // evaluate lf (dune-fem style):
  RangeType r;
  JacobianRangeType dr;
  lf.evaluate( x, r );
  lf.jacobian( x, dr );

  lf.unbind();
}

This change is orthogonal to the current interface and, hence, has no impact on existing code.

For discrete functions, there are two implementational details:

  1. The returned local function will behave like a ConstLocalFunction
  2. Memory will be allocated using std::allocator.

Merge request reports