OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
H5PartWrapperForPT Class Reference

#include <H5PartWrapperForPT.h>

Inheritance diagram for H5PartWrapperForPT:
Collaboration diagram for H5PartWrapperForPT:

Public Member Functions

 H5PartWrapperForPT (const std::string &fileName, h5_int32_t flags=H5_O_WRONLY)
 H5PartWrapperForPT (const std::string &fileName, int restartStep, std::string sourceFile, h5_int32_t flags=H5_O_RDWR)
virtual ~H5PartWrapperForPT ()
virtual void readHeader ()
virtual void readStep (PartBunch_t *, h5_ssize_t firstParticle, h5_ssize_t lastParticle)
virtual void writeHeader ()
virtual void writeStep (PartBunch_t *, const std::map< std::string, double > &additionalStepAttributes)
virtual bool predecessorIsSameFlavour () const
void close ()
double getLastPosition ()
void storeCavityInformation ()
size_t getNumParticles () const

Protected Member Functions

void open (h5_int32_t flags)
void copyFile (const std::string &sourceFile, int lastStep=-1, h5_int32_t flags=H5_O_WRONLY)
void copyFileSystem (const std::string &sourceFile)
void copyHeader (h5_file_t source)
void copyStep (h5_file_t source, int step)
void copyStepHeader (h5_file_t source)
void copyStepData (h5_file_t source)
void sendFailureMessage (bool failed, const std::string &where, const std::string &what)
void receiveFailureMessage (int sourceNode, const std::string &where, const std::string &what)

Static Protected Member Functions

static void reportOnError (h5_int64_t rc, const char *file, int line)

Protected Attributes

h5_file_t file_m
std::string fileName_m
std::string predecessorOPALFlavour_m
h5_int64_t numSteps_m
bool startedFromExistingFile_m

Static Protected Attributes

static std::string copyFilePrefix_m = ".copy"

Private Member Functions

void readStepHeader (PartBunch_t *)
void readStepData (PartBunch_t *, h5_ssize_t, h5_ssize_t)
void writeStepHeader (PartBunch_t *, const std::map< std::string, double > &)
void writeStepData (PartBunch_t *)

Detailed Description

Definition at line 26 of file H5PartWrapperForPT.h.

Constructor & Destructor Documentation

◆ H5PartWrapperForPT() [1/2]

H5PartWrapperForPT::H5PartWrapperForPT ( const std::string & fileName,
h5_int32_t flags = H5_O_WRONLY )

Definition at line 35 of file H5PartWrapperForPT.cpp.

References H5PartWrapper::H5PartWrapper().

Here is the call graph for this function:

◆ H5PartWrapperForPT() [2/2]

H5PartWrapperForPT::H5PartWrapperForPT ( const std::string & fileName,
int restartStep,
std::string sourceFile,
h5_int32_t flags = H5_O_RDWR )

Definition at line 39 of file H5PartWrapperForPT.cpp.

References H5PartWrapper::file_m, OpalData::getInstance(), H5PartWrapper::H5PartWrapper(), and OpalData::setRestartStep().

Here is the call graph for this function:

◆ ~H5PartWrapperForPT()

H5PartWrapperForPT::~H5PartWrapperForPT ( )
virtual

Definition at line 48 of file H5PartWrapperForPT.cpp.

Member Function Documentation

◆ close()

void H5PartWrapper::close ( )
inherited

Definition at line 59 of file H5PartWrapper.cpp.

References file_m, and REPORTONERROR.

Referenced by copyFile(), H5Writer::H5Writer(), storeCavityInformation(), H5PartWrapperForPT::writeStep(), and ~H5PartWrapper().

Here is the caller graph for this function:

◆ copyFile()

void H5PartWrapper::copyFile ( const std::string & sourceFile,
int lastStep = -1,
h5_int32_t flags = H5_O_WRONLY )
protectedinherited

Definition at line 129 of file H5PartWrapper.cpp.

References close(), copyFilePrefix_m, copyFileSystem(), copyHeader(), copyStep(), fileName_m, numSteps_m, open(), predecessorOPALFlavour_m, READSTEPATTRIB, and REPORTONERROR.

Referenced by H5PartWrapper().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyFileSystem()

void H5PartWrapper::copyFileSystem ( const std::string & sourceFile)
protectedinherited

Definition at line 252 of file H5PartWrapper.cpp.

References fileName_m, receiveFailureMessage(), and sendFailureMessage().

Referenced by copyFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyHeader()

void H5PartWrapper::copyHeader ( h5_file_t source)
protectedinherited

Definition at line 288 of file H5PartWrapper.cpp.

References file_m, READFILEATTRIB, REPORTONERROR, WRITEFILEATTRIB, and WRITESTRINGFILEATTRIB.

Referenced by copyFile().

Here is the caller graph for this function:

◆ copyStep()

void H5PartWrapper::copyStep ( h5_file_t source,
int step )
protectedinherited

