Hi everyone,
I am quite new to FeniCSx, I have dolfinx 0.7.2 installed.
I am sharing a code below, which is creating a 1D mesh, exporting it as an XDMF file, and importing it back to build a FunctionSpace.
By running this code, I get the following error: ValueError: Non-matching UFL cell and mesh cell shapes.
Any ideas of what is causing this? Thank you in advance.
# FeniCSx
from basix.ufl import element, mixed_element
from dolfinx import mesh, fem
from dolfinx.fem import Function, FunctionSpace
from dolfinx import io
from mpi4py import MPI
nel = 30 # number of elements per domain
msh = mesh.create_interval(comm=MPI.COMM_WORLD, nx=3*nel, points=(0, 3))
with io.XDMFFile(msh.comm, "./samples/mymesh.xdmf", "w") as xdmf:
xdmf.write_mesh(msh)
with io.XDMFFile(MPI.COMM_WORLD, "./samples/mymesh.xdmf", "r") as xdmf:
msh2 = xdmf.read_mesh()
finite_element = element("P", msh2.basix_cell(), 1)
V = FunctionSpace(msh2, finite_element)