ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
OutputVTKHDF Class Reference

#include <OutputVTKHDF.h>

Inherits Output.

Collaboration diagram for OutputVTKHDF:
[legend]

Public Member Functions

 OutputVTKHDF (std::string casTest, std::string run, tinyxml2::XMLElement *element, std::string fileName, Input *entree)
 OutputVTKHDF (std::string nameRun, int fileNumberRestartMeshMapping, Input *input, const H5FD_mpio_xfer_t &transfer_mode)
 ~OutputVTKHDF () override
virtual void initializeSpecificOutput () override
virtual void writeResults (Mesh *mesh, std::vector< Cell * > *cellsLvl) override
virtual void readResults (Mesh *mesh, std::vector< Cell * > *cellsLvl, int cpu=-1) override
 Read results of a previous simulation to resume from it.
virtual const void * getTransferMode () const override
 Get transfer_mode field (collective or independent hdf5 and MPI I/O mode for raw data transfer).
Public Member Functions inherited from Output
 Output ()
 Default constructor for specific output without specific needs.
 Output (std::string casTest, std::string nameRun, tinyxml2::XMLElement *element, std::string fileName, Input *entree)
 Main constructor for datasets used for OutputVTK and OutputGNU according to outputMode.
 Output (std::string nameRun, int fileNumberRestartMeshMapping, Input *input)
 Constructor for datasets used for OutputVTK when mesh mapping restart option is activated.
 Output (tinyxml2::XMLElement *element)
 Constructor for specific derived GNU outputs (boundary, probe, cut).
virtual ~Output ()
virtual void probeDisplacement (const double &)
virtual void locateProbeInMesh (const TypeMeshContainer< Cell * > &, const int &, bool=false)
virtual Cell * locateProbeInAMRSubMesh (std::vector< Cell * > *, const int &)
void copyInputFiles () const
void initializeOutput (const Cell &cell)
void initializeOutput (std::vector< CellInterface * > *cellInterfacesLvl)
 To initialize OutputBoundaryMassflowGNU.
void initializeOutputMeshMapping (const Cell &cell)
 To initialize output for Mesh Mapping Restart.
virtual void initializeOutputInfos ()
virtual void writeResults (std::vector< CellInterface * > *)
virtual void writeInfos ()
virtual void writeProgress ()
virtual void initializeSpecificOutput (std::vector< CellInterface * > *)
void readInfos ()
 Currently only used for OutputBoundaryMassflowGNU.
int readNbCpu ()
 Read and return the number of cpu from the infoCalcul file of a performed simulation.
void readDomainDecompostion (Mesh *mesh)
void readTree_common (Mesh *mesh, TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *cellInterfacesLvl, const std::vector< AddPhys * > &addPhys, int &lvl)
 Refine ghost cells, update of persistent communications of cells lvl + 1, reconstruct arrays of cells and cell interfaces of lvl + 1.
int getNumFile () const
virtual double getNextTime ()
virtual bool possesses ()
const std::string & getFolderOutput ()
const TypeOutput & getType () const
bool getReducedOutput () const
std::string outputPhaseName (int phase, std::string phaseName, std::string &eosName) const

Protected Member Functions

void initializeProperties (const H5FD_mpio_xfer_t &transfer_mode)
 Initialize fields needed by the two constructors that are provided (m_type and m_data_transfer) and assign hdf5 properties.
int readScalarVTKHDF (hid_t group_id, const std::string &dataset_name, std::vector< size_t > &scalar_array) const
 Read a scalar array using parallel HDF5.
template<size_t N>
int readArrayVTKHDF (hid_t group_id, std::string dataset_name, std::vector< double > &dataset, const hsize_t(&local_dims)[N], const hsize_t(&offsets)[N])
 Read an array of dimensions local_dims at offset offsets using parallel HDF5.
template<size_t N>
int ReadPhysicalDataVTKHDF (Mesh *mesh, std::vector< Cell * > *cellsLvl, hid_t group_id, const hsize_t(&count_scalar)[N], const hsize_t(&start_scalar)[N])
 Read the list of ECOGEN physical data in a VTKHDF file with dimensions and offsets of area to read provided as input.
int ReadPhysicalDataVTKHDF (Mesh *mesh, std::vector< Cell * > *cellsLvl, hid_t group_id, int cpu, const std::vector< size_t > &numberCells)
 Read the list of ECOGEN physical data in a VTKHDF file. Dimensions of area to parse are calculated automatically based on the mesh type (cartesian, AMR...).
