Closed drtloudon closed 7 months ago
This indicates that adios2 has not been installed with MPI support, as shown with the command:
conda install -c conda-forge adios2=*=mpi_* mpich mpi4py netcdf4
Please list the exact commands you ran, and the full traceback/output of this command.
The conda environment I created was loading an external adios2 package. Once I fixed that, I'm able to use the write_mesh function without error. However, when I go to load the created xdmf mesh inside dolfinx using:
from dolfinx import io from mpi4py import MPI with io.XDMFFile(MPI.COMM_WORLD, 'quarter_shell_tet.xdmf', 'r') as file: mesh = file.read_mesh(name='Grid')
I get the error:
Traceback (most recent call last):
File "/home/tloudon/Research/Elasticity/ShearLocking/test.py", line 3, in
Any help is appreciated. Thanks.
Please add the contents of the xdmf file here
The contents of quarter_shell_tet.xdmf are
<?xml version="1.0"?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<XDMF Version="3.0" xmlns:xi="http://www.w3.org/2001/XInclude"><Domain><Grid GridType="Uniform" Name="Mesh"><Topology NumberOfElements="4399" TopologyType="Tetrahedron" NodesPerElement="4"><DataItem Dimensions="4399 4" Format="HDF">quarter_shell_tet.h5:/Step0/Connectivity_tetra</DataItem></Topology><Geometry GeometryType="XYZ"><DataItem Dimensions="1615 3" Format="HDF">quarter_shell_tet.h5:/Step0/Points</DataItem></Geometry><Attribute Name="Cell markers" AttributeType="Scalar" Center="Cell"><DataItem Dimensions="4399" Format="HDF" DataType="Int">quarter_shell_tet.h5:/Step0/Cell_Markers</DataItem></Attribute></Grid><Grid GridType="Uniform" Name="Facet_Mesh"><Topology NumberOfElements="3220" TopologyType="Triangle" NodesPerElement="3"><DataItem Dimensions="3220 3" Format="HDF">quarter_shell_tet.h5:/Step0/Connectivity_triangle</DataItem></Topology><Geometry GeometryType="XYZ"><DataItem Dimensions="1615 3" Format="HDF">quarter_shell_tet.h5:/Step0/Points</DataItem></Geometry><Attribute Name="Facet markers" AttributeType="Scalar" Center="Cell"><DataItem Dimensions="3220" Format="HDF" DataType="Int">quarter_shell_tet.h5:/Step0/Facet_Markers</DataItem></Attribute></Grid></Domain></XDMF>
That looks ok to me. Could you try to open it in paraview and see if it looks ok?
could you Also try:
read_mesh(name="Mesh")
or is it opening the file that fails?
It's opening the file that throws the error. I can modify the code to:
from dolfinx import io
from mpi4py import MPI
file = io.XDMFFile(MPI.COMM_WORLD, 'quarter_shell_tet.xdmf', 'r')
and get the error. I put name='Grid' because previously I've used meshio where 'Grid' was the default name. Everything looks normal in Paraview. Even if I remove the facet blocks from the exodus file before converting to xdmf, I still get the same empty root node error.
That’s weird. Could you provide the xdmf and h5 file somewhere? Then I can run it tomorrow.
I emailed them to you. Not sure what the "accepted" method for sharing files is. Thanks again for your help.
Got the email. Will have a look tomorrow or sometime this weekend.
@drtloudon I've pushed a fix for the issue. Turns out DOLFINx has specific caps dependencies on the root note "Xdmf", which I initally wrote as "XDMF", as it works with Paraview.
Thanks for your help.
Following your example, when I try to write an exodus mesh to xdmf format using the write_mesh function, I get the following error:
TypeError Traceback (most recent call last)