I am working with a sector of a cylinder mesh in 2D and I was wondering if reading a mesh with quadratic elements is possible. For example, I created a mesh in Gmsh (and converted it to XDMF using meshio) with quadratic triangles as shown in the figure.
The ideal case would be that I can read that mesh with dolfin and, when creating a quadratic continuous space the middle nodes were the same as the ones in the file. I tried to do that using the following code:
import dolfin as d mesh = d.Mesh() with d.XDMFFile('quadratic.xdmf') as infile: infile.read(mesh) V = d.VectorFunctionSpace(mesh, 'CG', 2) u = d.Function(V) xdmf = d.XDMFFile(mesh.mpi_comm(), 'quadratic_fenics.xdmf') xdmf.write_checkpoint(u, 'u', 0, d.XDMFFile.Encoding.HDF5, False) xdmf.close()
but the result is this
I know I can load a linear mesh and FEniCS will interpolate the elements to create the middle nodes like this:
But I lose geometrical accuracy that will matter in the convergence of my problem.
I do not know if this is possible or not. I will appreciate your guidance.