std::string createFilenameVTKHDF (const char *name, int numFile=-1, std::string nameVariable="defaut") const
int openFileVTKHDF (hid_t &file_id, bool parallel_access, bool create) const
 Create or open a hdf5 file.
void writeTimeseriesVTKHDF (int numFile)
 Write a Paraview .series file for time series visualization of VTKHDF outputs.
void writeXDMF (Mesh *mesh, int numFile)
 Write a XDMF file to visualize cartesian VTKHDF outputs while VTKHDF file format is not yet specified.
void writeResultsVTKHDF (Mesh *mesh, std::vector< Cell * > *cellsLvl)
 Write results at VTKHDF file format for current time step.
int writePhysicalDataVTKHDF (hid_t &file, const Mesh *mesh, std::vector< Cell * > *cellsLvl, hid_t &vtkhdf_group_id, size_t numberCells) const
 Write physical data fields at VTKHDF file format in file hdf5 object.
template<size_t N, typename T>
int writePhysicalDataVTKHDF (const Mesh *mesh, std::vector< Cell * > *cellsLvl, hid_t vtkhdf_group_id, size_t numberCells, const hsize_t(&dimsf_scalar)[N], const hsize_t(&count_scalar)[N], const hsize_t(&start_scalar)[N], const hsize_t(&chunk_scalar)[N]) const
 Helper to write physical data fields of rank N at VTKHDF file format in file hdf5 object.
int writeScalarVTKHDF (const hid_t &group_id, const std::string &dataset_name, const size_t &scalar_val) const
 Write a distributed scalar array using parallel HDF5.
const void * getOutputBuffer (const std::vector< double > &double_buffer, std::vector< float > &float_buffer) const
 Get buffer to write at suitable format for hdf5 (float or double).
template<typename T>
int writeConnectivity (Mesh *mesh, std::vector< Cell * > *cellsLvl, hid_t &vtkhdf_group_id, size_t &numberCells, const size_t &numberNodes) const
template<typename T>
int writeUnstructuredArrayVTKHDF (const hid_t &group_id, const std::string &dataset_name, hid_t hdf_file_dtype, hid_t hdf_mem_dtype, const std::vector< T > &dataset, const size_t &line_count, size_t column_count=1) const
 Write a 2-dimensional array of an unstructured mesh using parallel HDF5.
template<size_t N, typename T>
int writeArrayVTKHDF (const hid_t &group_id, const std::string &dataset_name, hid_t hdf_mem_dtype, hid_t hdf_file_dtype, hid_t parallel_x_properties, const std::vector< T > &dataset, const hsize_t(&global_dims)[N], const hsize_t(&local_dims)[N], const hsize_t(&offsets)[N], const hsize_t(&chunk_dims)[N]) const
 Write a N-dimensional array of C++ type T and hdf5 type hdf_type using parallel HDF5.
int writeArrayAttribute (const hid_t &group_id, const std::string &attribute_name, const hsize_t &nitem, const int *array) const
 Write array attribute in VTKHDF file.
int writeHeaderVTKHDF (const hid_t &group_id, const std::string &mesh_type) const
 Write header of VTKHDF file.
int writeMeshRectilinearVTKHDF (Mesh *mesh, hid_t &file, hid_t &vtkhdf_group_id, size_t &numberCells)
 Write cartesian mesh at VTKHDF file format.
int writeMeshUnstructuredVTKHDF (Mesh *mesh, std::vector< Cell * > *cellsLvl, hid_t &file, hid_t &vtkhdf_group_id, size_t &numberCells) const
 Write unstructured mesh at VTKHDF file format.
void writeDataset (std::vector< double >, std::ofstream &, TypeData) const
virtual void prepareErrorFiles () const override
virtual void writeErrorInFile (std::vector< Errors > &v, const int &ErrorType, const int &iteration, bool &warn) const override
virtual void printTree (Mesh *mesh, const std::vector< Cell * > *cellsLvl, int m_resumeAMRsaveFreq) const override
 Write 'meshInfo' file that stores for each cell its subdivision status (1 if subdivided, 0 if not).
virtual void readTree (Mesh *mesh, TypeMeshContainer< Cell * > *cellsLvl, TypeMeshContainer< Cell * > *cellsLvlGhost, TypeMeshContainer< CellInterface * > *const cellInterfacesLvl, const std::vector< AddPhys * > &addPhys, int &nbCellsTotalAMR) override
 Read 'meshInfo' file that stores for each cell its subdivision status (1 if subdivided, 0 if not).
