Skip to content

Implementation of partial() method for all LocalBasis classes

Simon Praetorius requested to merge (removed):master into master

It was decided to switch to the multi-index notation for evaluating partial derivatives in local bases by adding a new method partial(). This is now provided for all LocalBasis classes.

For many classes at least the zero-order derivative, i.e. function evaluation, is implemented and for some the first and even second order derivative. If a derivative is not yet implemented for a class and the method partial() is called, an exception will be thrown.

To test the new implementation, the test-localfe is adapted and extended. Tests are only performed for derivatives with order <= Traits::diffOrder. curently the old evaluate() method is still there and neeeds a diffOrder template argument. Some LocalBasis can be differentiated infinitly times, since all higher derivatives are zero. To account for this, a constant DUNE_MAX_DIFF_ORDER is provided. (When the evaluate() method will be removed in the future, this constant can also be deleted.)

For the tests at first it is checked whether a class provides the partial() and/or the evaluate() method. Therefore, the interface for localBasis is specified in a concept definition, providing checks like bool isLocalBasis<LB>() or simply bool localBasisHasPartial<LB>(). Just for completeness these concepts are implemented for localCoefficients, localInterpolation and localFiniteElement as well. A concept test is added in the test directory.

For the implementation of the tests and also for some partial() methods a compile-time loop was necessary. This is similar and partially adopted from dune-functions and may be put in the dune-common module instead. It is discussed currently whether to exchange this staticFor and staticIf with a hybridFor and hybridIf from dune-solvers. But this can easily be adapted.

Merge request reports

Loading