[dune-fem] Calculating the gradient of an AdaptiveDiscreteFunction

Dedner, Andreas A.S.Dedner at warwick.ac.uk
Sat Aug 4 18:40:55 CEST 2012


Hi.

Have a look at the evaluate method in
dune/fem/function/common/discretefunction_inline.hh
around line 200+.
You can use that directly or reuse the code to obtain the jacobian using
the jacobian method on the local function (thats what I would do).
But always be aware - as you can see from the code - that evaluating anything in
global coordinates is extremely expensive (a full grid traversal).

Best
Andreas
________________________________________
From: dune-fem-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-fem-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Alasdair James McLeay [a.mcleay at sussex.ac.uk]
Sent: 04 August 2012 15:32
To: dune-fem at dune-project.org
Subject: [dune-fem] Calculating the gradient of an AdaptiveDiscreteFunction

Hi,

I need to calculate the gradient or jacobian of the solution to a 1D problem at specific points. The solution type is AdaptiveDiscreteFunction and I'm looking for the best way to calculate the gradient.

I see there is a function .jacobian(x, ret) but unfortunately this seems to return a 'not implemented' error so guess I'll need to look for something else. I've had a look at 'dgmasspass.hh' but can't figure out how to use it or see any examples of it's use.

I also see that PDELabs offers some helper functions that I may be able to use.

Does anyone have a suggestion as to the best route?

Thanks,
Ali
_______________________________________________
dune-fem mailing list
dune-fem at dune-project.org
http://lists.dune-project.org/mailman/listinfo/dune-fem






More information about the dune-fem mailing list