Correct way to write and transport XDMF?

Hello

I just ran some Fenics simulation and save the results(multiple fields) in XDMF, it generates a relatively large file output.h5 and a relatively small file output.xdmf, the strange thing is when I copied and pasted the files to my flash drive (for some reason I can’t use Paraview on the machine that ran this simulation so I have to transfer the output to a different machine), it keeps getting stuck in 99%, I wonder if I generated the files in a wrong way, I am including a sample of how I save the outputs, let u be the Fenics solution that contains multiple(N) fields at time t,

``f = XDMFFile(“output.xdmf”)
for t in range(######):

######## some code solving for u

(tap) foo = u.split(deepcopy=True)
(tap) for I in range(N):
(tap)(tap) U = foo[ j ]
(tap)(tap) U.rename( “u_”+str(j+1), “tmp” )
(tap)(tap) f.write( U, t )

``

Update: I have tried a few different flash drives and none of them could finish transferring the output file.

Update: I ran another simulation and included f.close() after getting all output written out, this didn’t resolve the problem

Update: I tried transferring two output files separately, the .xdmf had no trouble getting into the flash drive, but the .h5 file keeps getting stuck around 94%

It sounds like there might be something defective with the computer hardware, or perhaps with the software (operating system). The xdmf files are just files, nothing special about them in terms of copying to a USB stick.

The .h5 is the large file as you saw. Check there is enough space on your USB stick to hold it.

You can check the integrity of the files on your computer. Load the .xdmf into a simple text editor. You be able to read it as plain text (it’s an xml document). Then trying opening it with your web browser (firefox). Depending on your browser, it can verify the xml is properly formed (you can click on the entries to open and close the various fields).

There are a handful of HDF5 viewers that you can use to inspect the .h5 document, to check it reads normally. At the command line, h5dump prints the data (h5dump is provided in the hdf5-tools package). h5stat reports structural information about the file. HDFCompass (from the hdf-compass package) provides a graphical user interface to inspect HDF5 files.

Thanks for your advice! Actually I just left the flash drive connected as well as the file transfer (stuck at 94%) and I worked on something else, and somehow the transfer was magically completed. I was able to load the files on preview after. I guess there’s something to do with my computer configuration, it’s been acting up. Anyway thank you for your information on checking the output files.