Are 3rd-order elements supported for Paraview visualization with XDMFFile.write_checkpoint()?

Hi all! I’m attempting to visualize a 3rd-order Lagrange function over the unit square in Paraview with XDMFFile.write_checkpoint(). This works as expected for linear and quadratic elements, but not for 3rd, 4th, 5th, etc-order elements. This functionality is supported by Paraview (>=5.5.0) as best I can tell. See the MWE below:

from dolfin import *
mesh = UnitSquareMesh(1,1)
k = 3   # high-order visualization is linear with k>2
V = FunctionSpace(mesh,"Lagrange",k)
expr = Expression("x[0]*x[0]*x[1]*x[1]",degree=2*k)
u = interpolate(expr,V)

Here is a sample plot with k = 2, which works as expected:

Here is a sample with k = 3, which does not work as expected:

I am using the following:

  • FEniCS 2019.0.1 installed on Docker
  • Paraview 5.8.1 installed on Windows 10 from Download | ParaView

Thanks in advance for your assistance!

I’m not sure if this will help, but don’t you need to change the expression to higher order ?

Thanks for the thought, but raising the Expression degree did not help since it is already set to 2*k. (I tried degree=3*k and got the same results.)

As far as I am aware, the XDMFFile.write_checkpoint does not support higher order than 2 (as it is based on VTK prior to: Modeling Arbitrary-order Lagrange Finite Elements in the Visualization Toolkit - Kitware Blog).

If you want to use Paraview to visualize higher order functions, I would suggest switching to dolfinx and usage of the VTXWriter as it supports higher order Lagrange/DG elements on triangles. For usage, see: dolfinx/ at d965f6eb744bfd20be773ac9009f2861540b7855 · FEniCS/dolfinx · GitHub


Copy that, thanks so much @dokken and @Kei_Yamamoto for your replies, it’s appreciated! That makes sense to me. Cheers!