Protected Member Functions inherited from Output
void printWritingInfo () const
void saveInfos () const
std::string createFilename (const char *name, int lvl=-1, int proc=-1, int numFichier=-1) const
void writeDataset (std::vector< double > dataset, std::ofstream &fileStream, TypeData typeData) const
void getDataset (std::istringstream &data, std::vector< double > &dataset) const

Static Protected Member Functions

static void writeDataXDMF (std::ofstream &fileStream, const std::string &dataFile, const std::string &dataName, const std::string &dataType, int numberCellsX, int numberCellsY, int numberCellsZ, int dimData)
 Write data array at XDMF format.
static void unstructuredFirstRangeLayout (const size_t &line_count, hsize_t *dimsf, hsize_t *count, hsize_t *start)
 Compute size, position and offset of writing area from 'line_count' and 'column_count' data.
static void getDataset (std::istringstream &, std::vector< double > &)

Private Attributes

hid_t m_h5_file_floatType
 Hdf5 floating type to write in file depending on the precision asked by user.
hid_t m_h5_file_intType
 Hdf5 integer type to write in file depending on the precision asked by user.
hid_t m_h5_mem_floatType
 Hdf5 floating type in memory space: must match architecture (LE, BE) and the size of the data in memory (float, double...).
hid_t m_h5_mem_intType
 Hdf5 integer type in memory space: must match architecture (LE, BE) and the size of the data in memory (int32_t, int64_t..).
hid_t m_group_creation_properties
 Properties for hdf5 group creation.
hid_t m_dataset_creation_properties
 Properties for hdf5 dataset creation.
hid_t m_parallel_x_properties
 Properties for hdf5 raw data transfer.
H5FD_mpio_xfer_t m_transfer_mode
 Perform collective (default or H5FD_MPIO_COLLECTIVE) or independent (H5FD_MPIO_INDEPENDENT) parallel I/Os.

Static Private Attributes

static constexpr size_t DIM_OUTPUT {3}
 Always write 3D-coordinates in output files.
static constexpr int VTKHDF_VERSION [2] = {2, 4}
 VTKHDF format version: set to version 2.4 in .cpp file.
static constexpr int ERROR_VALUE = -1
 Error value.
static constexpr int SUCCESS_VALUE = 0
 Success value.

Additional Inherited Members

Protected Attributes inherited from Output
Input * m_input
 Pointer to input.
Run * m_run
 Pointer to run.
TypeOutput m_type
 Type of output.
std::string m_simulationName
 Test case name (defined in "main.xml").
std::string m_infoCalcul
 Filename to save useful info of computation.
std::string m_treeStructure
 Filename for tree structure backup.
std::string m_domainDecomposition
 Filename for domain decomposition backup.
std::string m_fileNameResults
 Filename of result file.
std::string m_filenameCollectionParaview
 Name of the collection containing the results files (for Paraview).
std::string m_filenameCollectionVisIt
 Name of the collection containing the results files (for VisIt).
std::string m_filenameVTKHDFTimeseries
 Name of the timeseries file containing the list of result files at vtkhdf format (for Paraview).
std::string m_folderOutput
 Folder to store results.
std::string m_folderSavesInput
 Folder to store a copy of input files.
std::string m_folderDatasets
 Folder to save the datasets.
std::string m_folderInfoMesh
 Folder to store mesh info.
std::string m_folderCuts
 Cuts results folder location.
std::string m_folderProbes
 Probes results folder location.
std::string m_folderGlobalQuantities
 Global quantity (e.g. mass) results folder location.
std::string m_folderBoundaries
 Boundaries flux results folder location.
std::string m_fileCollectionParaview
 Chemin du file collection regroupant les fichiers resultats (for Paraview).
std::string m_fileCollectionVisIt
 Chemin du file collection regroupant les fichiers resultats (for VisIt).
std::string m_folderErrorsAndWarnings
 File path for errors and warnings.
bool m_writeBinary
 Choice to write binary/ASCII (available for GNU and VTK outputs, GNU format only supports ASCII).
bool m_splitData
 Choice print data in separate files.
int m_precision
 Output files precision (number of digits) for GNU and VTK outputs //default: 6.
bool m_reducedOutput
 Choice of reduced number of output variables when possible (depends on the model).
int m_numFile
std::string m_endianMode
int m_nbCpusRestarted
 Number of CPUs of the simulation to be restarted.
Cell m_cellRef
 Reference cell to extract variables name.

Constructor & Destructor Documentation

