Re: [deal.II] discontinous contour over elements

2020-01-22 Thread David Eaton
Professor Wolfgang Bangerth and Bruno Blais,

Thank you for your explanations. I get clear about this problem now.

Best
D.

From: dealii@googlegroups.com  on behalf of Wolfgang 
Bangerth 
Sent: Tuesday, January 21, 2020 11:48 PM
To: dealii@googlegroups.com 
Subject: Re: [deal.II] discontinous contour over elements

On 1/18/20 5:02 PM, David Eaton wrote:
> I just use tecplot directly visualize the results. The vorticity contour from
> my simple code is continuous, and the results from deal.II is discontinuous
> (without L2 projection).

Ah, I think that is it. Bruno was already on the right track.

I bet that your own code outputs the solution in a way that assigns only one
value to each node, and tecplot then computes a discontinuous gradient that it
averages at each node again from the adjacent cells. On the other hand,
deal.II outputs the value at each node as many times as there are adjacent
cells, and tecplot doesn't know how to average in that case.

In other words, what tecplot is doing *internally* is to do a projection (or
some other averaging operation) so that it *shows* you a continuous gradient
or vorticity field. But this is just another case where what you *see* is not
actually what it *is*. The gradient is discontinuous, regardless of what
tecplot shows you.

Best
  W.

--

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

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/cc811240-1952-ef7f-c5b9-4de5bdfe3ac9%40colostate.edu.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SL2PR01MB2553FF61BE9626F8A0984D9FC30C0%40SL2PR01MB2553.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-21 Thread Wolfgang Bangerth
On 1/18/20 5:02 PM, David Eaton wrote:
> I just use tecplot directly visualize the results. The vorticity contour from 
> my simple code is continuous, and the results from deal.II is discontinuous 
> (without L2 projection).

Ah, I think that is it. Bruno was already on the right track.

I bet that your own code outputs the solution in a way that assigns only one 
value to each node, and tecplot then computes a discontinuous gradient that it 
averages at each node again from the adjacent cells. On the other hand, 
deal.II outputs the value at each node as many times as there are adjacent 
cells, and tecplot doesn't know how to average in that case.

In other words, what tecplot is doing *internally* is to do a projection (or 
some other averaging operation) so that it *shows* you a continuous gradient 
or vorticity field. But this is just another case where what you *see* is not 
actually what it *is*. The gradient is discontinuous, regardless of what 
tecplot shows you.

Best
  W.

-- 

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

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/cc811240-1952-ef7f-c5b9-4de5bdfe3ac9%40colostate.edu.


Re: [deal.II] discontinous contour over elements

2020-01-20 Thread Bruno Blais
Do you use Tecplot to calculate vorticity from the velocity field or do you 
calculate the vorticity from your code, and then visualize it from tecplot?
The way deal.II visualizes gradients (or vorticity in this case) is the 
correct way it should be done, because it is visualized on an "element 
basis", ensuring that the real discontinuities in the fields are seen. Many 
other software will smoothen the discontinuous field by using some sort of 
averaging and then output these values at the nodes. This gives the 
illusion that the fields are continuous, when they are not in reality (the 
averaging introduces the continuity).
Consequently, this really depends on the procedure you are using to 
visualize your other results.


On Saturday, 18 January 2020 19:03:01 UTC-5, David Eaton wrote:
>
> I just use tecplot directly visualize the results. The vorticity contour 
> from my simple code is continuous, and the results from deal.II is 
> discontinuous (without L2 projection). Is it possible that the direct 
> solver in Intel mkl did a similar projection step internally?
>
> --
> *From:* Wolfgang Bangerth >
> *Sent:* Sunday, January 19, 2020, 12:49 AM
> *To:* David Eaton; dea...@googlegroups.com 
> *Subject:* Re: [deal.II] discontinous contour over elements
>
> On 1/18/20 9:25 AM, David Eaton wrote:
> > Thank you for your explanations. Basically I formed a weak form of the 
> PDE for 
> > one element and numerically integrate it at the Gaussian points based on 
> the 
> > interpolation from the local nodes. Subsequently, I assemble the weak 
> forms 
> > from all elements into a global system matrix based on a local-to-global 
> > mapping of the nodes. After applying the boundary conditions, I solve 
> this 
> > linear system using a linear solver in Intel mkl.
>
> Right -- that gives you the solution (u,p) of the problem. But then what 
> do 
> you do to visualize whatever it is that you find is/isn't discontinuous?
>
> Best
>   W.
>
> -- 
> 
> Wolfgang Bangerth  email: bang...@colostate.edu 
> 
> www: http://www.math.colostate.edu/~bangerth/
>
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/95374e76-952b-4b1e-83dc-e784c9c0f472%40googlegroups.com.


