CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Accessing data generated by flexi (DGSEM solver) (https://www.cfd-online.com/Forums/main/238171-accessing-data-generated-flexi-dgsem-solver.html)

jnanabrao August 27, 2021 06:46

Accessing data generated by flexi (DGSEM solver)
 
1 Attachment(s)
Dear all,


I have recently started working on the Discontinuous Galerkin Spectral Element Method opensource solver flexi. I am able to run the tutorials and even some advanced cases using it. However, I cannot access the solution values as they are saved in hdf5 format in binary files.



I can visualize them when the state file sizes are smaller than 2GB in paraview. This requires converting the hdf5 files to vtu format using the "posti_visu" converter shipped with the code. However, as we go to higher order and finer meshes, the files become much larger in size and paraview crashes in trying to open them. I compiled the paraview reader that was shipped with the code so that I could directly open the hdf5 files with paraview. But on loading the reader and trying to open a state file with it I get a negative class id error and paraview crashes again.


What I would like is a way to access property values in the hdf5 solution files itself as that would allow me to select the necessary data from the 3D domain and postprocess it as needed. However, as the data is written in binary format it doesn't allow access to hdfview software. Is there a way to extract the relevant data from the hdf5 state files? Meanwhile, any help with opening large vtu files or solving the negative class id error associated with the paraview reader is also most welcome.


A sample state file of the cavity tutorial is attached for reference.



JBR

Eifoehn4 August 28, 2021 05:49

Dear jnanabrao,

please share some more information otherwise no one can help you.
  • What OS do you use?
  • What Paraview version do you use?
  • What HDF5 version do you use?
  • What OPENMPI version do you use?
  • Do you use precompiled release versions, the system versions or self compiled versions?
  • ...

jnanabrao August 28, 2021 06:11

1 Attachment(s)
Hi Eifoehn4,


OS : Ubuntu 20.04LTS


Paraview versions: I have 5.6.0 built from source code and 5.9.1 precompiled. The paraview reader was compiled with 5.6.0, although I had to obtain some vtk files separately that weren't present in the VTK library that came with 5.6.0



HDF5: please see attachment


Open MPI: 4.0.3



Code:

Do you use precompiled release versions, the system versions or self compiled versions?
I'm not sure which software this question is for.


flexi:Release version



JBR

Eifoehn4 August 28, 2021 06:52

If you want to use the Paraview reader you have to make sure that FLEXI and Paraview are built with the same HDF5 Libraries. Moreover, HDF5 has to be built with FORTRAN and Parallel support. I would recommend to precompile HDF5 and OpenMPI on your own and use them for FLEXI and Paraview.

OpenMPI:

Code:

./configure --enable-static --enable-mpi1-compatibility --prefix=/opt/openmpi/...
HDF5:

Code:

cmake -DBUILD_TESTING=OFF -DHDF5_BUILD_FORTRAN=ON -DHDF5_BUILD_CPP_LIB=OFF -DHDF5_BUILD_EXAMPLES=OFF -DHDF5_ENABLE_PARALLEL=ON -DHDF5_BUILD_HL_LIB=ON -DHDF5_BUILD_TOOLS=ON -DHDF5_ENABLE_F2003=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/hdf5/…
Make sure your environment variables are set correctly that CMAKE finds the precompiled OpenMPI and HDF5 versions:
  • PATH
  • LD_LIBRARY_PATH
  • CMAKE_PREFIX_PATH
  • CMAKE_LIRBRARY_PATH
  • CMAKE_INCLUDE_PATH

After that compile Paraview 5.6.0 with:

Code:

cmake .. -DCMAKE_BUILD_TYPE=Release -DPARAVIEW_USE_MPI=ON -DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON -DPARAVIEW_USE_PYTHON=ON -DPARAVIEW_ENABLE_PYTHON=ON -DVTK_USE_SYSTEM_HDF5=ON -DHDF5_IS_PARALLEL=ON -DHDF5_PARALLEL=ON -DVTK_MODULE_vtkhdf5_IS_SHARED=OFF -DCMAKE_INSTALL_PREFIX=/opt/paraview/…
After that set the Paraview path in the environement variables mentioned above and compile FLEXI:

Code:

See FLEXI docu ...
The 2GB VTK issue should be asked in a Paraview related forum.

Regards

jnanabrao August 30, 2021 12:52

After a few hiccups, it is working! Thanks a lot!



One tiny note:- To build paraview, I couldn't do without the mpi-cxx libraries and hence had to build those for openmpi with --enable-mpi-cxx option along with the rest of the configurations same as pointed out for openmpi above.



JBR

Eifoehn4 August 30, 2021 13:05

You're welcome.

jnanabrao September 7, 2021 09:10

Hi Eifoehn4,
Code:

What I would like is a way to access property values in the hdf5 solution files itself
Is there a way to do this without paraview? Like in python?


JBR

Eifoehn4 September 7, 2021 13:11

Sure Python, Julia and MATLAB are able to handle HDF5 files. The more tricky part is the data visualisation, especially for complex topologies with holes.
  • If your geometry is simple you may use a non-constrained Delaunay triangulation of each nodal point.
  • If your geometry is complex you may use a constrained Delaunay triangulation with Polygon boundaries.

In both cases you have to assign the coordinates to your data.

Regards

jnanabrao September 8, 2021 00:03

Started working with h5py. Thanks as always! I really appreciate all the help.


All times are GMT -4. The time now is 02:21.