◆ OutputVTKHDF() [1/2]

OutputVTKHDF::OutputVTKHDF ( std::string casTest,
std::string run,
tinyxml2::XMLElement * element,
std::string fileName,
Input * entree )
Here is the call graph for this function:

◆ OutputVTKHDF() [2/2]

OutputVTKHDF::OutputVTKHDF ( std::string nameRun,
int fileNumberRestartMeshMapping,
Input * input,
const H5FD_mpio_xfer_t & transfer_mode )
Here is the call graph for this function:

◆ ~OutputVTKHDF()

OutputVTKHDF::~OutputVTKHDF ( )
override

Member Function Documentation

◆ createFilenameVTKHDF()

std::string OutputVTKHDF::createFilenameVTKHDF ( const char * name,
int numFile = -1,
std::string nameVariable = "defaut" ) const
protected
Here is the caller graph for this function:

◆ getDataset()

void OutputVTKHDF::getDataset ( std::istringstream & ,
std::vector< double > &  )
inlinestaticprotected

◆ getOutputBuffer()

const void * OutputVTKHDF::getOutputBuffer ( const std::vector< double > & double_buffer,
std::vector< float > & float_buffer ) const
protected

Get buffer to write at suitable format for hdf5 (float or double).

Parameters
double_bufferbuffer containing data at double precision.
float_bufferbuffer to store double data converted at float format if it is the output format asked by user
Returns
pointer to the buffer that has to be passed to hdf5.

◆ getTransferMode()

virtual const void * OutputVTKHDF::getTransferMode ( ) const
inlineoverridevirtual

Get transfer_mode field (collective or independent hdf5 and MPI I/O mode for raw data transfer).

Reimplemented from Output.

◆ initializeProperties()

void OutputVTKHDF::initializeProperties ( const H5FD_mpio_xfer_t & transfer_mode)
protected

Initialize fields needed by the two constructors that are provided (m_type and m_data_transfer) and assign hdf5 properties.

Two constructors are provided with 'OutputVTKHDF' class: a constructor to write output files and a constructor to read output files of a previous run when

Parameters
transfer_modehdf5 parallel mode for raw data transfer (H5FD_MPIO_COLLECTIVE or H5FD_MPIO_INDEPENDENT)
Here is the caller graph for this function:

◆ initializeSpecificOutput()

void OutputVTKHDF::initializeSpecificOutput ( )
overridevirtual

Reimplemented from Output.

Here is the call graph for this function:

◆ openFileVTKHDF()

int OutputVTKHDF::openFileVTKHDF ( hid_t & file_id,
bool parallel_access,
bool create ) const
protected

Create or open a hdf5 file.

Parameters
file_idfile identifier
parallel_accesstrue to open file with parallel access, false for serial access
createtrue to create a new file, false to reopen an existing file in order to add data
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareErrorFiles()

void OutputVTKHDF::prepareErrorFiles ( ) const
overrideprotectedvirtual

Reimplemented from Output.

◆ printTree()

void OutputVTKHDF::printTree ( Mesh * mesh,
const std::vector< Cell * > * cellsLvl,
int m_resumeAMRsaveFreq ) const
overrideprotectedvirtual

Write 'meshInfo' file that stores for each cell its subdivision status (1 if subdivided, 0 if not).

In case of VTKHDF outputs, 1 file per time step is saved at binary format. subdivision status is saved as a 'int8_t' so file can be inspected with 'od -v -t d4 <meshInfo.out>' command.

Parameters
meshMesh object of the current simulation.
cellsLvlComputationnal cells
m_resumeAMRsaveFreqFile output frequency
Remarks
Useful only in AMR case.

Reimplemented from Output.

Here is the call graph for this function:

◆ readArrayVTKHDF()

template<size_t N>
int OutputVTKHDF::readArrayVTKHDF ( hid_t group_id,
std::string dataset_name,
std::vector< double > & dataset,
const hsize_t(&) local_dims[N],
const hsize_t(&) offsets[N] )
protected

Read an array of dimensions local_dims at offset offsets using parallel HDF5.

Template Parameters
NRange of array to read
Parameters
group_idIdentifier of hdf5 object where data will be readed
dataset_nameString containing the name of the VTKHDF dataset to read
local_dimsDimensions of area to read for current MPI process
offsetsOffsets along each direction where starts the area to read for current MPI process
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadPhysicalDataVTKHDF() [1/2]

