second derivatives of solution

29 views
Skip to first unread message

hank...@gmail.com

unread,
Feb 12, 2017, 6:50:38 AM2/12/17
to deal.II User Group

Hi all,

It seems that my question is very easy one, but I can't find the similar thing...

I know how I can use solution and first derivative solution that comes from fe_values.get_function_values and fe_values.get_function_gradients

So I thought that second derivative can be obtained by

/////////////////////////////////////////////////////////////////////////////////////
std::vector<Tensor<2,dim> > sol_hess(n_q_points);

fe_values.reinit (cell);
fe_values.get_function_hessians(solution, sol_hess);
...

sol_hess[q_index][0][0] //it is the same as d^2(solution)/dx^2
sol_hess[q_index][1][1] //it is the same as d^2(solution)/dy^2
////////////////////////////////////////////////////////////////////////////////////////////

However, even though the solution is continuous, the plot of d^2(solution)/dx^2 and d^2(solution)/dy^2 look very weird.

it looks like set of delta function on the each element.

So my question is..

Is it wrong way to get second derivatives of solution??

Thank you.

Kyusik.

Wolfgang Bangerth

unread,
Feb 12, 2017, 11:14:34 AM2/12/17
to dea...@googlegroups.com
How do you define "looks like set of delta function"? :-)

One thing to remember is that for finite elements, the solution is continuous,
the gradient is continuous on every cell but discontinuous between cells, and
the second derivatives is, in general, a delta function at the interfaces
between cells (because you are taking the derivative of a discontinuous function).

That doesn't mean that the second derivatives can't be used for some purposes,
but you need to know what you are doing.

Best
W.


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

hank...@gmail.com

unread,
Feb 12, 2017, 8:15:22 PM2/12/17
to deal.II User Group, bang...@colostate.edu
First of all, thank you very much for your kind reply

I'm sorry to ask you continuously, but I want to make it sure...

Do you mean that it is right way to get second derivatives but it could not be continuous?

I also attach the plot for d^2(solution)/dx^2 that look weird to me...

Thank you.

Kyusik.

2017년 2월 13일 월요일 오전 1시 14분 34초 UTC+9, Wolfgang Bangerth 님의 말:
derivatives_plane.png
derivatives.png

Wolfgang Bangerth

unread,
Feb 12, 2017, 11:03:27 PM2/12/17
to hank...@gmail.com, deal.II User Group
On 02/12/2017 06:15 PM, hank...@gmail.com wrote:
>
> Do you mean that it is right way to get second derivatives but it could not be
> continuous?

Yes, you are using the correct way of computing something that is of
questionable usefulness. As I mentioned, this is because for finite elements,
the function is continuous, the derivative is discontinuous, and then the
second derivative is questionable.

Think of the situation just in 1d where the solution is a piecewise linear
function. Imagine how the derivative looks (piecewise constant) and how the
second derivative would look like (a set of delta functions).


> I also attach the plot for d^2(solution)/dx^2 that look weird to me...

I think it is plausible. It is at least not obviously wrong in my mind.

hank...@gmail.com

unread,
Feb 12, 2017, 11:20:28 PM2/12/17
to deal.II User Group, hank...@gmail.com, bang...@colostate.edu
OK

Thank you very much!

Kyusik.

2017년 2월 13일 월요일 오후 1시 3분 27초 UTC+9, Wolfgang Bangerth 님의 말:
Reply all
Reply to author
Forward
0 new messages