Von mises stress calculation of elasticity

Hi, everyone. I followed The FEniCSx tutorial to study how to calculate the displacement and the von Mises stress of an elastic body. I got the same deformation result as shown in the example, but when I calculated the stress I met some errors below:
HDF5-DIAG: Error detected in HDF5 (1.14.3) MPI-process 0:
#000: H5F.c line 660 in H5Fcreate(): unable to synchronously create file
major: File accessibility
minor: Unable to create file
#001: H5F.c line 614 in H5F__create_api_common(): unable to create file
major: File accessibility
minor: Unable to open file
#002: H5VLcallback.c line 3605 in H5VL_file_create(): file create failed
major: Virtual Object Layer
minor: Unable to create file
#003: H5VLcallback.c line 3571 in H5VL__file_create(): file create failed
major: Virtual Object Layer
minor: Unable to create file
#004: H5VLnative_file.c line 94 in H5VL__native_file_create(): unable to create file
major: File accessibility
minor: Unable to open file
#005: H5Fint.c line 2018 in H5F_open(): unable to read superblock
major: File accessibility
minor: Read failed
#006: H5Fsuper.c line 392 in H5F__super_read(): file signature not found
major: File accessibility
minor: Not an HDF5 file
Traceback (most recent call last):
File “/mnt/fghs/share/linearelasticity_code.py”, line 138, in
with io.XDMFFile(domain.comm, “deformation.xdmf”, “w”) as xdmf:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Failed to create HDF5 file.
I use FEniCSx v0.7.0 which was installed by conda with the help of the code on the FEniCS Download webpage. Any advice for this problem?

That sounds like an error when trying to create the file itself. Is the disk mounted with the correct permissions? Is there enough free space?

Hi Wen, I found a post here which has a solution from hyjin86. It looks like the file is locked or protected. Hope it works!

I use a virtual machine in Win and run the code in root. I use the command ‘’ df -h’’ which shows that there is enough space.

You seem to be running the code in a mounted disk whgfs-fuse. Try running the same code in your home: if the error is not there anymore, then it is due to the mount options you chose.

Thank you for your help!! It works and there is no error now. But I still cant get the image of the stress, the result I get like this:


which is far from the result shown in the tutorial

Thanks for your advice. I changed the position and the code runs without error, but the result seems not right like this;

You may try Paraview, but your image looks nothing like the one in tutorial (assume we’re talking about the same demo):


Also you could print out some numbers.

It seems that we are talking about different ones. The result is like this:


I’ll learn how to use Paraview, thanks for your help.

You might be interested in this: Visual representation (interpolation) of a 2nd order tensor in a 3D space (recipe)

It is totally unexpected that I have exactly the same problem, I sourced export HDF5_USE_FILE_LOCKING=FALSE in .bash_profile, but nothing happened, the errors were still there. This is wired. Both 2019.1.0 docker image and standalone 2019.2.0.dev show same error. So may I ask what did you do?

I just gave up using Pyvista after trying many times. I export the result as a .xdmf file to visualize it in Paraview

I’m saying the HDF5 error, sorry.