METHOD
ParallelSaveDataHDF5 Class Reference

#include <parallelSaveDataHDF5.h>

Inheritance diagram for ParallelSaveDataHDF5:
Collaboration diagram for ParallelSaveDataHDF5:

Public Types

enum  OutputDetail { OUTPUT_ALL, OUTPUT_REDUCED, OUTPUT_MINIMAL }
 

Public Member Functions

void saveCons () override
 
void savePrims () override
 
void saveAux () override
 
void saveDomain () override
 
void saveConsts () override
 
 ParallelSaveDataHDF5 (Data *data, ParallelEnv *env, string filename="data", OutputDetail detail=OUTPUT_ALL)
 
virtual ~ParallelSaveDataHDF5 ()
 
void saveAll (bool timeSeries=false) override
 
void saveVar (string variable, int num=1) override
 
void openFile (const char *name)
 
void openCheckpointFile ()
 
void writeDataSetDouble (const hid_t *group, const char *name, const int *var, const double *data)
 
- Public Member Functions inherited from SaveData
 SaveData (Data *data, int test=0)
 
virtual ~SaveData ()
 

Public Attributes

ParallelEnvenv
 
string filename
 
hid_t file = 0
 
int file_iteration = 0
 
enum ParallelSaveDataHDF5::OutputDetail detail
 
- Public Attributes inherited from SaveData
Datad
 
int Nouts
 
int Ncount
 
int test
 
char dir [50]
 
char app [50]
 

Detailed Description

Class used to save simulation data to HDF5 using multiple processes

Class is initialized with the data that is to be saved. Saves the simulation data in the Data directory, located within the Project folder. All data is saved automatically, including all constant data (xmin, ymax, endTime etc) and and the values of all prims, aux and cons variables.

Definition at line 25 of file parallelSaveDataHDF5.h.

Member Enumeration Documentation

◆ OutputDetail

The level of detail to output to file.

Enumerator
OUTPUT_ALL 

All conserved, primitive, auxiliary and user-defined data.

OUTPUT_REDUCED 

Skip auxiliary data.

OUTPUT_MINIMAL 

Only conserved and primitive data.

Definition at line 35 of file parallelSaveDataHDF5.h.

Constructor & Destructor Documentation

◆ ParallelSaveDataHDF5()

ParallelSaveDataHDF5::ParallelSaveDataHDF5 ( Data data,
ParallelEnv env,
string  filename = "data",
OutputDetail  detail = OUTPUT_ALL 
)
inline

Constructor.

Parameters
[in]*datapointer to the Data class
[in]*envpointer to the Parallel Environment containing information on bounds etc.
[in]filenameString describing the file to create. Can ignore

Definition at line 62 of file parallelSaveDataHDF5.h.

◆ ~ParallelSaveDataHDF5()

virtual ParallelSaveDataHDF5::~ParallelSaveDataHDF5 ( )
inlinevirtual

Destructor.

Definition at line 69 of file parallelSaveDataHDF5.h.

Member Function Documentation

◆ openCheckpointFile()

void ParallelSaveDataHDF5::openCheckpointFile ( )

Tries to open a checkpoint file.

If there is not already a checkkpoint file open for this iteration, opens a new one

◆ openFile()

void ParallelSaveDataHDF5::openFile ( const char *  name)

Opens a new HDF5 file.

Function opens a new HDF5 file with a specified filename, and closes any current one.
Parameters
[in]nameFilename to create

◆ saveAll()

void ParallelSaveDataHDF5::saveAll ( bool  timeSeries = false)
overridevirtual

Saves all cons, prims, aux and constant data.

This calls the other member functions to save their respective simulation data.
Parameters
[in]timeSeriesflags whether the saved data is final or transient

Implements SaveData.

◆ saveAux()

void ParallelSaveDataHDF5::saveAux ( )
overridevirtual

Saves the auxiliary vector state.

Implements SaveData.

◆ saveCons()

void ParallelSaveDataHDF5::saveCons ( )
overridevirtual

Saves the conserved vector state.

Implements SaveData.

◆ saveConsts()

void ParallelSaveDataHDF5::saveConsts ( )
overridevirtual

Saves the constant data.

Implements SaveData.

◆ saveDomain()

void ParallelSaveDataHDF5::saveDomain ( )
overridevirtual

Saves the domain coordinates.

Implements SaveData.

◆ savePrims()

void ParallelSaveDataHDF5::savePrims ( )
overridevirtual

Saves the primitive vector state.

Implements SaveData.

◆ saveVar()

void ParallelSaveDataHDF5::saveVar ( string  variable,
int  num = 1 
)
overridevirtual

Saves user specified variable.

Function saves the data for the variable specified by the string var
Parameters
[in]variableDefines the variable the user wants to save. Should match a variable label
[in]numnumber of user-specified variables to save in total (required for consistent numbering of files)

Implements SaveData.

◆ writeDataSetDouble()

void ParallelSaveDataHDF5::writeDataSetDouble ( const hid_t *  group,
const char *  name,
const int *  var,
const double *  data 
)

Writes a new dataset.

Saves a new dataset double to file
Parameters
groupRoot location to save to
nameName of the new dataset
varWhich variable to save within the data array
dataPointer to the data array (cons, prims, aux etc.)

Member Data Documentation

◆ detail

enum ParallelSaveDataHDF5::OutputDetail ParallelSaveDataHDF5::detail

◆ env

ParallelEnv* ParallelSaveDataHDF5::env

Pointer to PlatformEnv class containing platform specific info such as MPI details.

Definition at line 29 of file parallelSaveDataHDF5.h.

◆ file

hid_t ParallelSaveDataHDF5::file = 0

HDF5 file to write to.

Definition at line 31 of file parallelSaveDataHDF5.h.

◆ file_iteration

int ParallelSaveDataHDF5::file_iteration = 0

The simulation iteration this file was opened for.

Definition at line 32 of file parallelSaveDataHDF5.h.

◆ filename

string ParallelSaveDataHDF5::filename

Filename for the HDF5 file. Defaults to 'data.hdf5'.

Definition at line 30 of file parallelSaveDataHDF5.h.


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