template<size_t N>
int OutputVTKHDF::ReadPhysicalDataVTKHDF ( Mesh * mesh,
std::vector< Cell * > * cellsLvl,
hid_t group_id,
const hsize_t(&) count_scalar[N],
const hsize_t(&) start_scalar[N] )
protected

Read the list of ECOGEN physical data in a VTKHDF file with dimensions and offsets of area to read provided as input.

Template Parameters
NRange of array to read
Parameters
meshMesh object of the current simulation
cellsLvlComputationnal cells to be filled with results of previous simulation
group_idIdentifier o hdf5 object in which data will be readed
count_scalarDimensions of area to read for current MPI process and for a scalar data (dims for vectorial data are computed from dims of scalar datas)
start_scalarOffsets along each direction where starts the area to read for current MPI process and for scalar data (offset for vectorial data are computed from scalar offsets)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadPhysicalDataVTKHDF() [2/2]

int OutputVTKHDF::ReadPhysicalDataVTKHDF ( Mesh * mesh,
std::vector< Cell * > * cellsLvl,
hid_t group_id,
int cpu,
const std::vector< size_t > & numberCells )
protected

Read the list of ECOGEN physical data in a VTKHDF file. Dimensions of area to parse are calculated automatically based on the mesh type (cartesian, AMR...).

Parameters
meshMesh object of the current simulation
cellsLvlComputationnal cells to be filled with results of previous simulation
group_idIdentifier o hdf5 object in which data will be readed
cpuRank of MPI process from which we want to read data from the file (not used for cartesian meshes)
numberCellsVector of cell count per MPI process when file was saved. Readed from the 'NumberOfCells' file dataset (not used for cartesian meshes)
Here is the call graph for this function:

◆ readResults()

void OutputVTKHDF::readResults ( Mesh * ,
std::vector< Cell * > * ,
int = -1 )
overridevirtual

Read results of a previous simulation to resume from it.

Available for all mesh types if the same number of cpus is used between both simulations

Parameters
meshMesh object of the current simulation in case of resume. Mesh object of a single partition of the previous simulation (either the same one as current or older one in case of mapping).
cellsLvlComputationnal cells to be filled with results of previous simulation
cpuIndex of cpu file to read if provided (meshMappingRestart case), otherwise, the file associated with current cpu rank is readed (simulation resume case)

Reimplemented from Output.

Here is the call graph for this function:

◆ readScalarVTKHDF()

int OutputVTKHDF::readScalarVTKHDF ( hid_t group_id,
const std::string & dataset_name,
std::vector< size_t > & scalar_array ) const
protected

Read a scalar array using parallel HDF5.

Implements a collective read operation where each MPI rank reads the entire array

Parameters
group_idIdentifier of hdf5 object where data will be written
dataset_nameString containing the name of the VTKHDF dataset to write
scalar_arrayVector to store values that are readed
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readTree()

void OutputVTKHDF::readTree ( Mesh * mesh,
TypeMeshContainer< Cell * > * cellsLvl,
TypeMeshContainer< Cell * > * cellsLvlGhost,
TypeMeshContainer< CellInterface * > *const cellInterfacesLvl,
const std::vector< AddPhys * > & addPhys,
int & nbCellsTotalAMR )
overrideprotectedvirtual

Read 'meshInfo' file that stores for each cell its subdivision status (1 if subdivided, 0 if not).

Parameters
meshMesh object of the current simulation.
cellsLvlComputationnal cells
cellsLvlGhostGhost cells
cellInterfacesLvlInterface cells
addPhysVector of additional physics
nbCellsTotalAMRCell count
Remarks
Useful only in AMR case.

Reimplemented from Output.

Here is the call graph for this function:

◆ unstructuredFirstRangeLayout()

void OutputVTKHDF::unstructuredFirstRangeLayout ( const size_t & line_count,
hsize_t * dimsf,
hsize_t * count,
hsize_t * start )
staticprotected

Compute size, position and offset of writing area from 'line_count' and 'column_count' data.

Compute size, position and offset of writing area from 'line_count' and 'column_count' argument using a collective call ('Allgather')

Parameters
line_countnumber of line of array to write
dimsfglobal dimension along range 0 of array to write (filled by this function)
countlocal dimension along range 0 of array to write (filled by this function)
startposition from which local rank will start to write in global array along range 0 (filled by this function)
Here is the caller graph for this function:

◆ writeArrayAttribute()

int OutputVTKHDF::writeArrayAttribute ( const hid_t & group_id,
const std::string & attribute_name,
const hsize_t & nitem,
const int * array ) const
protected

Write array attribute in VTKHDF file.