Re: [deal.II] discontinous contour over elements

2020-01-18 Thread David Eaton
I just use tecplot directly visualize the results. The vorticity contour from 
my simple code is continuous, and the results from deal.II is discontinuous 
(without L2 projection). Is it possible that the direct solver in Intel mkl did 
a similar projection step internally?


From: Wolfgang Bangerth 
Sent: Sunday, January 19, 2020, 12:49 AM
To: David Eaton; dealii@googlegroups.com
Subject: Re: [deal.II] discontinous contour over elements

On 1/18/20 9:25 AM, David Eaton wrote:
> Thank you for your explanations. Basically I formed a weak form of the PDE for
> one element and numerically integrate it at the Gaussian points based on the
> interpolation from the local nodes. Subsequently, I assemble the weak forms
> from all elements into a global system matrix based on a local-to-global
> mapping of the nodes. After applying the boundary conditions, I solve this
> linear system using a linear solver in Intel mkl.

Right -- that gives you the solution (u,p) of the problem. But then what do
you do to visualize whatever it is that you find is/isn't discontinuous?

Best
  W.

--

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


-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SL2PR01MB2553A18C05BF7C941F6AFBC5C3330%40SL2PR01MB2553.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-18 Thread Wolfgang Bangerth
On 1/18/20 9:25 AM, David Eaton wrote:
> Thank you for your explanations. Basically I formed a weak form of the PDE 
> for 
> one element and numerically integrate it at the Gaussian points based on the 
> interpolation from the local nodes. Subsequently, I assemble the weak forms 
> from all elements into a global system matrix based on a local-to-global 
> mapping of the nodes. After applying the boundary conditions, I solve this 
> linear system using a linear solver in Intel mkl.

Right -- that gives you the solution (u,p) of the problem. But then what do 
you do to visualize whatever it is that you find is/isn't discontinuous?

Best
  W.

-- 

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

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/5c1ef574-52b6-8449-743c-aae9c355460d%40colostate.edu.


Re: [deal.II] discontinous contour over elements

2020-01-18 Thread David Eaton
Thank you for your explanations. Basically I formed a weak form of the PDE for 
one element and numerically integrate it at the Gaussian points based on the 
interpolation from the local nodes. Subsequently, I assemble the weak forms 
from all elements into a global system matrix based on a local-to-global 
mapping of the nodes. After applying the boundary conditions, I solve this 
linear system using a linear solver in Intel mkl.

In deal.II, I took almost the same procedures. I formed the weak form for each 
element and assemble them based on the local-to-global mapping. After applying 
the boundary conditions, I solved it with the SparseDirectFUMPK solver. The 
only difference is that I got a very clear discontinuous gradient over the 
edges of elements. I think the solution from deal.II is more close to the 
theorem of FEM, which explains the fundamental idea of weak form. However, I am 
puzzled at why I did not read it in the FEM books before.

Best
David


From: Wolfgang Bangerth 
Sent: Saturday, January 18, 2020, 11:58 PM
To: David Eaton; dealii@googlegroups.com
Subject: Re: [deal.II] discontinous contour over elements

On 1/17/20 9:11 PM, David Eaton wrote:
>
> Thanks the help from you and the others. The issue of discontinuous vorticity
> field is resolved. Theoretically, I understand the gradient should be
> discontinuous for C0 elements.  However, I still want to convince myself with
> a explanation. while I used Q2Q1 Taylor-Hood element, the discontinuous
> contour still appear. What could be the reason for this?

And they should! You might be thinking that for Q2 functions, if you take the
gradient, you should still get a linear function that is continuous. But the
Q2 functions are only quadratic on each cell separately; they still have a
kink at cell interfaces, and consequently their gradient is discontinuous.


> On the other hand, I
> have a very simple FEM code using C0 elements without doing the projections.
> I just simply assembly the matrix, use a Lagrangian shape function in C0
> element and solve it with a linear solver. It does give a continuous contour
> without doing a projection. What could be the theoretical reason why it does
> not give a discontinuous contour? Is L2 projection is necessary step while
> computing gradients over elements for C0 elements?

Can you describe in mathematical terms what you do? When you say "assemble a
matrix" and "solve it", that sounds a lot like a projection to me.

