OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
LossDataSink.cpp File Reference
#include "Structure/LossDataSink.h"
#include "AbstractObjects/OpalData.h"
#include "Algorithms/DistributionMoments.h"
#include "Message/GlobalComm.h"
#include "OPALconfig.h"
#include "Utilities/GeneralClassicException.h"
#include "Utilities/Options.h"
#include "Utilities/Util.h"
#include "Utility/IpplInfo.h"
#include <cmath>
#include <filesystem>
Include dependency graph for LossDataSink.cpp:

Go to the source code of this file.

Macros

#define WRITE_FILEATTRIB_STRING(attribute, value)
#define WRITE_STEPATTRIB_FLOAT64(attribute, value, size)
#define WRITE_STEPATTRIB_INT64(attribute, value, size)
#define WRITE_DATA_FLOAT64(name, value)
#define WRITE_DATA_INT64(name, value)
#define SET_STEP()
#define GET_NUM_STEPS()
#define SET_NUM_PARTICLES(num)
#define OPEN_FILE(fname, mode, props)
#define CLOSE_FILE()

Variables

Informgmsg

Macro Definition Documentation

◆ CLOSE_FILE

#define CLOSE_FILE ( )
Value:
{ \
h5_int64_t h5err = H5CloseFile(H5file_m); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to close file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 118 of file LossDataSink.cpp.

Referenced by LossDataSink::save(), and LossDataSink::~LossDataSink().

◆ GET_NUM_STEPS

#define GET_NUM_STEPS ( )
Value:
{ \
H5call_m = H5GetNumSteps(H5file_m); \
if (H5call_m <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to get number of steps of file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 89 of file LossDataSink.cpp.

Referenced by LossDataSink::save().

◆ OPEN_FILE

#define OPEN_FILE ( fname,
mode,
props )
Value:
{ \
H5file_m = H5OpenFile(fname, mode, props); \
if (H5file_m == (h5_file_t)H5_ERR) { \
std::stringstream ss; \
ss << "failed to open file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 109 of file LossDataSink.cpp.

Referenced by LossDataSink::openH5().

◆ SET_NUM_PARTICLES

#define SET_NUM_PARTICLES ( num)
Value:
{ \
h5_int64_t h5err = H5PartSetNumParticles(H5file_m, num); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to set number of particles to " << num << " in step " << H5call_m \
<< " in file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 98 of file LossDataSink.cpp.

Referenced by LossDataSink::saveH5().

◆ SET_STEP

#define SET_STEP ( )
Value:
{ \
h5_int64_t h5err = H5SetStep(H5file_m, H5call_m); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to set step " << H5call_m << " in file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 80 of file LossDataSink.cpp.

Referenced by LossDataSink::saveH5().

◆ WRITE_DATA_FLOAT64

#define WRITE_DATA_FLOAT64 ( name,
value )
Value:
{ \
h5_int64_t h5err = H5PartWriteDataFloat64(H5file_m, name, value); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to write float64 data " << name << " to file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}
const std::string name

Definition at line 62 of file LossDataSink.cpp.

Referenced by LossDataSink::saveH5().

◆ WRITE_DATA_INT64

#define WRITE_DATA_INT64 ( name,
value )
Value:
{ \
h5_int64_t h5err = H5PartWriteDataInt64(H5file_m, name, value); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to write int64 data " << name << " to file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 71 of file LossDataSink.cpp.

Referenced by LossDataSink::saveH5().

◆ WRITE_FILEATTRIB_STRING

#define WRITE_FILEATTRIB_STRING ( attribute,
value )
Value:
{ \
h5_int64_t h5err = H5WriteFileAttribString(H5file_m, attribute, value); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to write string attribute " << attribute << " to file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 35 of file LossDataSink.cpp.

Referenced by LossDataSink::writeHeaderH5().

◆ WRITE_STEPATTRIB_FLOAT64

#define WRITE_STEPATTRIB_FLOAT64 ( attribute,
value,
size )
Value:
{ \
h5_int64_t h5err = H5WriteStepAttribFloat64(H5file_m, attribute, value, size); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to write float64 attribute " << attribute << " to file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 44 of file LossDataSink.cpp.

Referenced by LossDataSink::saveH5().

◆ WRITE_STEPATTRIB_INT64

#define WRITE_STEPATTRIB_INT64 ( attribute,
value,
size )
Value:
{ \
h5_int64_t h5err = H5WriteStepAttribInt64(H5file_m, attribute, value, size); \
if (h5err <= H5_ERR) { \
std::stringstream ss; \
ss << "failed to write int64 attribute " << attribute << " to file " << fileName_m; \
throw GeneralClassicException(std::string(__func__), ss.str()); \
} \
}

Definition at line 53 of file LossDataSink.cpp.

Referenced by LossDataSink::saveH5().

Variable Documentation

◆ gmsg

Inform* gmsg
extern

Definition at line 70 of file Main.cpp.