Parameters
group_idIdentifier of hdf5 object where data will be written
attribute_namename of attribute to save
nitemnumber of item to write (array size)
arraypointer to the array to write
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeArrayVTKHDF()

template<size_t N, typename T>
int OutputVTKHDF::writeArrayVTKHDF ( const hid_t & group_id,
const std::string & dataset_name,
hid_t hdf_mem_dtype,
hid_t hdf_file_dtype,
hid_t parallel_x_properties,
const std::vector< T > & dataset,
const hsize_t(&) global_dims[N],
const hsize_t(&) local_dims[N],
const hsize_t(&) offsets[N],
const hsize_t(&) chunk_dims[N] ) const
protected

Write a N-dimensional array of C++ type T and hdf5 type hdf_type using parallel HDF5.

Implements a collective write operation where:

  • Each MPI rank writes the 'dataset' vector resized under the form of an array of rank N and dimensions 'local_dims'.
  • The resulting dataset spans all MPI ranks and is written in a region of rank N and size 'global_dims'
  • Size, position and offset of writing area are provided as argument Allow to write efficiently structured data and can be called by previous 'writeArrayVTKHDF' function.
Template Parameters
NRange in hdf5 memory and file of array to write
Parameters
group_idIdentifier of hdf5 object where data will be written
dataset_nameString containing the name of the VTKHDF dataset to write
hdf5_mem_dtypeHdf5 data type to use for storage and transfer: must match architecture (LE, BE) and the size of the data in memory (int32_t, int64_t..)
hdf5_file_dtypeHdf5 data type saved in file: hdf5 will manage the conversion from the hdf5_mem_dtype to this type if needed
parallel_x_propertiesProperty for raw data transfer (collective or independent - collective writes are unavailable if file is not open in parallel)
datasetPointer to the array to write
global_dimsglobal dimensions of array to write in file
local_dimslocal dimensions on the current MPI process of array to write in file
offsetsoffsets at which write the array in file
chunk_dimsWanted dimensions of file chunks (to optimize data access). If chunk_dims[0] is 0, chunking is disabled.
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
- Exceptions are not used to avoid the creation of a corrupted file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeConnectivity()

template<typename T>
int OutputVTKHDF::writeConnectivity ( Mesh * mesh,
std::vector< Cell * > * cellsLvl,
hid_t & vtkhdf_group_id,
size_t & numberCells,
const size_t & numberNodes ) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeDataset()

void OutputVTKHDF::writeDataset ( std::vector< double > ,
std::ofstream & ,
TypeData  ) const
inlineprotected

◆ writeDataXDMF()

void OutputVTKHDF::writeDataXDMF ( std::ofstream & fileStream,
const std::string & dataFile,
const std::string & dataName,
const std::string & dataType,
int numberCellsX,
int numberCellsY,
int numberCellsZ,
int dimData )
staticprotected

Write data array at XDMF format.

Parameters
dataFileFilename
dataNamName of data to write
dataTypeType ('Scalar' or 'Vector') of data to write
numberCellsXNumber of space steps in X direction
numberCellsYNumber of space steps in Y direction
numberCellsZNumber of space steps in Z direction
dimDataData dimension (1 for scalars, 3 for vectors)
Here is the caller graph for this function:

◆ writeErrorInFile()

void OutputVTKHDF::writeErrorInFile ( std::vector< Errors > & v,
const int & ErrorType,
const int & iteration,
bool & warn ) const
overrideprotectedvirtual

Reimplemented from Output.

◆ writeHeaderVTKHDF()

int OutputVTKHDF::writeHeaderVTKHDF ( const hid_t & group_id,
const std::string & mesh_type ) const
protected

Write header of VTKHDF file.

Parameters
group_idIdentifier of hdf5 object where data will be written
mesh_typeString containing the name of VTK mesh Type
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
- file is saved at format 2.4 for now
- Exceptions are not used to avoid the creation of a corrupted file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeMeshRectilinearVTKHDF()

int OutputVTKHDF::writeMeshRectilinearVTKHDF ( Mesh * mesh,
hid_t & file,
hid_t & vtkhdf_group_id,
size_t & numberCells )
protected

Write cartesian mesh at VTKHDF file format.

Parameters
meshMesh object of the current simulation
fileIdentifier of hdf5 object where data will be written
vtkhdf_group_idIdentifier of 'VTKHDF' group created by current function
numberCellsNumber of cells in the mesh (filled by the current function)
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
Temporary output while VTKHDF file format is not yet specified. For now, uses format specified on VTK discourse forum:
Warning
Rectilinear outputs are disabled for now because they are too inefficient
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeMeshUnstructuredVTKHDF()

