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 <javascript:> <dea...@googlegroups.com > <javascript:>> on behalf of Wolfgang Bangerth <bang...@colostate.edu > <javascript:>> > *Sent:* Thursday, January 16, 2020, 12:05 AM > *To:* dea...@googlegroups.com <javascript:> > *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 > <javascript:> > 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 <javascript:>. > 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.