AMR XML file structure for many AMR blocks?

Hello all,

I am trying to write an AMR writer for our AMR code. So far, we just write UnstructuredGrid in .vtu files. However, we would like to make use of the vtkNonOverlappingAMR or vtkOverlappingAMR support because we expect it to remove lots of unnecessary overhead. Our code has a 2:1 refinement restriction and decomposes the whole domain into blocks of uniform grids. For the total domain, we can have millions of these blocks. My Problem is now, how to structure the XML files to combine several of the blocks in one file. So far, I only have one block per file:

example.zip (9.8 KB)

I tried to put several ImageData in one file, but paraview seems to just drop all ImageData except for one in this case. What would be your recommendations for this problem?

Thank you all in advance,
Markus

While XML file formats supports that, I would recommend trying out VTKHDF format:
https://docs.vtk.org/en/latest/design_documents/VTKFileFormats.html#vtkhdf-file-format

Thank you very much for your answer!

I still don’t understand how XML would support that. In the example I provided, 8 AMR blocks are on the same level, but the data is stored in different files. I would like to have only 2 files. One for level 0 and one for level 1. However, putting the ImageData of one file to another does not work for ParaView somehow. Also, storing the data once I have loaded it into ParaView leads to the same result. ParaView creates one file for each block of data.

I did not look into the HDF5 support so far, but does this also support a ParallelReader? What is the big advantage using HDF5 instead of the XML format?

Best,
Markus

I did not look into the HDF5 support so far, but does this also support a ParallelReader?

Yes, I think so, but I defer to @Lucas_Givord

What is the big advantage using HDF5 instead of the XML format?

A single file instead of hundreds of files