int OutputVTKHDF::writeMeshUnstructuredVTKHDF ( Mesh * mesh,
std::vector< Cell * > * cellsLvl,
hid_t & file,
hid_t & vtkhdf_group_id,
size_t & numberCells ) const
protected

Write unstructured mesh at VTKHDF file format.

Parameters
meshMesh object of the current simulation
cellsLvlComputationnal cells to be filled with results of previous simulation
fileIdentifier of hdf5 object where data will be written
vtkhdf_group_idIdentifier of 'VTKHDF' group created by current function
numberCellsNumber of cells in the mesh (filled by the current function)
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
Exceptions are not used to avoid the creation of a corrupted file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writePhysicalDataVTKHDF() [1/2]

template<size_t N, typename T>
int OutputVTKHDF::writePhysicalDataVTKHDF ( const Mesh * mesh,
std::vector< Cell * > * cellsLvl,
hid_t vtkhdf_group_id,
size_t numberCells,
const hsize_t(&) dimsf_scalar[N],
const hsize_t(&) count_scalar[N],
const hsize_t(&) start_scalar[N],
const hsize_t(&) chunk_scalar[N] ) const
protected

Helper to write physical data fields of rank N at VTKHDF file format in file hdf5 object.

Template Parameters
NRange in hdf5 memory and file of scalar data to write
TPrecision at which to save data in file
Parameters
meshMesh object of the current simulation
cellsLvlComputationnal cells to be filled with results of previous simulation
vtkhdf_group_idIdentifier of hdf5 object where data will be written
numberCellsNumber of Cells
dimsf_scalarglobal dimensions of scalar data (global dimensions of vectorial data are computed from scalar ones)
count_scalarlocal dimensions of scalar data (local dimensions of vectorial data are computed from scalar ones)
start_scalaroffset where to start to write scalar data for current MPI process (offsets of vectorial data are computed from scalar ones)
chunk_scalarsize of chunks to optimize data access efficiency (chunks of vectorial data are computed from scalar ones)
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
Exceptions are not used to avoid the creation of a corrupted file
Warning
Rectilinear outputs are disabled for now because they are too inefficient
Here is the call graph for this function:

◆ writePhysicalDataVTKHDF() [2/2]

int OutputVTKHDF::writePhysicalDataVTKHDF ( hid_t & file,
const Mesh * mesh,
std::vector< Cell * > * cellsLvl,
hid_t & vtkhdf_group_id,
size_t numberCells ) const
protected

Write physical data fields at VTKHDF file format in file hdf5 object.

For rectilinear meshes, data are saved using natural serial organization (data in files matches geometrical data representation). For unstructured meshes, data are saved by partitions in increasing order of MPI rank.

Parameters
meshMesh object of the current simulation
cellsLvlComputationnal cells to be filled with results of previous simulation
vtkhdf_group_idIdentifier of hdf5 object where data will be written
numberCellsNumber of Cells
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
Exceptions are not used to avoid the creation of a corrupted file
Warning
Rectilinear outputs are disabled for now because they are too inefficient
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeResults()

void OutputVTKHDF::writeResults ( Mesh * mesh,
std::vector< Cell * > * cellsLvl )
overridevirtual

Reimplemented from Output.

Here is the call graph for this function:

◆ writeResultsVTKHDF()

void OutputVTKHDF::writeResultsVTKHDF ( Mesh * mesh,
std::vector< Cell * > * cellsLvl )
protected

Write results at VTKHDF file format for current time step.

Parameters
meshMesh object of the current simulation
cellsLvlComputationnal cells to be filled with results of previous simulation
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeScalarVTKHDF()

int OutputVTKHDF::writeScalarVTKHDF ( const hid_t & group_id,
const std::string & dataset_name,
const size_t & scalar_val ) const
protected

Write a distributed scalar array using parallel HDF5.

Implements a collective write operation where:

  • Each MPI rank writes exactly one scalar value
  • The resulting dataset spans all MPI ranks
  • Total size of the array equals the number of MPI processes
Parameters
group_idIdentifier of hdf5 object where data will be written
dataset_nameString containing the name of the VTKHDF dataset to write
scalar_valValue to write for current MPI rank
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
Exceptions are not used to avoid the creation of a corrupted file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeTimeseriesVTKHDF()

