Skip to content

Bugfix LoacalFunctionAdapter

Andreas Dedner requested to merge bugfix/loacalfunctionadapter into master

I want to suggest to change the default behavior of the LocalFunctionAdapter: instead of by default storing the implementation by reference and using the tag LocalFunctionAdapterHasInitialize to store copies, in this proposal the default is to store by value and only if std::is_copy_constructible=false a reference is stored. So the user can switch to the old default behavior by deleting the copy constructor.

In the case that a copy is stored additional constructors can be used, using the intro-2 example from the howto: Old version always works (but default behavior changes):

     ErrorFunctionType errorFunction( "error", localError, gridPart );

New versions only with copy constructor available:

    ErrorFunctionType errorFunction( "error", LocalErrorType(solution, exact), gridPart );
    ErrorFunctionType errorFunction( "error", gridPart, std::forward_as_tuple(solution, exact) );
    ErrorFunctionType errorFunction( "error", gridPart, 5, solution, exact );

(I'm happy with removing the last two again but the const& one simplifies things).

Fix #28 (closed).

Merge request reports