6#ifndef OPALX_EMITTED_FROM_FILE_H
7#define OPALX_EMITTED_FROM_FILE_H
40 std::shared_ptr<ParticleContainer_t> pc, std::shared_ptr<FieldContainer_t> fc,
54 std::shared_ptr<ParticleContainer_t> pc, std::shared_ptr<FieldContainer_t> fc,
55 const std::string& filename);
133 size_type nlocalBefore,
size_t globalBegin,
size_t nNew,
double tStart,
double dt);
170 void readFile(
const std::string& filename);
ippl::Vector< T, Dim > Vector_t
ippl::detail::size_type size_type
Reads old-OPAL emitted distribution dumps and emits particles by file time.
double py
Vertical momentum offset from the file.
RawRecord raw
Original parsed file row.
double birthTime
Birth time in the OPALX tracker convention.
double fileTime
Old-OPAL pre-emission time column.
bool inventoryBuilt_m
True once records_m is ready for emission.
double x
Horizontal position from the file.
void emitParticles(double t, double dt) override
Emits all file records whose birth times fall into the current step.
double emissionTime_m
Total emission time spanned by records_m.
void generateLocalParticles(size_type nlocalBefore, size_t globalBegin, size_t nNew, double tStart, double dt)
Generates the local particles assigned to this rank for one emission step.
double getGlobalTimeShift() const override
Returns the global time shift needed to center old-OPAL file times.
std::pair< size_t, size_t > computeLocalEmitRange(size_t totalToEmit) const
Computes the local contiguous subrange of a global emission batch.
ippl::detail::size_type size_type
bool hasInitialReferenceMomentum() const override
Reports whether an initial reference momentum is available.
size_t nextGlobalIndex_m
First global record index not emitted yet.
Vector_t< double, 3 > getInitialReferenceMomentum() const override
Returns the average initial reference momentum from selected records.
void readFile(const std::string &filename)
Reads and parses an old-OPAL emitted particle file.
std::string filename_m
File path to read emitted particle data from.
bool isEmissionDone(double) const override
Returns whether all file records in the inventory have been emitted.
Vector_t< double, 3 > initialRefP_m
Average initial reference momentum.
void resolveFilenameFromInput()
Resolves relative file paths against the active input file directory.
double pz
Longitudinal momentum offset from the file.
double getEmissionTime() const
Returns the total emission time spanned by selected file records.
void buildInventory(size_t requested)
Selects records, converts file times to birth times, and sorts them.
std::vector< RawRecord > rawRecords_m
Parsed file rows before selection and sorting.
size_t emissionSteps_m
Number of steps used to derive emission dt.
double px
Horizontal momentum offset from the file.
double getEmissionTimeStep() const override
Returns the preferred emission time step.
std::vector< Record > records_m
Selected records sorted by tracker birth time.
void generateParticles(size_t &numberOfParticles, Vector_t< double, 3 > nr) override
Reads the selected file records and builds the birth-time inventory.
double y
Vertical position from the file.
Raw row parsed from an old-OPAL emitted distribution dump.
Selected file row plus its converted tracker birth time.