OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <H5PartWrapperForPC.h>
Public Member Functions | |
H5PartWrapperForPC (const std::string &fileName, h5_int32_t flags=H5_O_WRONLY) | |
H5PartWrapperForPC (const std::string &fileName, int restartStep, std::string sourceFile, h5_int32_t flags=H5_O_RDWR) | |
virtual | ~H5PartWrapperForPC () |
virtual void | readHeader () |
virtual void | readStep (PartBunchBase< double, 3 > *, h5_ssize_t firstParticle, h5_ssize_t lastParticle) |
virtual void | writeHeader () |
virtual void | writeStep (PartBunchBase< double, 3 > *, const std::map< std::string, double > &additionalStepAttributes) |
virtual bool | predecessorIsSameFlavour () const |
bool | getPreviousH5Local () const |
double | getReferenceR () const |
double | getReferenceT () const |
double | getReferenceZ () const |
double | getReferencePr () const |
double | getReferencePt () const |
double | getReferencePz () const |
double | getMeanKineticEnergy () const |
double | getMeanMomentum () const |
double | getAzimuth () const |
double | getElevation () const |
![]() | |
virtual | ~H5PartWrapper () |
void | close () |
double | getLastPosition () |
void | storeCavityInformation () |
size_t | getNumParticles () const |
Private Member Functions | |
void | readStepHeader (PartBunchBase< double, 3 > *) |
void | readStepData (PartBunchBase< double, 3 > *, h5_ssize_t, h5_ssize_t) |
void | writeStepHeader (PartBunchBase< double, 3 > *, const std::map< std::string, double > &) |
void | writeStepData (PartBunchBase< double, 3 > *) |
Private Attributes | |
bool | previousH5Local_m |
Vector_t | referenceMomentum_m |
Vector_t | referenceLocation_m |
h5_float64_t | meanE_m |
h5_float64_t | meanMomentum_m |
h5_float64_t | azimuth_m |
h5_float64_t | elevation_m |
Additional Inherited Members | |
![]() | |
H5PartWrapper (const std::string &fileName, h5_int32_t flags=H5_O_WRONLY) | |
H5PartWrapper (const std::string &fileName, int restartStep, std::string sourceFile, h5_int32_t flags=H5_O_RDWR) | |
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 void | reportOnError (h5_int64_t rc, const char *file, int line) |
![]() | |
h5_file_t | file_m |
std::string | fileName_m |
std::string | predecessorOPALFlavour_m |
h5_int64_t | numSteps_m |
bool | startedFromExistingFile_m |
![]() | |
static std::string | copyFilePrefix_m = ".copy" |
H5PartWrapperForPC: a class that manages calls to H5Part for the cyclotron tracker
Definition at line 14 of file H5PartWrapperForPC.h.
H5PartWrapperForPC::H5PartWrapperForPC | ( | const std::string & | fileName, |
h5_int32_t | flags = H5_O_WRONLY |
||
) |
Definition at line 17 of file H5PartWrapperForPC.cpp.
H5PartWrapperForPC::H5PartWrapperForPC | ( | const std::string & | fileName, |
int | restartStep, | ||
std::string | sourceFile, | ||
h5_int32_t | flags = H5_O_RDWR |
||
) |
Definition at line 28 of file H5PartWrapperForPC.cpp.
|
virtual |
Definition at line 42 of file H5PartWrapperForPC.cpp.
|
inline |
Definition at line 106 of file H5PartWrapperForPC.h.
References azimuth_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 111 of file H5PartWrapperForPC.h.
References elevation_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 96 of file H5PartWrapperForPC.h.
References meanE_m.
|
inline |
Definition at line 101 of file H5PartWrapperForPC.h.
References meanMomentum_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 61 of file H5PartWrapperForPC.h.
References previousH5Local_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 81 of file H5PartWrapperForPC.h.
References referenceMomentum_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 86 of file H5PartWrapperForPC.h.
References referenceMomentum_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 91 of file H5PartWrapperForPC.h.
References referenceMomentum_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 66 of file H5PartWrapperForPC.h.
References referenceLocation_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 71 of file H5PartWrapperForPC.h.
References referenceLocation_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inline |
Definition at line 76 of file H5PartWrapperForPC.h.
References referenceLocation_m.
Referenced by TrackRun::setupCyclotronTracker().
|
inlinevirtual |
Implements H5PartWrapper.
Definition at line 56 of file H5PartWrapperForPC.h.
References H5PartWrapper::predecessorOPALFlavour_m.
|
virtual |
Implements H5PartWrapper.
Definition at line 45 of file H5PartWrapperForPC.cpp.
References H5PartWrapper::file_m, OpalData::getInstance(), READFILEATTRIB, REPORTONERROR, and OpalData::setRestartDumpFreq().
|
virtual |
Implements H5PartWrapper.
Definition at line 72 of file H5PartWrapperForPC.cpp.
References H5PartWrapper::file_m, readStepData(), readStepHeader(), and REPORTONERROR.
Referenced by MultiBunchHandler::readBunch().
|
private |
Definition at line 147 of file H5PartWrapperForPC.cpp.
References PartBunchBase< T, Dim >::Bin, PartBunchBase< T, Dim >::bunchNum, Util::c_data(), H5PartWrapper::file_m, PartBunchBase< T, Dim >::getNumBunch(), H5PartWrapper::getNumParticles(), PartBunchBase< T, Dim >::M, Hypervolume::n, PartBunchBase< T, Dim >::P, H5PartWrapper::predecessorOPALFlavour_m, PartBunchBase< T, Dim >::Q, PartBunchBase< T, Dim >::R, READDATA, and REPORTONERROR.
Referenced by readStep().
|
private |
Definition at line 84 of file H5PartWrapperForPC.cpp.
References azimuth_m, Physics::e, elevation_m, endl(), ERRORMSG, H5PartWrapper::file_m, PartBunchBase< T, Dim >::getM(), meanE_m, meanMomentum_m, pow(), H5PartWrapper::predecessorOPALFlavour_m, previousH5Local_m, READSTEPATTRIB, referenceLocation_m, referenceMomentum_m, PartBunchBase< T, Dim >::set_sPos(), PartBunchBase< T, Dim >::setGlobalTrackStep(), PartBunchBase< T, Dim >::setLocalTrackStep(), PartBunchBase< T, Dim >::setNumBunch(), PartBunchBase< T, Dim >::setSteptoLastInj(), PartBunchBase< T, Dim >::setT(), and sqrt().
Referenced by readStep().
|
virtual |
Write file dump frequency.
Implements H5PartWrapper.
Definition at line 224 of file H5PartWrapperForPC.cpp.
References Options::ebDump, H5PartWrapper::file_m, Util::getGitRevision(), OPAL_PROJECT_NAME, OPAL_PROJECT_VERSION, Options::psDumpFreq, WRITEFILEATTRIB, and WRITESTRINGFILEATTRIB.
Referenced by MultiBunchHandler::saveBunch().
|
virtual |
Implements H5PartWrapper.
Definition at line 310 of file H5PartWrapperForPC.cpp.
References H5PartWrapper::close(), PartBunchBase< T, Dim >::getTotalNum(), H5PartWrapper::numSteps_m, H5PartWrapper::open(), writeStepData(), and writeStepHeader().
Referenced by MultiBunchHandler::saveBunch().
|
private |
Write space charge field map if asked for.
Need this to align particles and fields when writing space charge map.
Definition at line 463 of file H5PartWrapperForPC.cpp.
References PartBunchBase< T, Dim >::Bf, PartBunchBase< T, Dim >::Bin, PartBunchBase< T, Dim >::bunchNum, Util::c_data(), Options::ebDump, PartBunchBase< T, Dim >::Ef, H5PartWrapper::file_m, PartBunchBase< T, Dim >::get_hr(), PartBunchBase< T, Dim >::get_origin(), PartBunchBase< T, Dim >::getFieldLayout(), FieldLayout< Dim >::getLocalNDIndex(), PartBunchBase< T, Dim >::getLocalNum(), PartBunchBase< T, Dim >::getRho(), PartBunchBase< T, Dim >::hasBinning(), PartBunchBase< T, Dim >::ID, PartBunchBase< T, Dim >::M, max(), min(), PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::Q, PartBunchBase< T, Dim >::R, REPORTONERROR, Options::rhoDump, and WRITEDATA.
Referenced by writeStep().
|
private |
Write particle mass and charge per particle. (Consider making these file attributes.)
Definition at line 323 of file H5PartWrapperForPC.cpp.
References Physics::c, PartBunchBase< T, Dim >::calcBeamParameters(), endl(), Physics::epsilon_0, ERRORMSG, H5PartWrapper::file_m, PartBunchBase< T, Dim >::get_centroid(), PartBunchBase< T, Dim >::get_emit(), PartBunchBase< T, Dim >::get_gamma(), PartBunchBase< T, Dim >::get_maxExtent(), PartBunchBase< T, Dim >::get_meanKineticEnergy(), PartBunchBase< T, Dim >::get_norm_emit(), PartBunchBase< T, Dim >::get_origin(), PartBunchBase< T, Dim >::get_PBounds(), PartBunchBase< T, Dim >::get_pmean(), PartBunchBase< T, Dim >::get_prms(), PartBunchBase< T, Dim >::get_rmean(), PartBunchBase< T, Dim >::get_rrms(), PartBunchBase< T, Dim >::get_sPos(), PartBunchBase< T, Dim >::getCharge(), PartBunchBase< T, Dim >::getdE(), PartBunchBase< T, Dim >::getGlobalTrackStep(), PartBunchBase< T, Dim >::getLocalTrackStep(), PartBunchBase< T, Dim >::getM(), PartBunchBase< T, Dim >::getNumBunch(), PartBunchBase< T, Dim >::getQ(), PartBunchBase< T, Dim >::getSteptoLastInj(), PartBunchBase< T, Dim >::getT(), Options::GLOBAL, H5PartWrapper::numSteps_m, Physics::pi, Options::psDumpFrame, PartBunchBase< T, Dim >::RefPartP_m, PartBunchBase< T, Dim >::RefPartR_m, REPORTONERROR, WRITESTEPATTRIB, and WRITESTRINGSTEPATTRIB.
Referenced by writeStep().
|
private |
Definition at line 51 of file H5PartWrapperForPC.h.
Referenced by getAzimuth(), and readStepHeader().
|
private |
Definition at line 52 of file H5PartWrapperForPC.h.
Referenced by getElevation(), and readStepHeader().
|
private |
Definition at line 49 of file H5PartWrapperForPC.h.
Referenced by getMeanKineticEnergy(), and readStepHeader().
|
private |
Definition at line 50 of file H5PartWrapperForPC.h.
Referenced by getMeanMomentum(), and readStepHeader().
|
private |
Definition at line 46 of file H5PartWrapperForPC.h.
Referenced by getPreviousH5Local(), and readStepHeader().
|
private |
Definition at line 48 of file H5PartWrapperForPC.h.
Referenced by getReferenceR(), getReferenceT(), getReferenceZ(), and readStepHeader().
|
private |
Definition at line 47 of file H5PartWrapperForPC.h.
Referenced by getReferencePr(), getReferencePt(), getReferencePz(), and readStepHeader().