Hi all,
After a recent update to latest nightly dolfinx build, I realize that an example where I have “triangle3D” elements isn’t working anymore. MWE to reproduce:
#!/usr/bin/env python3
from mpi4py import MPI
from dolfinx import fem, io
import ufl
comm = MPI.COMM_WORLD
meshname='triangle3D.xdmf'
with io.XDMFFile(comm, meshname, 'r', encoding=io.XDMFFile.Encoding.ASCII) as infile:
mesh = infile.read_mesh(name="Grid")
V_s = fem.FunctionSpace(mesh, ("CG", 1))
V_v = fem.VectorFunctionSpace(mesh, ("CG", 1))
V_t = fem.TensorFunctionSpace(mesh, ("CG", 1))
where the mesh file “triangle3D.xdmf” is
<Xdmf Version="3.0">
<Domain>
<Grid Name="Grid">
<Geometry GeometryType="XYZ">
<DataItem DataType="Float" Dimensions="3 2" Format="XML" Precision="8">
0.0 0.0 0.0
1.0 0.0 0.0
0.0 1.0 0.0
</DataItem>
</Geometry>
<Topology NodesPerElement="3" NumberOfElements="1" TopologyType="triangle">
<DataItem DataType="Int" Dimensions="1 3" Format="XML" Precision="4">
0 1 2
</DataItem>
</Topology>
</Grid>
</Domain>
</Xdmf>
Problem: CG vector and tensor function space creations fail with the error ufl.log.UFLException: Non-matching cell of finite element and domain., whereas scalar funtion space creation works.
Remedy would be to use a 2D triangle specifying only “GeometryType=“XY”” in the xdmf file. But, I wonder if some functionality has been removed for the triangle3D case, or if this is a bug. Because I can confirm that this example worked for dolfinx from 28 Aug 2022 or earlier.
Thanks!
Best,
Marc