OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <H5PartWrapperForPT.h>
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 (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 |
![]() | |
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 > *) |
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" |
Definition at line 25 of file H5PartWrapperForPT.h.
H5PartWrapperForPT::H5PartWrapperForPT | ( | const std::string & | fileName, |
h5_int32_t | flags = H5_O_WRONLY |
||
) |
Definition at line 34 of file H5PartWrapperForPT.cpp.
H5PartWrapperForPT::H5PartWrapperForPT | ( | const std::string & | fileName, |
int | restartStep, | ||
std::string | sourceFile, | ||
h5_int32_t | flags = H5_O_RDWR |
||
) |
Definition at line 38 of file H5PartWrapperForPT.cpp.
References H5PartWrapper::file_m, OpalData::getInstance(), and OpalData::setRestartStep().
|
virtual |
Definition at line 47 of file H5PartWrapperForPT.cpp.
|
inlinevirtual |
Implements H5PartWrapper.
Definition at line 48 of file H5PartWrapperForPT.h.
References H5PartWrapper::predecessorOPALFlavour_m.
|
virtual |
Implements H5PartWrapper.
Definition at line 50 of file H5PartWrapperForPT.cpp.
References H5PartWrapper::file_m, OpalData::getInstance(), name, READFILEATTRIB, REPORTONERROR, OpalData::setGlobalPhaseShift(), and OpalData::setRestartDumpFreq().
|
virtual |
Implements H5PartWrapper.
Definition at line 104 of file H5PartWrapperForPT.cpp.
References H5PartWrapper::file_m, readStepData(), readStepHeader(), and REPORTONERROR.
|
private |
Definition at line 147 of file H5PartWrapperForPT.cpp.
References PartBunchBase< T, Dim >::Bin, Util::c_data(), H5PartWrapper::file_m, H5PartWrapper::getNumParticles(), PartBunchBase< T, Dim >::ID, Hypervolume::n, PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::Q, PartBunchBase< T, Dim >::R, READDATA, and REPORTONERROR.
Referenced by readStep().
|
private |
Definition at line 113 of file H5PartWrapperForPT.cpp.
References Quaternion::conjugate(), cos(), H5PartWrapper::file_m, READSTEPATTRIB, PartBunchBase< T, Dim >::RefPartP_m, PartBunchBase< T, Dim >::RefPartR_m, Quaternion::rotate(), PartBunchBase< T, Dim >::set_sPos(), PartBunchBase< T, Dim >::setGlobalTrackStep(), PartBunchBase< T, Dim >::setLocalTrackStep(), PartBunchBase< T, Dim >::setT(), sin(), and PartBunchBase< T, Dim >::toLabTrafo_m.
Referenced by readStep().
|
virtual |
Write file dump frequency.
Write global phase change
Implements H5PartWrapper.
Definition at line 207 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.
|
virtual |
Implements H5PartWrapper.
Definition at line 290 of file H5PartWrapperForPT.cpp.
References PartBunchBase< T, Dim >::calcBeamParameters(), H5PartWrapper::close(), PartBunchBase< T, Dim >::getTotalNum(), H5PartWrapper::open(), writeStepData(), and writeStepHeader().
|
private |
Write space charge field map if asked for.
Need this to align particles and fields when writing space charge map.
Definition at line 401 of file H5PartWrapperForPT.cpp.
References PartBunchBase< T, Dim >::Bf, 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 >::ID, max(), min(), PartBunchBase< T, Dim >::P, PartBunchBase< T, Dim >::POrigin, PartBunchBase< T, Dim >::PType, PartBunchBase< T, Dim >::Q, PartBunchBase< T, Dim >::R, H5PartWrapper::reportOnError(), REPORTONERROR, Options::rhoDump, and WRITEDATA.
Referenced by writeStep().
|
private |
Write particle mass and charge per particle. (Consider making these file attributes.)
Definition at line 300 of file H5PartWrapperForPT.cpp.
References Physics::c, 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_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 >::getQ(), CoordinateSystemTrafo::getRotation(), PartBunchBase< T, Dim >::getT(), Util::getTaitBryantAngles(), H5PartWrapper::numSteps_m, Physics::pi, PartBunchBase< T, Dim >::RefPartP_m, PartBunchBase< T, Dim >::RefPartR_m, REPORTONERROR, PartBunchBase< T, Dim >::toLabTrafo_m, WRITESTEPATTRIB, and WRITESTRINGSTEPATTRIB.
Referenced by writeStep().