OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
|
#include <DataSink.h>
Public Member Functions | |
DataSink () | |
Default constructor. More... | |
DataSink (H5PartWrapper *h5wrapper, bool restart, short numBunch) | |
DataSink (H5PartWrapper *h5wrapper, short numBunch) | |
void | dumpH5 (PartBunchBase< double, 3 > *beam, Vector_t FDext[]) const |
int | dumpH5 (PartBunchBase< double, 3 > *beam, Vector_t FDext[], double meanEnergy, double refPr, double refPt, double refPz, double refR, double refTheta, double refZ, double azimuth, double elevation, bool local) const |
void | dumpSDDS (PartBunchBase< double, 3 > *beam, Vector_t FDext[], const double &azimuth=-1) const |
void | dumpSDDS (PartBunchBase< double, 3 > *beam, Vector_t FDext[], const losses_t &losses=losses_t(), const double &azimuth=-1) const |
void | storeCavityInformation () |
Write cavity information from H5 file. More... | |
void | changeH5Wrapper (H5PartWrapper *h5wrapper) |
void | writeGeomToVtk (BoundaryGeometry &bg, std::string fn) |
void | writeImpactStatistics (const PartBunchBase< double, 3 > *beam, long long int &step, size_t &impact, double &sey_num, size_t numberOfFieldEmittedParticles, bool nEmissionMode, std::string fn) |
void | writeMultiBunchStatistics (PartBunchBase< double, 3 > *beam, MultiBunchHandler *mbhandler) |
void | setMultiBunchInitialPathLengh (MultiBunchHandler *mbhandler_p) |
Private Types | |
typedef StatWriter::losses_t | losses_t |
typedef std::unique_ptr< StatWriter > | statWriter_t |
typedef std::unique_ptr< SDDSWriter > | sddsWriter_t |
typedef std::unique_ptr< H5Writer > | h5Writer_t |
typedef std::unique_ptr< MultiBunchDump > | mbWriter_t |
Private Member Functions | |
DataSink (const DataSink &ds)=delete | |
DataSink & | operator= (const DataSink &)=delete |
void | rewindLines () |
void | init (bool restart=false, H5PartWrapper *h5wrapper=nullptr, short numBunch=1) |
void | initMultiBunchDump (short numBunch) |
Static Private Member Functions | |
static std::string | convertToString (int number, int setw=5) |
Private Attributes | |
h5Writer_t | h5Writer_m |
statWriter_t | statWriter_m |
std::vector< sddsWriter_t > | sddsWriter_m |
std::vector< mbWriter_t > | mbWriter_m |
unsigned int | lossWrCounter_m |
needed to create index for vtk file More... | |
IpplTimings::TimerRef | StatMarkerTimer_m |
Timer to track statistics write time. More... | |
const bool | isMultiBunch_m |
Definition at line 49 of file DataSink.h.
|
private |
Definition at line 54 of file DataSink.h.
|
private |
Definition at line 51 of file DataSink.h.
|
private |
Definition at line 55 of file DataSink.h.
|
private |
Definition at line 53 of file DataSink.h.
|
private |
Definition at line 52 of file DataSink.h.
DataSink::DataSink | ( | ) |
Default constructor.
The default constructor is called at the start of a new calculation (as opposed to a calculation restart).
Definition at line 63 of file DataSink.cpp.
References init().
DataSink::DataSink | ( | H5PartWrapper * | h5wrapper, |
bool | restart, | ||
short | numBunch | ||
) |
Definition at line 70 of file DataSink.cpp.
References Options::enableHDF5, init(), and rewindLines().
DataSink::DataSink | ( | H5PartWrapper * | h5wrapper, |
short | numBunch | ||
) |
Definition at line 85 of file DataSink.cpp.
|
privatedelete |
void DataSink::changeH5Wrapper | ( | H5PartWrapper * | h5wrapper | ) |
Definition at line 145 of file DataSink.cpp.
References Options::enableHDF5, and h5Writer_m.
Referenced by TrackRun::initDataSink().
|
inlinestaticprivate |
Definition at line 155 of file DataSink.h.
Referenced by initMultiBunchDump().
void DataSink::dumpH5 | ( | PartBunchBase< double, 3 > * | beam, |
Vector_t | FDext[] | ||
) | const |
Definition at line 90 of file DataSink.cpp.
References Options::enableHDF5, and h5Writer_m.
Referenced by ParallelCyclotronTracker::bunchDumpPhaseSpaceData(), ThickTracker::dump_m(), and ParallelTTracker::writePhaseSpace().
int DataSink::dumpH5 | ( | PartBunchBase< double, 3 > * | beam, |
Vector_t | FDext[], | ||
double | meanEnergy, | ||
double | refPr, | ||
double | refPt, | ||
double | refPz, | ||
double | refR, | ||
double | refTheta, | ||
double | refZ, | ||
double | azimuth, | ||
double | elevation, | ||
bool | local | ||
) | const |
Definition at line 97 of file DataSink.cpp.
References Options::enableHDF5, and h5Writer_m.
void DataSink::dumpSDDS | ( | PartBunchBase< double, 3 > * | beam, |
Vector_t | FDext[], | ||
const double & | azimuth = -1 |
||
) | const |
Definition at line 109 of file DataSink.cpp.
Referenced by ParallelCyclotronTracker::bunchDumpStatData(), ThickTracker::dump_m(), P3MPoissonSolver::test(), and ParallelTTracker::writePhaseSpace().
void DataSink::dumpSDDS | ( | PartBunchBase< double, 3 > * | beam, |
Vector_t | FDext[], | ||
const losses_t & | losses = losses_t() , |
||
const double & | azimuth = -1 |
||
) | const |
Definition at line 116 of file DataSink.cpp.
References Options::beamHaloBoundary, PartBunchBase< T, Dim >::calcBeamParameters(), PartBunchBase< T, Dim >::calcNumPartsOutside(), PartBunchBase< T, Dim >::gatherLoadBalanceStatistics(), PartBunchBase< T, Dim >::get_rrms(), sddsWriter_m, IpplTimings::startTimer(), StatMarkerTimer_m, statWriter_m, and IpplTimings::stopTimer().
|
private |
Definition at line 273 of file DataSink.cpp.
References Options::amr, Options::enableHDF5, OpalData::getInputBasename(), OpalData::getInstance(), IpplTimings::getTimer(), h5Writer_m, initMultiBunchDump(), isMultiBunch_m, lossWrCounter_m, Options::memoryDump, sddsWriter_m, StatMarkerTimer_m, and statWriter_m.
Referenced by DataSink().
|
private |
Definition at line 315 of file DataSink.cpp.
References convertToString(), OpalData::getInputBasename(), OpalData::getInstance(), OpalData::inRestartRun(), and mbWriter_m.
Referenced by init().
|
private |
Definition at line 236 of file DataSink.cpp.
References h5Writer_m, isMultiBunch_m, mbWriter_m, sddsWriter_m, and statWriter_m.
Referenced by DataSink().
void DataSink::setMultiBunchInitialPathLengh | ( | MultiBunchHandler * | mbhandler_p | ) |
In restart mode we need to set the correct path length of each bunch
mbhandler | is the multi-bunch handler |
Definition at line 222 of file DataSink.cpp.
References MultiBunchHandler::getBunchInfo(), MultiBunchHandler::getNumBunch(), mbWriter_m, MultiBunchHandler::beaminfo_t::pathlength, and statWriter_m.
Referenced by ParallelCyclotronTracker::initPathLength().
void DataSink::storeCavityInformation | ( | ) |
Write cavity information from H5 file.
Definition at line 138 of file DataSink.cpp.
References Options::enableHDF5, and h5Writer_m.
Referenced by ParallelTTracker::saveCavityPhases().
void DataSink::writeGeomToVtk | ( | BoundaryGeometry & | bg, |
std::string | fn | ||
) |
Write geometry points and surface triangles to vtk file
fn | specifies the name of vtk file contains the geometry |
Definition at line 152 of file DataSink.cpp.
References Options::enableVTK, IpplInfo::myNode(), and BoundaryGeometry::writeGeomToVtk().
void DataSink::writeImpactStatistics | ( | const PartBunchBase< double, 3 > * | beam, |
long long int & | step, | ||
size_t & | impact, | ||
double & | sey_num, | ||
size_t | numberOfFieldEmittedParticles, | ||
bool | nEmissionMode, | ||
std::string | fn | ||
) |
Write impact number and outgoing secondaries in each time step
fn | specifies the name of vtk file contains the geometry |
Definition at line 159 of file DataSink.cpp.
References Inform::APPEND, endl(), PartBunchBase< T, Dim >::getCharge(), PartBunchBase< T, Dim >::getChargePerParticle(), PartBunchBase< T, Dim >::getT(), PartBunchBase< T, Dim >::getTotalNum(), IpplInfo::myNode(), and Inform::precision().
void DataSink::writeMultiBunchStatistics | ( | PartBunchBase< double, 3 > * | beam, |
MultiBunchHandler * | mbhandler | ||
) |
no statWriter_m dump
beam | |
mbhandler | is the multi-bunch handler |
Start timer.
Stop timer.
Definition at line 201 of file DataSink.cpp.
References MultiBunchHandler::calcBunchBeamParameters(), MultiBunchHandler::getBunchInfo(), MultiBunchHandler::getNumBunch(), mbWriter_m, sddsWriter_m, IpplTimings::startTimer(), StatMarkerTimer_m, and IpplTimings::stopTimer().
Referenced by ParallelCyclotronTracker::bunchDumpStatData().
|
private |
Definition at line 135 of file DataSink.h.
Referenced by changeH5Wrapper(), dumpH5(), init(), rewindLines(), and storeCavityInformation().
|
private |
Definition at line 148 of file DataSink.h.
Referenced by init(), and rewindLines().
|
private |
needed to create index for vtk file
Definition at line 143 of file DataSink.h.
Referenced by init().
|
private |
Definition at line 138 of file DataSink.h.
Referenced by initMultiBunchDump(), rewindLines(), setMultiBunchInitialPathLengh(), and writeMultiBunchStatistics().
|
private |
Definition at line 137 of file DataSink.h.
Referenced by dumpSDDS(), init(), rewindLines(), and writeMultiBunchStatistics().
|
private |
Timer to track statistics write time.
Definition at line 146 of file DataSink.h.
Referenced by dumpSDDS(), init(), and writeMultiBunchStatistics().
|
private |
Definition at line 136 of file DataSink.h.
Referenced by dumpSDDS(), init(), rewindLines(), and setMultiBunchInitialPathLengh().