|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <DataSink.h>

Public Member Functions | |
| DataSink () | |
| Default constructor. | |
| DataSink (const std::vector< H5PartWrapper * > &h5wrappers, bool restart, size_t numParticleContainers) | |
| DataSink (H5PartWrapper *h5wrapper, bool restart) | |
| DataSink (H5PartWrapper *h5wrapper) | |
| void | dumpH5 (PartBunch_t &beam, Vector_t< double, 3 > FDext[]) const |
| Write H5 phase-space data for all particle containers. | |
| void | dumpH5 (PartBunch_t &beam, const std::vector< std::array< Vector_t< double, 3 >, 2 > > &fdextPerContainer) const |
| Write H5 phase-space data with per-container external fields. | |
| 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 |
| Write single-container H5 phase-space data with reference quantities. | |
| void | dumpSDDS (PartBunch_t &beam, const std::vector< std::array< Vector_t< double, 3 >, 2 > > &fdextPerContainer, const double &azimuth) const |
| Write SDDS statistics with per-container external fields. | |
| void | dumpSDDS (PartBunch_t &beam, const std::vector< std::array< Vector_t< double, 3 >, 2 > > &fdextPerContainer, const losses_t &losses, const double &azimuth) const |
| Write SDDS statistics and losses with per-container external fields. | |
| void | storeCavityInformation () |
| Write cavity information from H5 file. | |
| void | changeH5Wrappers (const std::vector< H5PartWrapper * > &h5wrappers) |
| 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) |
| void | dumpBinConfig (long long step, double time, bool preMerge, const std::vector< std::size_t > &binCounts, const std::vector< double > &binWidths, double xMin, const std::string &fileName) |
| Append a binning configuration snapshot to a JSON file. | |
| template<typename FieldType > | |
| DirichletPlaneWriter::PlaneDiagnostics | dumpDirichletPlane (long long step, double time, double zPlane, const FieldType &field, const std::string &solveTag) |
| Interpolate and dump potential values on a 2D z-plane. | |
Static Public Member Functions | |
| static std::string | diagnosticStemForContainer (const std::string &inputBasename, size_t numContainers, size_t index) |
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 |
Private Member Functions | |
| DataSink (const DataSink &ds)=delete | |
| DataSink & | operator= (const DataSink &)=delete |
| void | rewindLines () |
| void | init (bool restart, const std::vector< H5PartWrapper * > &h5wrappers, size_t numParticleContainers) |
Static Private Member Functions | |
| static std::string | convertToString (int number, int setw=5) |
Private Attributes | |
| std::vector< h5Writer_t > | h5Writers_m |
| std::vector< statWriter_t > | statWriters_m |
| std::vector< sddsWriter_t > | sddsWriter_m |
| std::unique_ptr< BinConfigWriter > | binConfigWriter_m |
| std::unique_ptr< DirichletPlaneWriter > | dirichletPlaneWriter_m |
| unsigned int | lossWrCounter_m |
| needed to create index for vtk file | |
| IpplTimings::TimerRef | StatMarkerTimer_m |
| Timer to track statistics write time. | |
Definition at line 48 of file DataSink.h.
|
private |
Definition at line 53 of file DataSink.h.
|
private |
Definition at line 50 of file DataSink.h.
|
private |
Definition at line 52 of file DataSink.h.
|
private |
Definition at line 51 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 51 of file DataSink.cpp.
References init().

| DataSink::DataSink | ( | const std::vector< H5PartWrapper * > & | h5wrappers, |
| bool | restart, | ||
| size_t | numParticleContainers | ||
| ) |
One H5 wrapper per particle container (when HDF5 enabled); sizes must match numParticleContainers.
Definition at line 53 of file DataSink.cpp.
References Options::enableHDF5, init(), and rewindLines().

