Evaluating 2nd derivative of solution vector at quadrature points

54 views
Skip to first unread message

Johanna Meier

unread,
Dec 8, 2023, 12:40:10 PM12/8/23
to deal.II User Group
Dear deal.ii community,

I have a question regarding a simple heat equation. Assuming we have the following equation
heat_equation.png.

Is there a way to compute the actual numeric value of dudt.png at the quadrature points given the solution vector u? My first idea was to use quadratic elements and then just use FEValues.get_function_hessians() with the solution u, which seems to work. I was wondering if it is also somehow possible to use linear elements. For example, when multiplying by a test function w and doing integration by parts on the right hand side to shift one derivative to the test function. Would there be a way to evaluate this new expression to get dudt.png? Or would this then give me w_dudt.png?

This is more of a theoretical question, but any comments or hints would be appreciated!

Best,
Johanna

Wolfgang Bangerth

unread,
Dec 8, 2023, 12:50:42 PM12/8/23
to dea...@googlegroups.com
On 12/8/23 10:40, Johanna Meier wrote:
>
> Is there a way to compute the actual numeric value of dudt.png at the
> quadrature points given the solution vector u? My first idea was to use
> quadratic elements and then just use FEValues.get_function_hessians() with the
> solution u, which seems to work. I was wondering if it is also somehow
> possible to use linear elements. For example, when multiplying by a test
> function w and doing integration by parts on the right hand side to shift one
> derivative to the test function. Would there be a way to evaluate this new
> expression to get dudt.png? Or would this then give me w_dudt.png?

To do this, you need to tell us what you need du/dt for, i.e., in which
context it appears. If that context has a test function, then yes of course
you can integrate by parts. But if you want to output the time derivative as a
pointwise value, you don't have a test function.

Generally, I think you're probably going to be better off approximating du/dt
based on the current and previous time steps, using some kind of finite
differencing in time.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Johanna Meier

unread,
Dec 8, 2023, 1:08:36 PM12/8/23
to deal.II User Group
Thank you for your quick response Dr. Bangerth! The context I would like to use du/dt in does not have a test function. So I guess I have to stick with the 2nd order elements or use the finite differencing in time (Thank you for the suggestion! I have not thought about that).

Best
Johanna

Wolfgang Bangerth

unread,
Dec 8, 2023, 1:12:36 PM12/8/23
to dea...@googlegroups.com
On 12/8/23 11:08, Johanna Meier wrote:
> Thank you for your quick response Dr. Bangerth! The context I would like to
> use du/dt in does not have a test function. So I guess I have to stick with
> the 2nd order elements or use the finite differencing in time (Thank you for
> the suggestion! I have not thought about that).

You lose one order of convergence with every derivative. You'll very likely be
better off using the finite differencing than evaluating the right hand side
of a second order PDE.

Johanna Meier

unread,
Dec 8, 2023, 2:02:25 PM12/8/23
to deal.II User Group
Thank you for the tip, I will have a look into the finite differencing then!. One last question: Do you know if using the second derivative vs finite differencing would make a difference if I just want to output the values as a pointwise quantity?

Best,
Johanna

Wolfgang Bangerth

unread,
Dec 8, 2023, 2:19:06 PM12/8/23
to dea...@googlegroups.com
On 12/8/23 12:02, Johanna Meier wrote:
> Thank you for the tip, I will have a look into the finite differencing then!.
> One last question: Do you know if using the second derivative vs finite
> differencing would make a difference if I just want to output the values as a
> pointwise quantity?

Same as before. You lose accuracy the higher a derivative you want to look at.
Reply all
Reply to author
Forward
0 new messages