I’m still facing an error when exporting using VTK. The MWE is as follows.
# +
from mpi4py import MPI
from dolfinx import fem, io, mesh
# +
msh = mesh.create_rectangle(comm=MPI.COMM_WORLD,
points=((0.0, 0.0), (2.0, 1.0)), n=(2, 2),
cell_type=mesh.CellType.triangle)
V = fem.functionspace(msh, ("DG", 1))
uh = fem.Function(V)
uh.interpolate(lambda x: x[0])
with io.VTKFile(msh.comm, "out_poisson/poisson.vtk", "w") as file:
file.write_mesh(msh)
file.write_function(uh)
EDIT: change from VTX to VTK.