Recovering pyfrm files

A while ago, I ran a simulation and saved the .pyfrs files. I didn’t save the .pyfrm file used to run it but I did save the .msh file that was used to generate it. i thought i could always regenerate the pyfrm file.

coming back to it, I created a new .pyfrm file with the same mesh, and tried to use it afterwards and export all the .pyfrs files. however, this didn’t work. the error message I got was

" Solution “aeror_0.0970.pyfrs” was not computed on mesh “coarse_mesh.pyfrm”.

is there anything to do or are these results lost for me?

1 Like

This is a bit of a tricky situation. Because there is no guarantee that the elements will have the same numbers when you remake the pyfrm file, you might not be able to recover it. For this reason the there is a mesh_uuid saved in the pyfrs file which is based off the hash of the mesh file and uniquely ties the pyfrs and pyfrm files together. What you can try doing is re-import the msh file and then change the uuid in the pyfrm file to match that in the pyfrs file. This can be done with h5py in a fairly straightforward manner. If the pyfrs files are partitioned then you will need to partition the mesh before changing the uuid. But if they were partitioned then this makes this less likely to be correct.

Ultimately, if you use the same msh file and change the uuid you will be able to export the solution files, but they might not be correct and it could be hard to tell that they’re wrong. I just give this as a warning that the validity of the results might be questionable.

To give yourself the best chance of this working I would try and use same version of pyfr.

There are some interpolation tools for PyFR that could do the work if you cannot manage to recreate a mesh with the same element ordering.
See the supplementary material found in Identifying eigenmodes of averaged small-amplitude perturbations to turbulent channel flow | Journal of Fluid Mechanics | Cambridge Core

thanks everyone for your answers. In my case I decide to rerun the simulation (~10 days) rather than attempt recovery). I am sure the answers will be usefull for future users

1 Like