Best
  W.

--

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

Q

Get Outlook for Android<https://aka.ms/ghei36>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SG2PR01MB25497E330F2E2F79F564B963C3300%40SG2PR01MB2549.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-18 Thread Wolfgang Bangerth
On 1/17/20 9:11 PM, David Eaton wrote:
> 
> Thanks the help from you and the others. The issue of discontinuous vorticity 
> field is resolved. Theoretically, I understand the gradient should be 
> discontinuous for C0 elements.  However, I still want to convince myself with 
> a explanation. while I used Q2Q1 Taylor-Hood element, the discontinuous 
> contour still appear. What could be the reason for this?

And they should! You might be thinking that for Q2 functions, if you take the 
gradient, you should still get a linear function that is continuous. But the 
Q2 functions are only quadratic on each cell separately; they still have a 
kink at cell interfaces, and consequently their gradient is discontinuous.


> On the other hand, I 
> have a very simple FEM code using C0 elements without doing the projections.  
> I just simply assembly the matrix, use a Lagrangian shape function in C0 
> element and solve it with a linear solver. It does give a continuous contour 
> without doing a projection. What could be the theoretical reason why it does 
> not give a discontinuous contour? Is L2 projection is necessary step while 
> computing gradients over elements for C0 elements?

Can you describe in mathematical terms what you do? When you say "assemble a 
matrix" and "solve it", that sounds a lot like a projection to me.

Best
  W.

-- 

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

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/8c39a2a4-1b8c-7531-e52f-b13085978a38%40colostate.edu.


Re: [deal.II] discontinous contour over elements

2020-01-17 Thread David Eaton
Dear Professor Wolfgang Bangerth,

Thanks the help from you and the others. The issue of discontinuous vorticity 
field is resolved. Theoretically, I understand the gradient should be 
discontinuous for C0 elements.  However, I still want to convince myself with a 
explanation. while I used Q2Q1 Taylor-Hood element, the discontinuous contour 
still appear. What could be the reason for this? On the other hand, I have a 
very simple FEM code using C0 elements without doing the projections.  I just 
simply assembly the matrix, use a Lagrangian shape function in C0 element and 
solve it with a linear solver. It does give a continuous contour without doing 
a projection. What could be the theoretical reason why it does not give a 
discontinuous contour? Is L2 projection is necessary step while computing 
gradients over elements for C0 elements?

Thank you
Best regards
David

From: dealii@googlegroups.com  on behalf of Wolfgang 
Bangerth 
Sent: Thursday, January 16, 2020 12:05 AM
To: dealii@googlegroups.com 
Subject: Re: [deal.II] discontinous contour over elements

On 1/14/20 10:04 PM, David Eaton wrote:
>
> Thank you for your suggestions. I am going to take a look at Lethe and compare
> with my implementation. In stabilized formulation, I used quadrilateral
> element, instead of P2 P1 Taylor-Hood element. The used element is only C0
> element. I also did not expect such a discontinuity between elements. Although
> I use P2 P1 Taylor-Hood element without stabilization terms, the discontinuity
> is still there. Probably I made mistakes somewhere  in setup. I also suspect
> that my solution is not converged. After taking a small relative tolerance
> 1e-8, the discontinuity still appears.

David, you did not understand what we were saying: If you use C0 elements
(think, piecewise linear) and you take derivatives to compute the vorticity,
then you automatically get a discontinuous function. That has nothing to do
with stabilization, solver tolerances, etc. It's just a consequence of the
fact that C0 elements and their shape functions have kinks and consequently
their derivatives are discontinuous.

Best
  W.

--

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

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f03c64fc-3736-340a-1cdc-f24749fb413f%40colostate.edu.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SL2PR01MB2553DA7C69C438ECA56F9B9BC3300%40SL2PR01MB2553.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-15 Thread David Eaton
Bruno,

Thanks for your explanation. Indeed, the gradient of velocity, vorticity, will 
be discontinuous over C0 elements. I will give a try and do a L2 projection. 
Surprisingly I did not experience it in my code before. I used standard 
Lagrangian shape functions and continuous Galerkin method. I suppose dealii 
used the same interpolation functions. I have to investigate why my simple code 
does not have this discontinuous vorticity field.

Thanks
D.


From: dealii@googlegroups.com  on behalf of Bruno 
Blais 
Sent: Thursday, January 16, 2020, 1:07 AM
To: deal.II User Group
Subject: Re: [deal.II] discontinous contour over elements

