I am new to fenics and want to do a quite simple task, but having some troubles.
I solved a lot of pressure/velocity fields in a permanent regime and saved them in XMDF/H5 format.
I have only saved the velocity field (2 dimensional).
Now, I want to open it in python to generate a visualization (yes, I want to do it with python since I have an issue with the files to open them all in paraview).
However, I don’t know how to open a file. I’ve tried some internet found solutions, but they didn’t work.
I would appreciate it if someone could share a bit of code, so I could open those files. It would also be nice if you could tell me how to get the coordinates (x,y) and velocity (U) from this file.
If you are using legacy fenics, the 2 ways to do this are
Saving the solution in an XDMFFile with write_checkpoint and reading it back in with read_checkpoint. Some useful info can be found in this post.
Saving the solution in a HDF5File with the 'w' (write) argument, which can then be read back into python using the 'r' (read) argument. Some relevant info is in this post.