OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
DataSink Class Reference

#include <DataSink.h>

Public 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< H5Writerh5Writer_t
 
typedef std::unique_ptr
< MultiBunchDump
mbWriter_t
 

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 dumpH5 (EnvelopeBunch &beam, Vector_t FDext[], double sposHead, double sposRef, double sposTail) 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 dumpSDDS (EnvelopeBunch &beam, Vector_t FDext[], double sposHead, double sposRef, double sposTail) const
 
void storeCavityInformation ()
 Write cavity information from H5 file. More...
 
void changeH5Wrapper (H5PartWrapper *h5wrapper)
 
void writePartlossZASCII (PartBunchBase< double, 3 > *beam, BoundaryGeometry &bg, std::string fn)
 
void writeGeomToVtk (BoundaryGeometry &bg, std::string fn)
 
void writeImpactStatistics (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 Member Functions

 DataSink (const DataSink &ds)=delete
 
DataSinkoperator= (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_tsddsWriter_m
 
std::vector< mbWriter_tmbWriter_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
 

Detailed Description

Definition at line 35 of file DataSink.h.

Member Typedef Documentation

typedef std::unique_ptr<H5Writer> DataSink::h5Writer_t

Definition at line 40 of file DataSink.h.

Definition at line 37 of file DataSink.h.

typedef std::unique_ptr<MultiBunchDump> DataSink::mbWriter_t

Definition at line 41 of file DataSink.h.

typedef std::unique_ptr<SDDSWriter> DataSink::sddsWriter_t

Definition at line 39 of file DataSink.h.

typedef std::unique_ptr<StatWriter> DataSink::statWriter_t

Definition at line 38 of file DataSink.h.

Constructor & Destructor Documentation

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 42 of file DataSink.cpp.

References init().

Here is the call graph for this function:

DataSink::DataSink ( H5PartWrapper h5wrapper,
bool  restart,
short  numBunch 
)

Definition at line 49 of file DataSink.cpp.

References Options::enableHDF5, init(), and rewindLines().

Here is the call graph for this function:

DataSink::DataSink ( H5PartWrapper h5wrapper,
short  numBunch 
)

Definition at line 64 of file DataSink.cpp.

DataSink::DataSink ( const DataSink ds)
privatedelete

Member Function Documentation

void DataSink::changeH5Wrapper ( H5PartWrapper h5wrapper)

Definition at line 138 of file DataSink.cpp.

References Options::enableHDF5, and h5Writer_m.

Referenced by TrackRun::initDataSink().

std::string DataSink::convertToString ( int  number,
int  setw = 5 
)
inlinestaticprivate

Definition at line 159 of file DataSink.h.

Referenced by initMultiBunchDump(), and writePartlossZASCII().

void DataSink::dumpH5 ( PartBunchBase< double, 3 > *  beam,
Vector_t  FDext[] 
) const
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 76 of file DataSink.cpp.

References Options::enableHDF5, and h5Writer_m.

void DataSink::dumpH5 ( EnvelopeBunch beam,
Vector_t  FDext[],
double  sposHead,
double  sposRef,
double  sposTail 
) const

Definition at line 88 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
void DataSink::dumpSDDS ( PartBunchBase< double, 3 > *  beam,
Vector_t  FDext[],
const losses_t losses = losses_t(),
const double &  azimuth = -1 
) const

Definition at line 106 of file DataSink.cpp.

References sddsWriter_m, IpplTimings::startTimer(), StatMarkerTimer_m, statWriter_m, and IpplTimings::stopTimer().

Here is the call graph for this function:

void DataSink::dumpSDDS ( EnvelopeBunch beam,
Vector_t  FDext[],
double  sposHead,
double  sposRef,
double  sposTail 
) const

Definition at line 120 of file DataSink.cpp.

References IpplTimings::startTimer(), StatMarkerTimer_m, statWriter_m, and IpplTimings::stopTimer().

Here is the call graph for this function:

void DataSink::init ( bool  restart = false,
H5PartWrapper h5wrapper = nullptr,
short  numBunch = 1 
)
private
void DataSink::initMultiBunchDump ( short  numBunch)
private

Definition at line 387 of file DataSink.cpp.

References convertToString(), OpalData::getInputBasename(), OpalData::getInstance(), OpalData::inRestartRun(), and mbWriter_m.

Referenced by init().

Here is the call graph for this function:

DataSink& DataSink::operator= ( const DataSink )
privatedelete
void DataSink::rewindLines ( )
private

Definition at line 308 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

Parameters
mbhandleris the multi-bunch handler

Definition at line 300 of file DataSink.cpp.

References MultiBunchHandler::getBunchInfo(), MultiBunchHandler::getNumBunch(), mbWriter_m, and MultiBunchHandler::beaminfo_t::pathlength.

Referenced by ParallelCyclotronTracker::initPathLength().

Here is the call graph for this function:

void DataSink::storeCavityInformation ( )

Write cavity information from H5 file.

Definition at line 131 of file DataSink.cpp.

References Options::enableHDF5, and h5Writer_m.

Referenced by ParallelSliceTracker::handleAutoPhasing(), ParallelSliceTracker::saveCavityPhases(), and ParallelTTracker::saveCavityPhases().

void DataSink::writeGeomToVtk ( BoundaryGeometry bg,
std::string  fn 
)

Write geometry points and surface triangles to vtk file

Parameters
fnspecifies the name of vtk file contains the geometry

Definition at line 228 of file DataSink.cpp.

References IpplInfo::myNode(), and BoundaryGeometry::writeGeomToVtk().

Here is the call graph for this function:

void DataSink::writeImpactStatistics ( 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

Parameters
fnspecifies the name of vtk file contains the geometry

Definition at line 235 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(), Inform::precision(), and setInform().

Here is the call graph for this function:

void DataSink::writeMultiBunchStatistics ( PartBunchBase< double, 3 > *  beam,
MultiBunchHandler mbhandler 
)

no statWriter_m dump

Parameters
beam
mbhandleris the multi-bunch handler

Start timer.

Stop timer.

Definition at line 279 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().

Here is the call graph for this function:

void DataSink::writePartlossZASCII ( PartBunchBase< double, 3 > *  beam,
BoundaryGeometry bg,
std::string  fn 
)

Member Data Documentation

h5Writer_t DataSink::h5Writer_m
private

Definition at line 139 of file DataSink.h.

Referenced by changeH5Wrapper(), dumpH5(), init(), rewindLines(), and storeCavityInformation().

const bool DataSink::isMultiBunch_m
private

Definition at line 152 of file DataSink.h.

Referenced by init(), and rewindLines().

unsigned int DataSink::lossWrCounter_m
private

needed to create index for vtk file

Definition at line 147 of file DataSink.h.

Referenced by init(), and writePartlossZASCII().

std::vector<mbWriter_t> DataSink::mbWriter_m
private
std::vector<sddsWriter_t> DataSink::sddsWriter_m
private

Definition at line 141 of file DataSink.h.

Referenced by dumpSDDS(), init(), rewindLines(), and writeMultiBunchStatistics().

IpplTimings::TimerRef DataSink::StatMarkerTimer_m
private

Timer to track statistics write time.

Definition at line 150 of file DataSink.h.

Referenced by dumpSDDS(), init(), and writeMultiBunchStatistics().

statWriter_t DataSink::statWriter_m
private

Definition at line 140 of file DataSink.h.

Referenced by dumpSDDS(), init(), and rewindLines().


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