Dear FEniCS community,
I’m facing a Paraview crash when exporting files from the latest stable release of Dolfinx. Even the most simple example is failing. For instance, the Poisson_demo taken from Dolfinx repo:
from petsc4py.PETSc import ScalarType # type: ignore
# +
import numpy as np
import ufl
from dolfinx import fem, io, mesh, plot
from dolfinx.fem.petsc import LinearProblem
from ufl import ds, dx, grad, inner
# +
msh = mesh.create_rectangle(comm=MPI.COMM_WORLD,
points=((0.0, 0.0), (2.0, 1.0)), n=(32, 16),
cell_type=mesh.CellType.triangle)
V = fem.functionspace(msh, ("Lagrange", 1))
facets = mesh.locate_entities_boundary(msh, dim=(msh.topology.dim - 1),
marker=lambda x: np.logical_or(np.isclose(x[0], 0.0),
np.isclose(x[0], 2.0)))
dofs = fem.locate_dofs_topological(V=V, entity_dim=1, entities=facets)
bc = fem.dirichletbc(value=ScalarType(0), dofs=dofs, V=V)
# +
u = ufl.TrialFunction(V)
v = ufl.TestFunction(V)
x = ufl.SpatialCoordinate(msh)
f = 10 * ufl.exp(-((x[0] - 0.5) ** 2 + (x[1] - 0.5) ** 2) / 0.02)
g = ufl.sin(5 * x[0])
a = inner(grad(u), grad(v)) * dx
L = inner(f, v) * dx + inner(g, v) * ds
# -
# +
problem = LinearProblem(a, L, bcs=[bc], petsc_options={
"ksp_type": "preonly", "pc_type": "lu"})
uh = problem.solve()
# -
# +
with io.XDMFFile(msh.comm, "out_poisson/poisson.xdmf", "w") as file:
file.write_mesh(msh)
file.write_function(uh)
make Paraview crash. If I only do file.write_mesh(msh)
, then it works. Something fails on my side when using file.write_function(uh)
.
I have tested the following dolfinx builds:
Docker image dolfinx/dolfinx:v0.7.3
Dolfinx intalled on docker image ubuntu:jammy
using PPA
Anaconda env fenics-dolfinx
Paraview versions tested are 5.11.0, 5.11.1, 5.11.2 and 5.12.0RC on Linux, Windows and MACOS with X86 and ARM systems.
I could upload the crash report from Paraview but I don’t know how. I put a link to share:
I appreciate any help.