void OutputVTKHDF::writeTimeseriesVTKHDF ( int numFile)
protected

Write a Paraview .series file for time series visualization of VTKHDF outputs.

Parameters
numFileIndex of maximal timestep value to list (an empty list is saved if numFile is equal to -1).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeUnstructuredArrayVTKHDF()

template<typename T>
int OutputVTKHDF::writeUnstructuredArrayVTKHDF ( const hid_t & group_id,
const std::string & dataset_name,
hid_t hdf_file_dtype,
hid_t hdf_mem_dtype,
const std::vector< T > & dataset,
const size_t & line_count,
size_t column_count = 1 ) const
protected

Write a 2-dimensional array of an unstructured mesh using parallel HDF5.

Implements a collective write operation to dump arrays of unstructured data (so for unstructured and AMR meshes) where:

  • array has C++ type T and hdf5 type hdf_type
  • Each MPI rank writes its line_count lines of the array and all its columns
  • The resulting dataset spans all MPI ranks
  • Size, position and offset of writing area is locally computed using a collective call ('Allgather')
Template Parameters
TType of dataset vector
Parameters
group_idIdentifier of hdf5 object where data will be written
dataset_nameString containing the name of the VTKHDF dataset to write
hdf5_mem_dtypeHdf5 data type to use for storage and transfer: must match architecture (LE, BE) and the size of the data in memory (int32_t, int64_t..)
hdf5_file_dtypeHdf5 data type saved in file: hdf5 will manage the conversion from the hdf5_mem_dtype to this type if needed
datasetReference to the local vector of type T to write
line_countSize of the first dimension of the local array
column_countSize of the second dimension of the local array (1 for a 1D array)
Returns
ERROR_VALUE if fail, SUCCESS_VALUE if success
Note
- Exceptions are not used to avoid the creation of a corrupted file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeXDMF()

void OutputVTKHDF::writeXDMF ( Mesh * mesh,
int numFile )
protected

Write a XDMF file to visualize cartesian VTKHDF outputs while VTKHDF file format is not yet specified.

Parameters
numFileIndex of maximal timestep value to list (an empty list is saved if numFile is equal to -1).
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ DIM_OUTPUT

size_t OutputVTKHDF::DIM_OUTPUT {3}
staticconstexprprivate

Always write 3D-coordinates in output files.

◆ ERROR_VALUE

int OutputVTKHDF::ERROR_VALUE = -1
staticconstexprprivate

Error value.

◆ m_dataset_creation_properties

hid_t OutputVTKHDF::m_dataset_creation_properties
private

Properties for hdf5 dataset creation.

◆ m_group_creation_properties

hid_t OutputVTKHDF::m_group_creation_properties
private

Properties for hdf5 group creation.

◆ m_h5_file_floatType

hid_t OutputVTKHDF::m_h5_file_floatType
private

Hdf5 floating type to write in file depending on the precision asked by user.

◆ m_h5_file_intType

hid_t OutputVTKHDF::m_h5_file_intType
private

Hdf5 integer type to write in file depending on the precision asked by user.

◆ m_h5_mem_floatType

hid_t OutputVTKHDF::m_h5_mem_floatType
private

Hdf5 floating type in memory space: must match architecture (LE, BE) and the size of the data in memory (float, double...).

◆ m_h5_mem_intType

hid_t OutputVTKHDF::m_h5_mem_intType
private

Hdf5 integer type in memory space: must match architecture (LE, BE) and the size of the data in memory (int32_t, int64_t..).

◆ m_parallel_x_properties

hid_t OutputVTKHDF::m_parallel_x_properties
private

Properties for hdf5 raw data transfer.

◆ m_transfer_mode

H5FD_mpio_xfer_t OutputVTKHDF::m_transfer_mode
private

Perform collective (default or H5FD_MPIO_COLLECTIVE) or independent (H5FD_MPIO_INDEPENDENT) parallel I/Os.

◆ SUCCESS_VALUE

int OutputVTKHDF::SUCCESS_VALUE = 0
staticconstexprprivate

Success value.

◆ VTKHDF_VERSION

int OutputVTKHDF::VTKHDF_VERSION = {2, 4}
staticconstexprprivate

VTKHDF format version: set to version 2.4 in .cpp file.


The documentation for this class was generated from the following files:
  • /home/runner/work/ECOGEN/ECOGEN/doc_sources/src/InputOutput/OutputVTKHDF.h
  • /home/runner/work/ECOGEN/ECOGEN/doc_sources/src/InputOutput/OutputVTKHDF.cpp