Definition at line 352 of file H5PartWrapper.cpp.

References copyStepData(), copyStepHeader(), file_m, numSteps_m, and REPORTONERROR.

Referenced by copyFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyStepData()

void H5PartWrapper::copyStepData ( h5_file_t source)
protectedinherited

Definition at line 429 of file H5PartWrapper.cpp.

References Util::c_data(), file_m, READDATA, REPORTONERROR, and WRITEDATA.

Referenced by copyStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyStepHeader()

void H5PartWrapper::copyStepHeader ( h5_file_t source)
protectedinherited

Definition at line 360 of file H5PartWrapper.cpp.

References file_m, predecessorOPALFlavour_m, READSTEPATTRIB, REPORTONERROR, WRITESTEPATTRIB, and WRITESTRINGSTEPATTRIB.

Referenced by copyStep().

Here is the caller graph for this function:

◆ getLastPosition()

double H5PartWrapper::getLastPosition ( )
inlineinherited

Definition at line 90 of file H5PartWrapper.h.

References file_m, open(), readStep(), READSTEPATTRIB, and REPORTONERROR.

Here is the call graph for this function:

◆ getNumParticles()

size_t H5PartWrapper::getNumParticles ( ) const
inherited

Definition at line 508 of file H5PartWrapper.cpp.

References file_m, numSteps_m, and REPORTONERROR.

Referenced by H5PartWrapperForPT::readStepData().

Here is the caller graph for this function:

◆ open()

void H5PartWrapper::open ( h5_int32_t flags)
protectedinherited

Definition at line 69 of file H5PartWrapper.cpp.

References file_m, and fileName_m.

Referenced by copyFile(), getLastPosition(), H5PartWrapper(), H5PartWrapper(), storeCavityInformation(), and H5PartWrapperForPT::writeStep().

Here is the caller graph for this function:

◆ predecessorIsSameFlavour()

bool H5PartWrapperForPT::predecessorIsSameFlavour ( ) const
inlinevirtual

Implements H5PartWrapper.

Definition at line 51 of file H5PartWrapperForPT.h.

References H5PartWrapper::predecessorOPALFlavour_m.

◆ readHeader()

void H5PartWrapperForPT::readHeader ( )
virtual

Implements H5PartWrapper.

Definition at line 51 of file H5PartWrapperForPT.cpp.

References H5PartWrapper::file_m, OpalData::getInstance(), READFILEATTRIB, REPORTONERROR, OpalData::setGlobalPhaseShift(), and OpalData::setRestartDumpFreq().

Here is the call graph for this function:

◆ readStep()

void H5PartWrapperForPT::readStep ( PartBunch_t * bunch,
h5_ssize_t firstParticle,
h5_ssize_t lastParticle )
virtual

Implements H5PartWrapper.

Definition at line 102 of file H5PartWrapperForPT.cpp.

References H5PartWrapper::file_m, readStep(), readStepData(), readStepHeader(), and REPORTONERROR.

Referenced by readStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readStepData()

void H5PartWrapperForPT::readStepData ( PartBunch_t * bunch,
h5_ssize_t firstParticle,
h5_ssize_t lastParticle )
private

Definition at line 147 of file H5PartWrapperForPT.cpp.

References Util::c_data(), H5PartWrapper::file_m, H5PartWrapper::getNumParticles(), READDATA, and REPORTONERROR.

Referenced by readStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readStepHeader()

void H5PartWrapperForPT::readStepHeader ( PartBunch_t * bunch)
private

Definition at line 112 of file H5PartWrapperForPT.cpp.

References H5PartWrapper::file_m, READSTEPATTRIB, PartBunch< PLayout, T, Dim >::RefPartP_m, PartBunch< PLayout, T, Dim >::RefPartR_m, PartBunch< PLayout, T, Dim >::set_sPos(), PartBunch< PLayout, T, Dim >::setGlobalTrackStep(), PartBunch< PLayout, T, Dim >::setLocalTrackStep(), and PartBunch< PLayout, T, Dim >::setT().

Referenced by readStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ receiveFailureMessage()

void H5PartWrapper::receiveFailureMessage ( int sourceNode,
const std::string & where,
const std::string & what )
protectedinherited

Definition at line 495 of file H5PartWrapper.cpp.

Referenced by copyFileSystem().

Here is the caller graph for this function:

◆ reportOnError()

void H5PartWrapper::reportOnError ( h5_int64_t rc,
const char * file,
int line )
inlinestaticprotectedinherited

Definition at line 85 of file H5PartWrapper.h.

◆ sendFailureMessage()

void H5PartWrapper::sendFailureMessage ( bool failed,
const std::string & where,
const std::string & what )
protectedinherited

Definition at line 483 of file H5PartWrapper.cpp.

Referenced by copyFileSystem().

Here is the caller graph for this function:

◆ storeCavityInformation()

