[dune-functions] Inconsistency in Derivative types
Christian Engwer
christian.engwer at uni-muenster.de
Thu Mar 20 17:18:53 CET 2014
Hi,
I just discovered that we have an inconsistency between LocalFunctions
and Functions regarding the definition of derivate types.
In LocalFunctions we provide the convinience method evaluateJacobian,
which takes a JacobianType by reference to store the result. You would
usually expect this JacobianType to be the same type as the type of
the first derivative in Functions, but...
In Functions we define
FieldMatrix<F,GridDim,RangeDim>
where as in LocalFunctions we define
FieldMatrix<F,RangeDim,GridDim>
It is not a huge problem, but kind of ugly. How shall we proceed. The
reason in LocalFunctions was that in case of scalar functions, we can
easily get the gradient fomr the jacobian as jac[0].
We could avoid this, if we use Traits like in Functions and add
specilizations for FieldVector<F,1>, such that we use this thing
directly. In Functions we define Traits for scalar types like double,
but in practice these are never used. As we extract the RangeType from
LocalFunctions it is always FieldVector, even in the scalar case.
On the long run we have to find a nice solution and should be
consistent between LocalFunctions and Functions. In my opinion this
fix could also include interface changes in LocalFunctions.
Ciao
Christian
More information about the dune-functions
mailing list