An easy way to carry the projection that Wolfgang suggested is to use an L2 
projection.
The L2 projection matrix is only a mass matrix and your right hand side is 
constructed by the integral of multiplication of the variable you want to 
project with the test function. Generally, this matrix is very very easy to 
invert. This will yield you the C0 representation of your discontinuous field 
(vorticity) such that the error between your C0 projection and your original 
field is minimized at the position of the gauss points.

This is a procedure we use to set the initial conditions in Lethe when the 
initial condition is a complex function (for instance a Taylor-Green vortex).


On Wednesday, 15 January 2020 11:22:52 UTC-5, David Eaton wrote:
I understand the C0 element is piecewise linear across elements. However, I did 
not experience the same issue in my own C++ code while I use C0 element with 
the Petrov Galerkin stabilization terms. Actually, I am very confused at this 
point. How could I get rid of it while using C0 element?

Thanks
D.


From: dea...@googlegroups.com  on behalf of Wolfgang 
Bangerth 
Sent: Thursday, January 16, 2020, 12:05 AM
To: dea...@googlegroups.com
Subject: Re: [deal.II] discontinous contour over elements

On 1/14/20 10:04 PM, David Eaton wrote:
>
> Thank you for your suggestions. I am going to take a look at Lethe and compare
> with my implementation. In stabilized formulation, I used quadrilateral
> element, instead of P2 P1 Taylor-Hood element. The used element is only C0
> element. I also did not expect such a discontinuity between elements. Although
> I use P2 P1 Taylor-Hood element without stabilization terms, the discontinuity
> is still there. Probably I made mistakes somewhere  in setup. I also suspect
> that my solution is not converged. After taking a small relative tolerance
> 1e-8, the discontinuity still appears.

David, you did not understand what we were saying: If you use C0 elements
(think, piecewise linear) and you take derivatives to compute the vorticity,
then you automatically get a discontinuous function. That has nothing to do
with stabilization, solver tolerances, etc. It's just a consequence of the
fact that C0 elements and their shape functions have kinks and consequently
their derivatives are discontinuous.

Best
  W.

--

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

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dea...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f03c64fc-3736-340a-1cdc-f24749fb413f%40colostate.edu.


--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
dealii+unsubscr...@googlegroups.com<mailto:dealii+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/bbe79d0e-d423-4df8-8f83-e4e934fedd7c%40googlegroups.com<https://groups.google.com/d/msgid/dealii/bbe79d0e-d423-4df8-8f83-e4e934fedd7c%40googlegroups.com?utm_medium=email_source=footer>.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SL2PR01MB2553926E27A0DC8D3638BCECC3370%40SL2PR01MB2553.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-15 Thread David Eaton
Professor Bangerth,

Thanks for the hints. I almost got what you mean. I will try to perform a L2 
projection.

Regards
David

From: dealii@googlegroups.com  on behalf of Wolfgang 
Bangerth 
Sent: Thursday, January 16, 2020, 1:03 AM
To: dealii@googlegroups.com
Subject: Re: [deal.II] discontinous contour over elements

On 1/15/20 9:22 AM, David Eaton wrote:
> I understand the C0 element is piecewise linear across elements. However, I
> did not experience the same issue in my own C++ code while I use C0 element
> with the Petrov Galerkin stabilization terms. Actually, I am very confused at
> this point. How could I get rid of it while using C0 element?

Not easily. But you can project the discontinuous function (namely, the
gradient or vorticity of your velocity) onto a continuous finite element
field. Then you again have a continuous function -- albeit a different one, of
course, from the one you actually wanted.

Best
  W.

--

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

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/4c39585b-55dd-c495-17b3-950b1e0f79d5%40colostate.edu.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SL2PR01MB255349EE978C91452641B41CC3370%40SL2PR01MB2553.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-15 Thread Bruno Blais
An easy way to carry the projection that Wolfgang suggested is to use an L2 
projection.
The L2 projection matrix is only a mass matrix and your right hand side is 
constructed by the integral of multiplication of the variable you want to 
project with the test function. Generally, this matrix is very very easy to 
invert. This will yield you the C0 representation of your discontinuous 
field (vorticity) such that the error between your C0 projection and your 
original field is minimized at the position of the gauss points.

This is a procedure we use to set the initial conditions in Lethe when the 
initial condition is a complex function (for instance a Taylor-Green 
vortex).


