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

#include <DataSink.h>

Collaboration diagram for DataSink:

Public Member Functions

 DataSink ()
 Default constructor.
 DataSink (H5PartWrapper *h5wrapper, bool restart)
 DataSink (H5PartWrapper *h5wrapper)
void dumpH5 (PartBunch_t *beam, Vector_t< double, 3 > FDext[]) const
int dumpH5 (PartBunch_t *beam, Vector_t< double, 3 > FDext[], double meanEnergy, double refPr, double refPt, double refPz, double refR, double refTheta, double refZ, double azimuth, double elevation, bool local) const
void dumpSDDS (PartBunch_t *beam, Vector_t< double, 3 > FDext[], const double &azimuth=-1) const
void dumpSDDS (PartBunch_t *beam, Vector_t< double, 3 > FDext[], const losses_t &losses=losses_t(), const double &azimuth=-1) const
void storeCavityInformation ()
 Write cavity information from H5 file.
void changeH5Wrapper (H5PartWrapper *h5wrapper)
void writeGeomToVtk (BoundaryGeometry &bg, std::string fn)
void writeImpactStatistics (const PartBunch_t *beam, long long int &step, size_t &impact, double &sey_num, size_t numberOfFieldEmittedParticles, bool nEmissionMode, std::string fn)

Private Types

typedef StatWriter::losses_t losses_t
typedef std::unique_ptr< StatWriterstatWriter_t
typedef std::unique_ptr< SDDSWritersddsWriter_t
typedef std::unique_ptr< H5Writerh5Writer_t

Private Member Functions

 DataSink (const DataSink &ds)=delete
DataSinkoperator= (const DataSink &)=delete
void rewindLines ()
void init (bool restart=false, H5PartWrapper *h5wrapper=nullptr)

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
unsigned int lossWrCounter_m
 needed to create index for vtk file
IpplTimings::TimerRef StatMarkerTimer_m
 Timer to track statistics write time.

Detailed Description

Definition at line 44 of file DataSink.h.

Member Typedef Documentation

◆ h5Writer_t

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

Definition at line 49 of file DataSink.h.

◆ losses_t

Definition at line 46 of file DataSink.h.

◆ sddsWriter_t

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

Definition at line 48 of file DataSink.h.

◆ statWriter_t

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

Definition at line 47 of file DataSink.h.

Constructor & Destructor Documentation

◆ DataSink() [1/4]

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

References init().

Referenced by DataSink(), DataSink(), and operator=().

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

◆ DataSink() [2/4]

DataSink::DataSink ( H5PartWrapper * h5wrapper,
bool restart )

Definition at line 48 of file DataSink.cpp.

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

Here is the call graph for this function:

◆ DataSink() [3/4]

DataSink::DataSink ( H5PartWrapper * h5wrapper)

Definition at line 59 of file DataSink.cpp.

References DataSink().

Here is the call graph for this function:

◆ DataSink() [4/4]

DataSink::DataSink ( const DataSink & ds)
privatedelete

References DataSink().

Here is the call graph for this function:

Member Function Documentation

◆ changeH5Wrapper()

void DataSink::changeH5Wrapper ( H5PartWrapper * h5wrapper)

Definition at line 114 of file DataSink.cpp.

References Options::enableHDF5, and h5Writer_m.

◆ convertToString()

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

Definition at line 120 of file DataSink.h.

◆ dumpH5() [1/2]

void DataSink::dumpH5 ( PartBunch_t * beam,
Vector_t< double, 3 > FDext[] ) const

Definition at line 62 of file DataSink.cpp.

References Options::enableHDF5, and h5Writer_m.

◆ dumpH5() [2/2]

int DataSink::dumpH5 ( PartBunch_t * beam,
Vector_t< double, 3 > 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 69 of file DataSink.cpp.

References Options::enableHDF5, and h5Writer_m.

◆ dumpSDDS() [1/2]

void DataSink::dumpSDDS ( PartBunch_t * beam,
Vector_t< double, 3 > FDext[],
const double & azimuth = -1 ) const

Definition at line 81 of file DataSink.cpp.

References dumpSDDS().

Referenced by dumpSDDS().

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

◆ dumpSDDS() [2/2]

void DataSink::dumpSDDS ( PartBunch_t * beam,
Vector_t< double, 3 > FDext[],
const losses_t & losses = losses_t(),
const double & azimuth = -1 ) const

Definition at line 86 of file DataSink.cpp.

References Options::beamHaloBoundary, PartBunch< PLayout, T, Dim >::calcBeamParameters(), PartBunch< PLayout, T, Dim >::calcNumPartsOutside(), PartBunch< PLayout, T, Dim >::gatherLoadBalanceStatistics(), PartBunch< PLayout, T, Dim >::get_rrms(), StatMarkerTimer_m, and statWriter_m.

Here is the call graph for this function:

◆ init()

void DataSink::init ( bool restart = false,
H5PartWrapper * h5wrapper = nullptr )
private

Definition at line 189 of file DataSink.cpp.

References Options::enableHDF5, OpalData::getInputBasename(), OpalData::getInstance(), h5Writer_m, lossWrCounter_m, sddsWriter_m, StatMarkerTimer_m, and statWriter_m.

Referenced by DataSink(), and DataSink().

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

◆ operator=()

DataSink & DataSink::operator= ( const DataSink & )
privatedelete

References DataSink().

Here is the call graph for this function:

◆ rewindLines()

void DataSink::rewindLines ( )
private

Definition at line 169 of file DataSink.cpp.

References h5Writer_m, sddsWriter_m, and statWriter_m.

Referenced by DataSink().

Here is the caller graph for this function:

◆ storeCavityInformation()

void DataSink::storeCavityInformation ( )

Write cavity information from H5 file.

Definition at line 107 of file DataSink.cpp.

References Options::enableHDF5, and h5Writer_m.

◆ writeGeomToVtk()

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

References Options::enableVTK, and BoundaryGeometry::writeGeomToVtk().

Here is the call graph for this function:

◆ writeImpactStatistics()

void DataSink::writeImpactStatistics ( const PartBunch_t * 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 127 of file DataSink.cpp.

References PartBunch< PLayout, T, Dim >::getCharge(), PartBunch< PLayout, T, Dim >::getChargePerParticle(), PartBunch< PLayout, T, Dim >::getT(), PartBunch< PLayout, T, Dim >::getTotalNum(), and Units::s2ns.

Here is the call graph for this function:

Member Data Documentation

◆ h5Writer_m

h5Writer_t DataSink::h5Writer_m
private

Definition at line 107 of file DataSink.h.

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

◆ lossWrCounter_m

unsigned int DataSink::lossWrCounter_m
private

needed to create index for vtk file

Definition at line 114 of file DataSink.h.

Referenced by init().

◆ sddsWriter_m

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

Definition at line 109 of file DataSink.h.

Referenced by init(), and rewindLines().

◆ StatMarkerTimer_m

IpplTimings::TimerRef DataSink::StatMarkerTimer_m
private

Timer to track statistics write time.

Definition at line 117 of file DataSink.h.

Referenced by dumpSDDS(), and init().

◆ statWriter_m

statWriter_t DataSink::statWriter_m
private

Definition at line 108 of file DataSink.h.

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


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