Skip to content

Merge Tool

Adrian Harwood edited this page Oct 12, 2017 · 7 revisions

The merge tool is referred to as h5mgm and is a stand-alone post-processor for the HDF files generated by LUMA. It translates the *.h5 file produced by LUMA into a time-series of *.vtu files to be read by Paraview. These files have been successfully read on all versions of Paraview since v5.0.

Requirements

The merge tool requires VTK to be installed and build as a pre-requisite. The VTK binaries must be on the system path when the merge tool is executed to allow dynamic linking at run-time.

Building the Merge Tool

Windows Users

In Visual Studio, create a new C++ project and add the source files from ./LUMA/tools/post_processors/h5mgm/src to the project. In the Project->Properties pages, specify the additional include directories on the C/C++->General tab as:

$(HDF5_INC);    
$(MSMPI_INC);    
$(VTK_INC)\IO\Geometry;    
$(VTK_INC)\IO\XML;    
$(VTK_INC)\Common\Core;     
$(VTK_INC)\Common\DataModel;    
$(VTK_INC)\Common\Math;    
$(VTK_INC)\Common\Misc;    
$(VTK_INC)\Common\System;    
$(VTK_INC)\IO\Legacy;    
$(VTK_INC)\IO\Core;    
$(VTK_INC)\Common\ExecutionModel;    
$(VTK_INC)\Filters\Core;    

where $(HDF5_INC), $(MSMPI_INC) and $(VTK_INC) are system variables containing the directory paths to your HDF5, MPI and VTK header files.

Under the Linker->General tab, add the following additional library directories:

$(HDF5_LIB);    
$(MSMPI_LIB);    
$(VTK_LIB);    

where these are the directory paths to the compiled libraries for the HDF5, MPI and VTK components respectively.

Finally, under the Linker->Input tab add the following to additional dependencies:

msmpi.lib;    
libszip.lib;    
libzlib.lib;    
libhdf5.lib;    
vtkIOXML-X.X.lib;    
vtkFiltersCore-X.X.lib;    
vtkIOLegacy-X.X.lib;    
vtkIOCore-X.X.lib;    
vtkCommonExecutionModel-X.X.lib;    
vtkCommonDataModel-X.X.lib;    
vtkCommonCore-X.X.lib;    

where X.X is replaced with the version of VTK you are using. The corresponding *.dll files will be used for dynamic linking at run-time. Note: Debug builds of some libraries append a _D to the name of the libraries. You may need to have different settings for Release and Debug build configurations.

Mac and Linux Users

Edit the makefile in the source directory to ensure the version number of the VTK libraries match the version installed on your system. Execute the makefile to build the merge tool.

Options and Syntax

The merge tool must be called from within the directory containing the *.h5 file to be merged. Parameters are passed as space separated command line argument as follows:

h5mgm <arg1> <arg2> ...    

Valid options for the argument are:

cut		Excludes solid sites from the reconstructed mesh.
legacy		Writes VTKs instead of VTUs.
loud		Prints out information to the screen as well as to the log file.
quiet		Will not write the log file.
sorter		Writes out cell velocities in a z, y, x, sorted list based on the HDF5 files.
version		Prints the version number of the tool compiled on your system.
XXX		Appends XXX to the output filename. Appends 000 if not specified.
		e.g. h5mgm 123 will produce files named something like "luma.123.<t>.<ext>"

The output files are organised into a directory called postprocessedoutput.