On Wednesday, 15 January 2020 11:22:52 UTC-5, David Eaton wrote:
>
> I understand the C0 element is piecewise linear across elements. However, 
> I did not experience the same issue in my own C++ code while I use C0 
> element with the Petrov Galerkin stabilization terms. Actually, I am very 
> confused at this point. How could I get rid of it while using C0 element?
>
> Thanks
> D.
>
> --
> *From:* dea...@googlegroups.com   > on behalf of Wolfgang Bangerth  >
> *Sent:* Thursday, January 16, 2020, 12:05 AM
> *To:* dea...@googlegroups.com 
> *Subject:* Re: [deal.II] discontinous contour over elements
>
> On 1/14/20 10:04 PM, David Eaton wrote:
> > 
> > Thank you for your suggestions. I am going to take a look at Lethe and 
> compare 
> > with my implementation. In stabilized formulation, I used quadrilateral 
> > element, instead of P2 P1 Taylor-Hood element. The used element is only 
> C0 
> > element. I also did not expect such a discontinuity between elements. 
> Although 
> > I use P2 P1 Taylor-Hood element without stabilization terms, the 
> discontinuity 
> > is still there. Probably I made mistakes somewhere  in setup. I also 
> suspect 
> > that my solution is not converged. After taking a small relative 
> tolerance 
> > 1e-8, the discontinuity still appears.
>
> David, you did not understand what we were saying: If you use C0 elements 
> (think, piecewise linear) and you take derivatives to compute the 
> vorticity, 
> then you automatically get a discontinuous function. That has nothing to 
> do 
> with stabilization, solver tolerances, etc. It's just a consequence of the 
> fact that C0 elements and their shape functions have kinks and 
> consequently 
> their derivatives are discontinuous.
>
> Best
>   W.
>
> -- 
> 
> Wolfgang Bangerth  email: bang...@colostate.edu 
> 
> www: http://www.math.colostate.edu/~bangerth/
>
> -- 
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dea...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/f03c64fc-3736-340a-1cdc-f24749fb413f%40colostate.edu
> .
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/bbe79d0e-d423-4df8-8f83-e4e934fedd7c%40googlegroups.com.


Re: [deal.II] discontinous contour over elements

2020-01-15 Thread Wolfgang Bangerth
On 1/15/20 9:22 AM, David Eaton wrote:
> I understand the C0 element is piecewise linear across elements. However, I 
> did not experience the same issue in my own C++ code while I use C0 element 
> with the Petrov Galerkin stabilization terms. Actually, I am very confused at 
> this point. How could I get rid of it while using C0 element?

Not easily. But you can project the discontinuous function (namely, the 
gradient or vorticity of your velocity) onto a continuous finite element 
field. Then you again have a continuous function -- albeit a different one, of 
course, from the one you actually wanted.

Best
  W.

-- 

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

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/4c39585b-55dd-c495-17b3-950b1e0f79d5%40colostate.edu.


Re: [deal.II] discontinous contour over elements

2020-01-15 Thread David Eaton
I understand the C0 element is piecewise linear across elements. However, I did 
not experience the same issue in my own C++ code while I use C0 element with 
the Petrov Galerkin stabilization terms. Actually, I am very confused at this 
point. How could I get rid of it while using C0 element?

Thanks
D.


From: dealii@googlegroups.com  on behalf of Wolfgang 
Bangerth 
Sent: Thursday, January 16, 2020, 12:05 AM
To: dealii@googlegroups.com
Subject: Re: [deal.II] discontinous contour over elements

On 1/14/20 10:04 PM, David Eaton wrote:
>
> Thank you for your suggestions. I am going to take a look at Lethe and compare
> with my implementation. In stabilized formulation, I used quadrilateral
> element, instead of P2 P1 Taylor-Hood element. The used element is only C0
> element. I also did not expect such a discontinuity between elements. Although
> I use P2 P1 Taylor-Hood element without stabilization terms, the discontinuity
> is still there. Probably I made mistakes somewhere  in setup. I also suspect
> that my solution is not converged. After taking a small relative tolerance
> 1e-8, the discontinuity still appears.

David, you did not understand what we were saying: If you use C0 elements
(think, piecewise linear) and you take derivatives to compute the vorticity,
then you automatically get a discontinuous function. That has nothing to do
with stabilization, solver tolerances, etc. It's just a consequence of the
fact that C0 elements and their shape functions have kinks and consequently
their derivatives are discontinuous.

Best
  W.