| DataSink::DataSink | ( | H5PartWrapper * | h5wrapper, |
| bool | restart | ||
| ) |
Definition at line 66 of file DataSink.cpp.
| DataSink::DataSink | ( | H5PartWrapper * | h5wrapper | ) |
Definition at line 69 of file DataSink.cpp.
|
privatedelete |
| void DataSink::changeH5Wrappers | ( | const std::vector< H5PartWrapper * > & | h5wrappers | ) |
Definition at line 180 of file DataSink.cpp.
References Options::enableHDF5, and h5Writers_m.
Referenced by TrackRun::initDataSink().
|
inlinestaticprivate |
Definition at line 207 of file DataSink.h.
|
static |
Basename stem for per-container diagnostics: basename if numContainers<=1 else basename_cN.
Definition at line 43 of file DataSink.cpp.
Referenced by init(), and TrackRun::initDataSink().
| void DataSink::dumpBinConfig | ( | long long | step, |
| double | time, | ||
| bool | preMerge, | ||
| const std::vector< std::size_t > & | binCounts, | ||
| const std::vector< double > & | binWidths, | ||
| double | xMin, | ||
| const std::string & | fileName | ||
| ) |
Append a binning configuration snapshot to a JSON file.
| step | Global tracking step index. |
| time | Absolute simulation time (in seconds). |
| preMerge | true for pre-merge histogram, false for post-merge. |
| binCounts | Per-bin particle counts. |
| binWidths | Per-bin bin widths (same length as binCounts). |
| xMin | Lower bound of the histogram coordinate. |
| fileName | Target JSON file name (typically from BinningCmd::getDumpBinsFileName()). |
Definition at line 246 of file DataSink.cpp.
References binConfigWriter_m.
| DirichletPlaneWriter::PlaneDiagnostics DataSink::dumpDirichletPlane | ( | long long | step, |
| double | time, | ||
| double | zPlane, | ||
| const FieldType & | field, | ||
| const std::string & | solveTag | ||
| ) |
Interpolate and dump potential values on a 2D z-plane.
The interpolation and plane extraction are performed on device by DirichletPlaneWriter; only the 2D plane is copied to host for output.
| FieldType | IPPL scalar field type. |
| step | Global tracking step index. |
| time | Absolute simulation time (seconds). |
| zPlane | Physical z location of the sampled plane (meters). |
| field | Scalar field to sample (rho/phi depending on solver). |
| solveTag | Label for the solver pass (e.g. legacy, binned). |
Definition at line 214 of file DataSink.h.
References dirichletPlaneWriter_m.
| void DataSink::dumpH5 | ( | PartBunch_t & | beam, |
| const std::vector< std::array< Vector_t< double, 3 >, 2 > > & | fdextPerContainer | ||
| ) | const |
Write H5 phase-space data with per-container external fields.
| beam | Borrowed particle bunch; DataSink does not own or retain it. |
| fdextPerContainer | External field values indexed by particle container. |
Definition at line 81 of file DataSink.cpp.
References Options::enableHDF5, and h5Writers_m.
| void DataSink::dumpH5 | ( | PartBunch_t & | beam, |
| Vector_t< double, 3 > | FDext[] | ||
| ) | const |
Write H5 phase-space data for all particle containers.
| beam | Borrowed particle bunch; DataSink does not own or retain it. |
| FDext | External magnetic/electric field values reused for each container. |
Definition at line 71 of file DataSink.cpp.
References dumpH5().
Referenced by dumpH5(), and ParallelTracker::writePhaseSpace().

| 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 |
Write single-container H5 phase-space data with reference quantities.
| beam | Borrowed particle bunch; DataSink does not own or retain it. |
Definition at line 109 of file DataSink.cpp.
References Options::enableHDF5, and h5Writers_m.
| void DataSink::dumpSDDS | ( | PartBunch_t & | beam, |
| const std::vector< std::array< Vector_t< double, 3 >, 2 > > & | fdextPerContainer, | ||
| const double & | azimuth | ||
| ) | const |
Write SDDS statistics with per-container external fields.
| beam | Borrowed particle bunch; DataSink does not own or retain it. |
Definition at line 122 of file DataSink.cpp.
References dumpSDDS().
Referenced by dumpSDDS(), and ParallelTracker::writePhaseSpace().

| void DataSink::dumpSDDS | ( | PartBunch_t & | beam, |
| const std::vector< std::array< Vector_t< double, 3 >, 2 > > & | fdextPerContainer, | ||
| const losses_t & | losses, | ||
| const double & | azimuth | ||
| ) | const |
Write SDDS statistics and losses with per-container external fields.
| beam | Borrowed particle bunch; DataSink does not own or retain it. |
Definition at line 128 of file DataSink.cpp.
References Options::beamHaloBoundary, PartBunch< T, Dim >::calcBeamParameters(), PartBunch< T, Dim >::calcNumPartsOutside(), PartBunch< T, Dim >::gatherLoadBalanceStatistics(), StatMarkerTimer_m, statWriters_m, and PartBunch< T, Dim >::updateMoments().

|
private |
Definition at line 296 of file DataSink.cpp.
References diagnosticStemForContainer(), Options::enableHDF5, OpalData::getInputBasename(), OpalData::getInstance(), h5Writers_m, lossWrCounter_m, sddsWriter_m, StatMarkerTimer_m, and statWriters_m.
Referenced by DataSink(), and DataSink().

|
private |
Definition at line 275 of file DataSink.cpp.
References h5Writers_m, sddsWriter_m, and statWriters_m.
Referenced by DataSink().
| void DataSink::storeCavityInformation | ( | ) |
Write cavity information from H5 file.
Definition at line 172 of file DataSink.cpp.
References Options::enableHDF5, and h5Writers_m.
Referenced by ParallelTracker::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 197 of file DataSink.cpp.
References Options::enableVTK, and BoundaryGeometry::writeGeomToVtk().

| 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
| fn | specifies the name of vtk file contains the geometry |
Definition at line 203 of file DataSink.cpp.
References PartBunch< T, Dim >::getT(), PartBunch< T, Dim >::getTotalCharge(), and Units::s2ns.

|
private |
Definition at line 193 of file DataSink.h.
Referenced by dumpBinConfig().
|
private |
Definition at line 196 of file DataSink.h.
Referenced by dumpDirichletPlane().
|
private |
Definition at line 188 of file DataSink.h.
Referenced by changeH5Wrappers(), dumpH5(), dumpH5(), init(), rewindLines(), and storeCavityInformation().
|
private |
needed to create index for vtk file
Definition at line 201 of file DataSink.h.
Referenced by init().
|
private |
Definition at line 190 of file DataSink.h.
Referenced by init(), and rewindLines().
|
private |
Timer to track statistics write time.
Definition at line 204 of file DataSink.h.
Referenced by dumpSDDS(), and init().
|
private |
Definition at line 189 of file DataSink.h.
Referenced by dumpSDDS(), init(), and rewindLines().