How to Use Isoparametric Elements with P2-P1 in FEniCSx for DFG 2D-2 Benchmark?

How to Use Isoparametric Elements with P2-P1 in FEniCSx for DFG 2D-2 Benchmark?

Hello everyone,

I’m new to using DOLFINx in FEniCSx and I’m interested in employing isoparametric elements to enhance my simulations. Specifically, I would like to use the P2-P1 Taylor-Hood elements to solve the Navier-Stokes equations as part of the DFG 2D-2 benchmark.
geometry

My main goal is to achieve a more accurate representation of the circular geometry within my simulation. Although I’ve found a demo online (thanks to Test problem 2: Flow past a cylinder (DFG 2D-3 benchmark) — FEniCSx tutorial), it doesn’t seem to utilize isoparametric elements for this purpose. I’m unsure how to proceed—should I modify the mesh generation process, alter the type of elements used, or consider other changes?

I would greatly appreciate any guidance, tutorials, or resources on how to effectively implement this in FEniCSx.

Thank you!

Im not sure what you mean, the DFG-2 tutorial you reference above uses second order quadrilateral elements for the geometry, that would make it «isoparametric» in the sense that it is of the same order as the velocity space.

Thank you for your quick response.

By “isoparametric”, I am referring to the functionality that enables the creation of elements that are nonrectangular and have curved sides. I think it can be used to more precisely approximate the shape of a circle.
picture

I am uncertain if the code I referenced employs this functionality, as there was no indication that it instructs Fenicsx to curve the mesh to more closely conform to a circular shape.

It does, as i have already mentioned the mesh is higher order, made possible in the line:

Generating the mesh#

We are now ready to generate the mesh. > However, we have to decide if our mesh should consist of triangles or quadrilaterals. In this demo, to match the DFG 2D-3 benchmark, we use second order quadrilateral elements.

    gmsh.model.mesh.generate(gdim)
    gmsh.model.mesh.setOrder(2)
    gmsh.model.mesh.optimize("Netgen")
1 Like

Thank you very much for your patient and detailed explanation. It has completely resolved my questions and enhanced my understanding. I really appreciate your help and the time you took to address my issue.

Just to confirm: Does this mean that I only need to create high-order grids (e.g., using gmsh) in order to enable isoparametric elements? Is it the same for both 2D and 3D?

Yes. We can read in Gmsh meshes that are 1st, 2nd and 3rd order.

In general dolfinx supports arbitrary order meshes, as shown in
http://jsdokken.com/FEniCS23-tutorial/src/mesh_generation.html#higher-order-meshes

Dolfinx itself doesn’t need to use isoparametric elements (as the mesh geometry and function spaces are decoupled), but you can of course use it.

1 Like

Thank you so much for your reply. How amazing Fenicsx is!

Dear dokken, I am also interested in this problem. But I am a little bit confused about this.

Could you explain more about "no need to use isoparametric elements? I wonder how it could it work if the mesh is in higher order. For example, if the mesh is in 2nd order, how does fenicsx construct the basis functions and the function spaces?

Dolfinx uses Basix to construct basis functions. Basix supports arbitrary order tabulation of a range of Finite elements.

In turn, we use one Finite element to describe the mesh geometry (a coordinateelement), which is used for jacobian computations and push forward/pull back routines.

Then, on top of this, you can use any supported finite element of any order to create your FunctionSpace, trial and testfunctions

3 Likes