--

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

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f03c64fc-3736-340a-1cdc-f24749fb413f%40colostate.edu.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SL2PR01MB2553E34853B991625FBB2DADC3370%40SL2PR01MB2553.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-15 Thread Wolfgang Bangerth
On 1/14/20 10:04 PM, David Eaton wrote:
> 
> Thank you for your suggestions. I am going to take a look at Lethe and 
> compare 
> with my implementation. In stabilized formulation, I used quadrilateral 
> element, instead of P2 P1 Taylor-Hood element. The used element is only C0 
> element. I also did not expect such a discontinuity between elements. 
> Although 
> I use P2 P1 Taylor-Hood element without stabilization terms, the 
> discontinuity 
> is still there. Probably I made mistakes somewhere  in setup. I also suspect 
> that my solution is not converged. After taking a small relative tolerance 
> 1e-8, the discontinuity still appears.

David, you did not understand what we were saying: If you use C0 elements 
(think, piecewise linear) and you take derivatives to compute the vorticity, 
then you automatically get a discontinuous function. That has nothing to do 
with stabilization, solver tolerances, etc. It's just a consequence of the 
fact that C0 elements and their shape functions have kinks and consequently 
their derivatives are discontinuous.

Best
  W.

-- 

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

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/f03c64fc-3736-340a-1cdc-f24749fb413f%40colostate.edu.


Re: [deal.II] discontinous contour over elements

2020-01-14 Thread David Eaton
Dear Bruno,

Thank you for your suggestions. I am going to take a look at Lethe and compare 
with my implementation. In stabilized formulation, I used quadrilateral 
element, instead of P2 P1 Taylor-Hood element. The used element is only C0 
element. I also did not expect such a discontinuity between elements. Although 
I use P2 P1 Taylor-Hood element without stabilization terms, the discontinuity 
is still there. Probably I made mistakes somewhere  in setup. I also suspect 
that my solution is not converged. After taking a small relative tolerance 
1e-8, the discontinuity still appears. As Professor Wolfgang suggested, I am 
currently checking the convergence rate of this formulation. Thank you for your 
suggestions. If I cannot resolve this issue, I will update in the forum again.

Best
D.

From: dealii@googlegroups.com  on behalf of Bruno 
Blais 
Sent: Tuesday, January 14, 2020 9:53 PM
To: deal.II User Group 
Subject: Re: [deal.II] discontinous contour over elements

