Is there any convenient way to smooth the output from Datapostprocessor?

71 views
Skip to first unread message

沈键

unread,
May 20, 2021, 10:49:59 AM5/20/21
to deal.II User Group
Recently, I am writing codes to solve velocity potential equation which is laplace equation form to solve the incompressible and  inviscid  airfoil field. And after solving the system, I get the potential on each nodes. Then, I use Datapostprocessor class to calculate  solution's derivatives and output to tecplot format. I find the solution is continous  in tecplot, but its derivative is not. And I have learned that for Q1/Q2,etc element, its derivative is not continous between adjacent cells in theory, but in engineering we usually smooth the values between adjacent cells. My question is:
- Is there any easy way to smooth the values between adjacent cells?(I believe dealii has considered this problem, but I just didn't find any examples from tutorial.)
Best
smooth.png
cp_zoom_q1_element.png

Wolfgang Bangerth

unread,
May 21, 2021, 9:51:32 AM5/21/21
to dea...@googlegroups.com
On 5/20/21 8:49 AM, 沈键 wrote:
> Recently, I am writing codes to solve velocity potential equation which is
> laplace equation form to solve the incompressible and inviscid  airfoil field.
> And after solving the system, I get the potential on each nodes. Then, I use
> Datapostprocessor class to calculate  solution's derivatives and output to
> tecplot format. I find the solution is continous  in tecplot, but its
> derivative is not. And I have learned that for Q1/Q2,etc element, its
> derivative is not continous between adjacent cells in theory, but in
> engineering we usually smooth the values between adjacent cells. My question is:
> -*Is there any easy way to smooth the values between adjacent cells*?(I
> believe dealii has considered this problem, but I just didn't find any
> examples from tutorial.)

No "easy" way with DataPostprocessor at least. What DataPostprocessor does is
to faithfully output the gradient, which is indeed a discontinuous function.

The way to do this is to create a (continuous) finite element field onto which
you project the gradient. For example, let's say you define an FE_Q (and
associated DoFHandler) for the x-derivative of your solution. Then you would
want to compute the projection of d/dx u_h into this space via

(phi_i, grad_x) = (phi_i, d/dx u_h)

This requires solving with a mass matrix, but at least the grad_x finite
element function is a continuous function that you can then output.

Best
W.

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

沈键

unread,
May 21, 2021, 9:37:26 PM5/21/21
to deal.II User Group
Thanks for your reply, sir. I'm new to FEM and for some concepts, I don't have clear understanding. I still have some problems:
>  Then you would want to compute the projection of d/dx u_h into this space via
(phi_i, grad_x) = (phi_i, d/dx u_h)
-------------------------------------
Is u_h means finite element method solution? If I'm right, how to understand `(phi_i, grad_x) = (phi_i, d/dx u_h)`? Why they are equal?Snipaste_2021-05-22_09-30-16.png

> This requires solving with a mass matrix, but at least the grad_x finite element function is a continuous function that you can then output
-------------------------------------
What does 'mass matrix' mean here?

Wolfgang Bangerth

unread,
May 24, 2021, 11:37:36 AM5/24/21
to dea...@googlegroups.com
On 5/21/21 7:37 PM, 沈键 wrote:
> Thanks for your reply, sir. I'm new to FEM and for some concepts, I don't have
> clear understanding. I still have some problems:
> > Then you would want to compute the projection of d/dx u_h into this space via
> (phi_i, grad_x) = (phi_i, d/dx u_h)
> -------------------------------------
> Is u_h means finite element method solution? If I'm right, how to understand
> `(phi_i, grad_x) = (phi_i, d/dx u_h)`? Why they are
> equal?

Yes, u_h is the solution for which you want to output the gradient.

I should have chosen a different name than grad_x. I didn't mean this to be
the gradient operator, but a function that corresponds to d/dx u_h. Let me
call this function gx, then you want to solve the problem
(phi_i, gx) = (phi_i, d/dx u_h) for all shape functions phi_i
and similarly if you want to output a continuous version of d/dy u_h, you'd
solve for a function gy that satisfies
(phi_i, gy) = (phi_i, d/dy u_h) for all shape functions phi_i

If you expand gx as
gx(x) = \sum_j GX_j phi_j(x)
then the problem you are trying to solve is
(phi_i, gx)
= \sum_j (phi_i,phi_j) GX_j
= (phi_i, d/dx u_h)
where M_ij = (phi_i,phi_j) is the mass matrix.

沈键

unread,
May 24, 2021, 8:55:25 PM5/24/21
to deal.II User Group
I got it. Thank your, sir! By the way, does deal.ii accept personal donation? I want to support this wonderful project.

Wolfgang Bangerth

unread,
May 25, 2021, 11:09:03 AM5/25/21
to dea...@googlegroups.com
On 5/24/21 6:55 PM, 沈键 wrote:
> I got it. Thank your, sir! By the way, does deal.ii accept personal donation?
> I want to support this wonderful project.

That is a very interesting question -- and maybe the first time that someone
asked it in the 20 years this mailing list has existed!

The answer is no, but we are always excited about people who contribute to the
project through code contributions, contributions to the documentation,
tutorial programs, the code gallery, by providing machines that can run the
test suite periodically, or any other way. Indeed, a lot of people have
contributed over the years, as shown in
https://dealii.org/authors.html
We would be excited to list your name there as well!

Best
Wolfgang
Reply all
Reply to author
Forward
0 new messages