void H5PartWrapper::storeCavityInformation ( )
inherited

Write number of Cavities with autophase information

Definition at line 82 of file H5PartWrapper.cpp.

References close(), end(), file_m, OpalData::getFirstMaxPhases(), OpalData::getInstance(), OpalData::getLastMaxPhases(), OpalData::getNumberOfMaxPhases(), open(), WRITEFILEATTRIB, and WRITESTRINGFILEATTRIB.

Here is the call graph for this function:

◆ writeHeader()

void H5PartWrapperForPT::writeHeader ( )
virtual

Write file dump frequency.

Write global phase change

Implements H5PartWrapper.

Definition at line 209 of file H5PartWrapperForPT.cpp.

References Options::ebDump, H5PartWrapper::file_m, Util::getGitRevision(), OpalData::getGlobalPhaseShift(), OpalData::getInstance(), OPAL_PROJECT_NAME, OPAL_PROJECT_VERSION, Options::psDumpFreq, Options::rhoDump, WRITEFILEATTRIB, and WRITESTRINGFILEATTRIB.

Here is the call graph for this function:

◆ writeStep()

void H5PartWrapperForPT::writeStep ( PartBunch_t * bunch,
const std::map< std::string, double > & additionalStepAttributes )
virtual

Implements H5PartWrapper.

Definition at line 292 of file H5PartWrapperForPT.cpp.

References PartBunch< PLayout, T, Dim >::calcBeamParameters(), H5PartWrapper::close(), PartBunch< PLayout, T, Dim >::getTotalNum(), H5PartWrapper::open(), writeStepData(), and writeStepHeader().

Here is the call graph for this function:

◆ writeStepData()

void H5PartWrapperForPT::writeStepData ( PartBunch_t * bunch)
private

Definition at line 410 of file H5PartWrapperForPT.cpp.

References Util::c_data(), Options::ebDump, H5PartWrapper::file_m, PartBunch< PLayout, T, Dim >::getLocalNum(), PartBunch< PLayout, T, Dim >::getParticleContainer(), REPORTONERROR, and WRITEDATA.

Referenced by writeStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeStepHeader()

void H5PartWrapperForPT::writeStepHeader ( PartBunch_t * bunch,
const std::map< std::string, double > & additionalStepAttributes )
private

Write particle mass and charge per particle. (Consider making these file attributes.)

Definition at line 305 of file H5PartWrapperForPT.cpp.

References Physics::c, Physics::epsilon_0, Units::eV2GeV, H5PartWrapper::file_m, PartBunch< PLayout, T, Dim >::get_centroid(), PartBunch< PLayout, T, Dim >::get_emit(), PartBunch< PLayout, T, Dim >::get_gamma(), PartBunch< PLayout, T, Dim >::get_maxExtent(), PartBunch< PLayout, T, Dim >::get_meanKineticEnergy(), PartBunch< PLayout, T, Dim >::get_norm_emit(), PartBunch< PLayout, T, Dim >::get_origin(), PartBunch< PLayout, T, Dim >::get_pmean(), PartBunch< PLayout, T, Dim >::get_prms(), PartBunch< PLayout, T, Dim >::get_rrms(), PartBunch< PLayout, T, Dim >::get_sPos(), PartBunch< PLayout, T, Dim >::getCharge(), PartBunch< PLayout, T, Dim >::getdE(), PartBunch< PLayout, T, Dim >::getGlobalTrackStep(), PartBunch< PLayout, T, Dim >::getLocalTrackStep(), PartBunch< PLayout, T, Dim >::getM(), PartBunch< PLayout, T, Dim >::getQ(), PartBunch< PLayout, T, Dim >::getT(), H5PartWrapper::numSteps_m, Physics::pi, PartBunch< PLayout, T, Dim >::RefPartP_m, PartBunch< PLayout, T, Dim >::RefPartR_m, REPORTONERROR, WRITESTEPATTRIB, and WRITESTRINGSTEPATTRIB.

Referenced by writeStep().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ copyFilePrefix_m

std::string H5PartWrapper::copyFilePrefix_m = ".copy"
staticprotectedinherited

Definition at line 82 of file H5PartWrapper.h.

Referenced by copyFile().

◆ file_m

◆ fileName_m

std::string H5PartWrapper::fileName_m
protectedinherited

Definition at line 77 of file H5PartWrapper.h.

Referenced by copyFile(), copyFileSystem(), H5PartWrapper(), H5PartWrapper(), and open().

◆ numSteps_m

h5_int64_t H5PartWrapper::numSteps_m
protectedinherited

◆ predecessorOPALFlavour_m

std::string H5PartWrapper::predecessorOPALFlavour_m
protectedinherited

◆ startedFromExistingFile_m

bool H5PartWrapper::startedFromExistingFile_m
protectedinherited

Definition at line 80 of file H5PartWrapper.h.

Referenced by H5PartWrapper(), and H5PartWrapper().


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