Dear David,
How are you calculating the vorticity?
As Wolfgang and Praveen have mentioned, if you are using the DataPostProcessor, 
then this will use your shape functions to calculate the vorticity. However, 
your P2-P1 elements are only C0 continuous. Consequently, your vorticity can 
possibly be inherently discontinuous at the element edges. However, I am 
surprised that you obtain such strong discontinuity. In our code based on 
deal.ii (https://github.com/lethe-cfd/lethe) we implement stabilized 
formulations for the NS equations and the vorticity results for such cases are 
very smooth (even when represented using discontinuous shape functions.

Have you established the convergence of your code using manufactured solution? 
This is the first thing I would suggest. You can look at the applications_tests 
of lethe for some examples of easy manufactured solutions for the 
Incompressible Navier-Stokes equations. There are also common books that treat 
this issue (for instance : 
https://www.amazon.ca/Verification-Validation-Scientific-Computing-Oberkampf/dp/0521113601)

Please feel free to reach out if you have more questions.
Best
Bruno




On Monday, 13 January 2020 20:29:53 UTC-5, David Eaton wrote:
Thanks Wolfgang and Praveen for providing suggestions. I have tried to 
debugging this code for a while. I have attached this simple code on this 
email. I followed the instructions in tutorial closely. Hopefully, anyone could 
give some suggestions.

Best
D.

From: dea...@googlegroups.com  on behalf of Wolfgang 
Bangerth 
Sent: Tuesday, January 14, 2020 6:24 AM
To: dea...@googlegroups.com 
Subject: Re: [deal.II] discontinous contour over elements

On 1/12/20 9:17 PM, David Eaton wrote:
> My inflow condition is uniform. This formulation and mesh is tested in a
> simple C++ code without library. The  large mesh near the inflow does not give
> this problem.
> Yes. I am using C0 element. I did calculation using tecplot. However, the
> results from a my C++ code does not give this issue either. Just now, I check
> the formulation again. Although I use Q2Q1 Taylor-Hood element without any
> stabilization, these issues are still happening.

David -- we don't really know what formulation you are using, how you are
implementing it, what you are comparing against, and a number of other factors.

If you have a formulation that computes u,p, and you are plotting the
vorticity, you need to expect that the isocontours are discontinuous for the
reasons Praveen already stated. If you are getting results that make no sense
to you, then the first step would be to ensure that your program is converging
as expected. To do this, choose a solution that you know and compute the error
norm; then ensure that the program yields error norms that decrease as
expected with mesh refinement.

Best
  W.

--

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

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dea...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/e1b55e95-a139-d62e-e786-61393cf84dc7%40colostate.edu.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
dealii+unsubscr..

Re: [deal.II] discontinous contour over elements

2020-01-14 Thread Bruno Blais
Dear David,
How are you calculating the vorticity?
As Wolfgang and Praveen have mentioned, if you are using the 
DataPostProcessor, then this will use your shape functions to calculate the 
vorticity. However, your P2-P1 elements are only C0 continuous. 
Consequently, your vorticity can possibly be inherently discontinuous at 
the element edges. However, I am surprised that you obtain such strong 
discontinuity. In our code based on deal.ii (
https://github.com/lethe-cfd/lethe) we implement stabilized formulations 
for the NS equations and the vorticity results for such cases are very 
smooth (even when represented using discontinuous shape functions.

Have you established the convergence of your code using manufactured 
solution? This is the first thing I would suggest. You can look at the 
applications_tests of lethe for some examples of easy manufactured 
solutions for the Incompressible Navier-Stokes equations. There are also 
common books that treat this issue (for instance : 
https://www.amazon.ca/Verification-Validation-Scientific-Computing-Oberkampf/dp/0521113601
)

Please feel free to reach out if you have more questions.
Best
Bruno




On Monday, 13 January 2020 20:29:53 UTC-5, David Eaton wrote:
>
> Thanks Wolfgang and Praveen for providing suggestions. I have tried to 
> debugging this code for a while. I have attached this simple code on this 
> email. I followed the instructions in tutorial closely. Hopefully, anyone 
> could give some suggestions.
>
> Best
> D. 
> --
> *From:* dea...@googlegroups.com   > on behalf of Wolfgang Bangerth  >
> *Sent:* Tuesday, January 14, 2020 6:24 AM
> *To:* dea...@googlegroups.com   >
> *Subject:* Re: [deal.II] discontinous contour over elements 
>  
> On 1/12/20 9:17 PM, David Eaton wrote:
> > My inflow condition is uniform. This formulation and mesh is tested in a 
> > simple C++ code without library. The  large mesh near the inflow does 
> not give 
> > this problem.
> > Yes. I am using C0 element. I did calculation using tecplot. However, 
> the 
> > results from a my C++ code does not give this issue either. Just now, I 
> check 
> > the formulation again. Although I use Q2Q1 Taylor-Hood element without 
> any 
> > stabilization, these issues are still happening.
>
> David -- we don't really know what formulation you are using, how you are 
> implementing it, what you are comparing against, and a number of other 
> factors.
>
> If you have a formulation that computes u,p, and you are plotting the 
> vorticity, you need to expect that the isocontours are discontinuous for 
> the 
> reasons Praveen already stated. If you are getting results that make no 
> sense 
> to you, then the first step would be to ensure that your program is 
> converging 
> as expected. To do this, choose a solution that you know and compute the 
> error 
> norm; then ensure that the program yields error norms that decrease as 
> expected with mesh refinement.
>
> Best
>   W.
>
> -- 
> 
> Wolfgang Bangerth  email: bang...@colostate.edu 
> 
> www: http://www.math.colostate.edu/~bangerth/
>
> -- 
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dea...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/e1b55e95-a139-d62e-e786-61393cf84dc7%40colostate.edu
> .
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/5843231a-5b39-4f47-8b8e-ca3061959295%40googlegroups.com.


Re: [deal.II] discontinous contour over elements

2020-01-13 Thread Wolfgang Bangerth
On 1/12/20 9:17 PM, David Eaton wrote:
> My inflow condition is uniform. This formulation and mesh is tested in a 
> simple C++ code without library. The  large mesh near the inflow does not 
> give 
> this problem.
> Yes. I am using C0 element. I did calculation using tecplot. However, the 
> results from a my C++ code does not give this issue either. Just now, I check 
> the formulation again. Although I use Q2Q1 Taylor-Hood element without any 
> stabilization, these issues are still happening.

David -- we don't really know what formulation you are using, how you are 
implementing it, what you are comparing against, and a number of other factors.

If you have a formulation that computes u,p, and you are plotting the 
vorticity, you need to expect that the isocontours are discontinuous for the 
reasons Praveen already stated. If you are getting results that make no sense 
to you, then the first step would be to ensure that your program is converging 
as expected. To do this, choose a solution that you know and compute the error 
norm; then ensure that the program yields error norms that decrease as 
expected with mesh refinement.

Best
  W.

-- 

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

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/e1b55e95-a139-d62e-e786-61393cf84dc7%40colostate.edu.


Re: [deal.II] discontinous contour over elements

2020-01-12 Thread David Eaton
My inflow condition is uniform. This formulation and mesh is tested in a simple 
C++ code without library. The  large mesh near the inflow does not give this 
problem.
Yes. I am using C0 element. I did calculation using tecplot. However, the 
results from a my C++ code does not give this issue either. Just now, I check 
the formulation again. Although I use Q2Q1 Taylor-Hood element without any 
stabilization, these issues are still happening.


From: dealii@googlegroups.com  on behalf of Praveen C 

Sent: Monday, January 13, 2020 12:04 PM
To: Deal. II Googlegroup 
Subject: Re: [deal.II] discontinous contour over elements

Is your inflow conditions uniform ? If not then large elements at inflow could 
introduce errors.

If you compute vorticity as curl of velocity pointwise, then the vorticity 
would be discontinuous at element boundaries, since you are using only C0 
elements for the velocity.

If you are averaging the computed vorticity or obtaining vorticity by an L2 
projection, then they would be continuous. Maybe your other codes are doing 
something like this ?

Best
praveen

On 13-Jan-2020, at 9:12 AM, David Eaton 
mailto:dealiidiscuss...@hotmail.com>> wrote:

(1) This stabilized formulation is tested and running in code without any 
issue. However, it seems that the velocity fileld near the inlet, the left of 
figure "entire_domain", has large disturbances.
(2) In figure "zoom_in_1", there is no irregularity of the streamline. 
Furthermore, the calculated lift and drag matches with the literature. It seems 
that the irregularity of flow field near the inlet is caused by very large 
elements. However, this issue is not observed in another code.
(3) The most weird issue to me is in figure "zoom_in_2". The contour of 
velocity, vorticity seems to be discontinuous to their neighboring elements. I 
believe I am using continuous Galerkin element and standard Gauss quadrature 
rule (4 Gauss integration points for 2D simulation). This issue does not appear 
in other codes using the same formation. Could anyone suggest a reason for this?



--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
dealii+unsubscr...@googlegroups.com<mailto:dealii+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/E1E13F63-7365-4328-9673-4073CDEED6CC%40gmail.com<https://groups.google.com/d/msgid/dealii/E1E13F63-7365-4328-9673-4073CDEED6CC%40gmail.com?utm_medium=email_source=footer>.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/SL2PR01MB25536AC37C6EFBBAA106913DC3350%40SL2PR01MB2553.apcprd01.prod.exchangelabs.com.


Re: [deal.II] discontinous contour over elements

2020-01-12 Thread Praveen C
Is your inflow conditions uniform ? If not then large elements at inflow could 
introduce errors.

If you compute vorticity as curl of velocity pointwise, then the vorticity 
would be discontinuous at element boundaries, since you are using only C0 
elements for the velocity.

If you are averaging the computed vorticity or obtaining vorticity by an L2 
projection, then they would be continuous. Maybe your other codes are doing 
something like this ?

Best
praveen

> On 13-Jan-2020, at 9:12 AM, David Eaton  wrote:
> 
> (1) This stabilized formulation is tested and running in code without any 
> issue. However, it seems that the velocity fileld near the inlet, the left of 
> figure "entire_domain", has large disturbances.
> (2) In figure "zoom_in_1", there is no irregularity of the streamline. 
> Furthermore, the calculated lift and drag matches with the literature. It 
> seems that the irregularity of flow field near the inlet is caused by very 
> large elements. However, this issue is not observed in another code.
> (3) The most weird issue to me is in figure "zoom_in_2". The contour of 
> velocity, vorticity seems to be discontinuous to their neighboring elements. 
> I believe I am using continuous Galerkin element and standard Gauss 
> quadrature rule (4 Gauss integration points for 2D simulation). This issue 
> does not appear in other codes using the same formation. Could anyone suggest 
> a reason for this?
> 

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/E1E13F63-7365-4328-9673-4073CDEED6CC%40gmail.com.