[dune-pdelab] DiscreteGridFunction interface

Christian Engwer christian.engwer at uni-muenster.de
Wed Aug 8 15:57:34 CEST 2012


On Wed, Aug 08, 2012 at 03:15:29PM +0200, Jö Fahlke wrote:
> Am Wed,  8. Aug 2012, 10:10:53 +0200 schrieb Christian Engwer:
> > I'd like to get a new topic on the never ending
> > interface-discussion-list.
> > 
> > Why doesn't the DiscreteGridFunction allow the evaluation of
> > derivatives? 
> > 
> > DiscreteGridFunction is based on the LocalFunctions which allow to
> > evaluate derivatives and tell till which order. If nobody comes up
> > with a good reason not to do it, I'd like to include such
> > functionality in the DiscreteGridFunction. I currently have the
> > problem, that I'd like to implement different kinds of error
> > functionals, some of them work require the gradient, some the function
> > itself and I would prefer not to expose this part to the user.
> 
> One reason is that the GridFunction interface does not include evaluating the
> derivatives.

Well, this is not really a reason. The interface in some sense is also
a description of what is there.

> Another reason is that the local-valued LocalFiniteElements only provide
> local-valued derivatives.  You still need to know which transformation to
> apply, which (in general) depends on the kind of element.  This is of course a
> non-issue with global-valued finite elements.

Again it is not _really_ a reason. It is just that it is somewhat
harder to do it, but doesn't really give a reason why not to do it now.

> The traditional approach in PDELab is DiscreteGridFunctionGradient, which
> provides the gradient of a scalar local-valued LocalFiniteElement function,
> implicitly assuming Piola-transform.  If that is not the transformation you
> want, you have (or had) to write your own DiscreteGridFunctionFoo.  E.g. there
> is a variation of DiscreteGridFunctionGradient[1] for global-valued
> LocalFiniteElements.

I know the "traditional" (aka quirk) way, but this would require
passing the gradient and the function to my code.

> IMO making it possible to ask the GridFunction for the derivative sounds like
> a good idea.
> 
> Regards,
> Jö.
> 
> [1] OTOH I don't know whether it is a specialization of
>     DiscreteGridFunctionGradient or whether it is provided under a different
>     name.

the evaluate should still compute the value and not the gradient, so
this is not a specialization of DiscreteGridFunctionGradient.

Christian




More information about the dune-pdelab mailing list