Partial-derivative interface for GridFunctions
The DifferentiableFunction
concept defines, that the a free function derivative(...)
should give us a a function with a signature following a DerivativeSignature
, e.g., the Domain is the same, but the range is given by DefaultDerivativeTraits::Range
.
Thus, derivative
gives us a gradient (or jacobian) for a scalar-valued (vector-valued) function. What about partial derivatives? Are there discussions about an interface providing the partial derivative of, e.g., a grid-function.
Although, ''derivative'' is a very general name, there is no other place in the dune modules with the same name used for derivatives of functions. in dune-geometry and dune-localfunctions it is named ''jacobian'' mainly. There, also the partial derivatives can be evaluated, using partial(...)
For the DiscreteGlobalBasisFunction
, the implementation of derivative
involves the multiplication of shape-function gradients (vector or matrix) with the jacobianInverseTransposed (matrix) from the geometry. This can be reduced to a vector * vector or matrix * vector multiplication and is thus cheaper than evaluating the full derivative and extracting the desired components afterwards.