> I need to compute derivatives of a vector field at arbitrary points.
> First-order derivatives are nicely provided by
> FEFieldFunction::vector_gradient.
>
> In order to get second-order derivatives I compute gradients at all
> nodes and then provide them (one component at time) to the
> FEFieldFunction constructor as a new data_vector. Then I use
> FEFieldFunction::vector_gradient again.

I think it would be simpler if you just extended the FEFieldFunction to 
also provide you with second derivatives. If you look at how it computes 
first derivatives, it should be fairly obvious to write a function that 
provides second derivatives.

If you go this route, please send us the result and we can put it into the 
library.


> Now I need to compute third-order derivatives also...

That is more complicated. I can't think of a simpler way than evaluating 
second derivatives inside FEFieldFunction and taking the gradient as you 
do for second derivatives now.

You may also want to consider computing higher order derivatives using 
finite differences directly.


> P.S. I'm using Lagrange elements of adequate polynomial degree in order
> to ensure the existence of n-th order derivatives.

One question worth asking is whether what you get actually makes sense? 
Second derivatives probably still converge to the second derivatives of 
the exact solution at individual points at least if the mesh is regular 
enough. But third derivatives of the approximate solution will, to the 
best of my knowledge, not converge to third derivatives of the exact 
solution at arbitrary points.

What do you intend to do with those?

Best
 W.

-- 
-------------------------------------------------------------------------
Wolfgang Bangerth                email:            [email protected]
                                 www: http://www.math.tamu.edu/~bangerth/


_______________________________________________

Reply via email to