METHOD
SerialSaveDataHDF5 Class Reference

#include <serialSaveDataHDF5.h>

Inheritance diagram for SerialSaveDataHDF5:
Collaboration diagram for SerialSaveDataHDF5:

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
 
 SerialSaveDataHDF5 (Data *data, SerialEnv *env, string filename="data", OutputDetail detail=OUTPUT_ALL)
 
virtual ~SerialSaveDataHDF5 ()
 
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

SerialEnvenv
 
string filename
 
hid_t file = 0
 
int file_iteration = 0
 
enum SerialSaveDataHDF5::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 a single process

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 26 of file serialSaveDataHDF5.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 37 of file serialSaveDataHDF5.h.

Constructor & Destructor Documentation

◆ SerialSaveDataHDF5()

SerialSaveDataHDF5::SerialSaveDataHDF5 ( Data data,
SerialEnv env,
string  filename = "data",
OutputDetail  detail = OUTPUT_ALL 
)
inline

Constructor.

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

Definition at line 64 of file serialSaveDataHDF5.h.

◆ ~SerialSaveDataHDF5()

virtual SerialSaveDataHDF5::~SerialSaveDataHDF5 ( )
inlinevirtual

Destructor.

Definition at line 71 of file serialSaveDataHDF5.h.

Member Function Documentation

◆ openCheckpointFile()

void SerialSaveDataHDF5::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 SerialSaveDataHDF5::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 SerialSaveDataHDF5::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 SerialSaveDataHDF5::saveAux ( )
overridevirtual

Saves the auxiliary vector state.

Implements SaveData.

◆ saveCons()

void SerialSaveDataHDF5::saveCons ( )
overridevirtual

Saves the conserved vector state.

Implements SaveData.

◆ saveConsts()

void SerialSaveDataHDF5::saveConsts ( )
overridevirtual

Saves the constant data.

Implements SaveData.

◆ saveDomain()

void SerialSaveDataHDF5::saveDomain ( )
overridevirtual

Saves the domain coordinates.

Implements SaveData.

◆ savePrims()

void SerialSaveDataHDF5::savePrims ( )
overridevirtual

Saves the primitive vector state.

Implements SaveData.

◆ saveVar()

void SerialSaveDataHDF5::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 SerialSaveDataHDF5::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 SerialSaveDataHDF5::OutputDetail SerialSaveDataHDF5::detail

◆ env

SerialEnv* SerialSaveDataHDF5::env

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

Definition at line 31 of file serialSaveDataHDF5.h.

◆ file

hid_t SerialSaveDataHDF5::file = 0

HDF5 file to write to.

Definition at line 33 of file serialSaveDataHDF5.h.

◆ file_iteration

int SerialSaveDataHDF5::file_iteration = 0

The simulation iteration this file was opened for.

Definition at line 34 of file serialSaveDataHDF5.h.

◆ filename

string SerialSaveDataHDF5::filename

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

Definition at line 32 of file serialSaveDataHDF5.h.


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