lagrangian element selection

Numerical methods and mathematical models of Elmer
Post Reply
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

lagrangian element selection

Post by spacedout »

Hi

Let's say I have a given triangular mesh (generated by Gmesh and transformed by ElmerGrid into the ElmerSolver format)

How do I setup a given solver in the SIF to use linear Lagrange elements and another one to use quadratic Lagrange elements ?

Also how would I tell a solver to use discontinuous Lagrange elements of first order for internal boundary elements within the mesh ?

All replies welcome
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: lagrangian element selection

Post by raback »

Hi,

Probably you cannot combine 1st and 2nd order Lagrange elements with the same mesh. Lagrange element always follows the number of nodes in the element.

You can have different p-elements. E.g. "Element = p:2". This uses the lowest order Lagrange elements for the shape but the order of elements may be freely chosen. Not all solvers support p-elements.

For the solvers that understand DG you can request "Discontinuous Galerking = True". It is a property of the bulk elements. You can eliminate the discontinuity within materials but you cannot ask just one boundary to have DG elements.

-Peter
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: lagrangian element selection

Post by kevinarden »

Example of mixing 1st and 2nd order Lagrange elements in same mesh using mortar boundaries to enforce the boundary between the two.
Using gmsh to create two parts and ElmerGrid to increase the order of one part and unite two parts in one mesh.

ElmerGrid 14 2 part1.msh -autoclean
ElmerGrid 14 2 part2.msh -increase -autoclean
ElmerGrid 2 2 part1 -in part2 -unite -out mesh
example.zip
(1.79 KiB) Downloaded 11 times
result.png
result.png (10.55 KiB) Viewed 199 times
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

Re: lagrangian element selection

Post by spacedout »

Actually, what spurred my post was an article entitled

Fluid Modelling of Dielectric Barrier Discharges for Plasma Technology

by Jovanovic et al.

Their research uses Comsol and in a given domain, they have linear Lagrange elements for continuity equations and quadratic Lagrange elements for the Poisson equation.

Now, for a quadratic Lagrange element, the locations of the non vertex nodes on a standard reference element are the mid points on the edges. After appropriate mapping from this standard element, the solver would know where these extra nodes are located for each element of my input Gmsh mesh. All elements in my mesh have straight edges. Therefore that mesh could be used for both linear and quadratic elements.

And, after reading either my old FEM course notes or the reference in the ElmerSolver manual authored by Szabo and Babuska or the Comsol documentation, I found out that quadratic Lagrange elements gives a more accurate solution when dealing with 2nd order equations like the Poisson equation.

But it is also pointed out that in the quadratic case, the standard element maps to a curved element. These would be more suitable for a curved domain. The resulting mesh would be different from the one I am inputting to Elmer.

So I am confused with this double usage of quadratic Lagrange elements where the shape functions seems to be used to modify the solution as well as the mesh.
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: lagrangian element selection

Post by raback »

Hi

I don't think the "double usage" is anything special. This lies in the very heart of isoparametric elements. Here is one paper from 1968...
https://www.sciencedirect.com/science/a ... 8368900310

Now there is a pragmatic reason not improve the geometry description using the center nodes (or the p:2 bubble): We might just not know the shape. For example, if you save your mesh in Comsol in .mphtxt format you can import the mesh into Elmer. However, no matter whether you used 1st or 2nd order elements in Comsol the .mphtxt will always just include corner nodes. So we cannot much improve on that. This is the case for many workflows.

(Btw, do we actually know whether Comsol uses Lagrange elements or p-elements to construct the higher order basis?)

This may actually be a real problem. Some time ago we tried to match capacitance of two cocentric cylinders and tested higher order p-elements. The solution does not really converge to the desired one unless you also describe the shape of the cylinders with higher order elements. Now for cylinders this is easy if we provide the meta-information that the shape is a cylinder. We just added information on the BC "Follow Cylinder Boundary = Logical True" and coded some functionality to fit the elements.

These are available as test cases using p, h, and ph strategy:
$ELMERSRC/fem/tests/CurvedBoundaryCyl*

Unfortunately most curved shapes are not ideal so if you currently want to use high order p-element for those you do not obtain optimal convergence with element size. What could be done is to provide more accurate surface description with STL, for example, and map the shape to that.

-Peter
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: lagrangian element selection

Post by kevinarden »

Not the case in the paper, but demonstrates how different order elements can be used in different solvers using P elements.
case.sif
(3.61 KiB) Downloaded 11 times
results.png
results.png (112.95 KiB) Viewed 166 times
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

Re: lagrangian element selection

Post by spacedout »

Thank you both for the detailed replies. There are indeed a lot of articles, books, and courses that deal with these isoparametric elements.
Fortunately, my mesh elements have only straight edges. It is very refined around a curved airfoil so that I don't think it matters if it follows the curved arcs of the airfoil or not. I suppose I will still use quadratic elements or p-elements for better accuracy of the 2nd order equations like the Poisson equation.

Now, in the plasma article I mentioned before, discontinuous Lagrange elements of first order are used for the surface charge density Sigma accumulating at the plasma dielectric interface. The equation is
dSigma/dt = sum of the normal ion flux at the interface over all ions where each term is proportional to
(ion mobility * abs (electric field) + ion diffusivity factor ) * ion density
Is there a physical or mathematically reason for these Lagrange elements to be discontinuous ?
Are they talking about boundary Lagrange elements (since Sigma only exists on the interface) ?

Note that the boundary condition on that interface for the Poisson equation is
epsilon1*En1 - epsilon2*En2 = Sigma (for example Elmer's StatElecSolve would use the SIF's surface charge density keyword assigned to Sigma in order to set this normal discontinuity equation)
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: lagrangian element selection

Post by kevinarden »

I don't think there is a physical or mathematical reason for the elements to be discontinuous at the interface. I believe their reason is the mesh refinement is much finer in the plasma than it is in the dielectric. They likely did this to save total number of DOFs to solve. However it is not a requirement, but an option. When you have non-conforming meshes the boundary elements, with mortar conditions, can provide the boundary interface.
mesh.png
mesh.png (172.86 KiB) Viewed 119 times
Post Reply