Alsvinn  0.5.3
The fast FVM simulator with UQ support
Public Member Functions | Protected Member Functions | List of all members
alsfvm::io::HDF5MPIWriter Class Reference

The HDF5MPIWriter write to the HDF5 format with MPI support. More...

#include <alsfvm/io/HDF5MPIWriter.hpp>

Inheritance diagram for alsfvm::io::HDF5MPIWriter:
alsfvm::io::HDF5Writer alsfvm::io::Writer

Public Member Functions

 HDF5MPIWriter (const std::string &basefileName, const std::vector< std::string > &groupNames, size_t groupIndex, bool newFile, MPI_Comm mpiCommunicator, MPI_Info mpiInfo)
 HDF5MPIWriter constructs a new HDF5Writer. More...
 
virtual ~HDF5MPIWriter ()
 
virtual void write (const volume::Volume &conservedVariables, const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation) override
 write writes the data to disk More...
 
- Public Member Functions inherited from alsfvm::io::HDF5Writer
 HDF5Writer (const std::string &basefileName)
 HDF5Writer constructs a new HDF5Writer. More...
 
virtual ~HDF5Writer ()
 
- Public Member Functions inherited from alsfvm::io::Writer
virtual ~Writer ()
 
virtual void finalize (const grid::Grid &grid, const simulator::TimestepInformation &timestepInformation)
 This method should be called at the end of the simulation. More...
 
void addAttributes (const std::string &nameOfAttributes, const boost::property_tree::ptree &attributes)
 

Protected Member Functions

virtual std::unique_ptr< HDF5ResourcecreateDatasetForMemory (const volume::Volume &volume, size_t index, const std::string &name, hid_t file)
 createDatasetForMemroy creates a dataset for the given memory More...
 
- Protected Member Functions inherited from alsfvm::io::HDF5Writer
void writeGrid (hid_t object, const grid::Grid &grid)
 
void writeTimeGroup (hid_t object, const simulator::TimestepInformation &timestepInformation)
 
void writeVolume (const volume::Volume &volume, hid_t file, hid_t accessList=H5P_DEFAULT)
 writeVolume takes each variable of the volume and writes it More...
 
void writeMemory (const volume::Volume &volume, size_t index, const std::string &name, hid_t file, hid_t accessList=H5P_DEFAULT)
 writeMemory writes a memory area to disk More...
 
void writeMemoryToDataset (const volume::Volume &volume, size_t index, const std::string &name, hid_t dataset, hid_t accessList=H5P_DEFAULT)
 createDatasetForMemroy creates a dataset for the given memory More...
 
void writeString (hid_t object, const std::string &name, const std::string &value)
 writeString writes the string as an attribute to the given object More...
 
void writeFloats (hid_t object, const std::string &name, const std::vector< float > &values)
 writeFloats writes the vector of floats as an attribute More...
 
void writeIntegers (hid_t object, const std::string &name, const std::vector< int > &values)
 writeIntegerss writes the vector of integers as an attribute More...
 

Additional Inherited Members

- Static Public Member Functions inherited from alsfvm::io::Writer
static std::string getClassName ()
 
- Protected Attributes inherited from alsfvm::io::HDF5Writer
size_t snapshotNumber
 
const std::string basefileName
 
- Protected Attributes inherited from alsfvm::io::Writer
std::map< std::string, boost::property_tree::ptree > attributesMap
 

Detailed Description

The HDF5MPIWriter write to the HDF5 format with MPI support.

Constructor & Destructor Documentation

◆ HDF5MPIWriter()

alsfvm::io::HDF5MPIWriter::HDF5MPIWriter ( const std::string &  basefileName,
const std::vector< std::string > &  groupNames,
size_t  groupIndex,
bool  newFile,
MPI_Comm  mpiCommunicator,
MPI_Info  mpiInfo 
)

HDF5MPIWriter constructs a new HDF5Writer.

Parameters
basefileNamethe basefilename to use (this could be eg. "some_simulation".
groupNamesnames of groups to create in the file (this is especially useful for MPI)
groupIndexthe groupIndex to write to
mpiCommunicatorthe given mpiCommunicator (used for pNETCDF)
newFilecreates a new file if true, otherwise tries to open an already existing file (will fail if it does not exist or does not agree with our format). When in doubt, set it true for first sample save, then false
mpiInfothe mpiInfo (passed to pNetCDF)
Note
Timestep information will be added to the filename, as well as proper extension (.h5).

◆ ~HDF5MPIWriter()

virtual alsfvm::io::HDF5MPIWriter::~HDF5MPIWriter ( )
inlinevirtual

Member Function Documentation

◆ createDatasetForMemory()

std::unique_ptr< HDF5Resource > alsfvm::io::HDF5MPIWriter::createDatasetForMemory ( const volume::Volume volume,
size_t  index,
const std::string &  name,
hid_t  file 
)
protectedvirtual

createDatasetForMemroy creates a dataset for the given memory

Parameters
volumethe volume to read from
indexthe index of the memory area to read from
namethe name of the memory (variable name)
filethe file to write to

Reimplemented from alsfvm::io::HDF5Writer.

◆ write()

void alsfvm::io::HDF5MPIWriter::write ( const volume::Volume conservedVariables,
const grid::Grid grid,
const simulator::TimestepInformation timestepInformation 
)
overridevirtual

write writes the data to disk

Parameters
conservedVariablesthe conservedVariables to write
gridthe grid that is used (describes the whole domain)
timestepInformation

Reimplemented from alsfvm::io::HDF5Writer.


The documentation for this class was generated from the following files: