30#include <Kokkos_Core.hpp>
70 columns_m.
addColumn(
"ref_x",
"double",
"m",
"x coordinate of reference particle in lab cs");
71 columns_m.
addColumn(
"ref_y",
"double",
"m",
"y coordinate of reference particle in lab cs");
72 columns_m.
addColumn(
"ref_z",
"double",
"m",
"z coordinate of reference particle in lab cs");
74 columns_m.
addColumn(
"ref_px",
"double",
"1",
"x momentum of reference particle in lab cs");
75 columns_m.
addColumn(
"ref_py",
"double",
"1",
"y momentum of reference particle in lab cs");
76 columns_m.
addColumn(
"ref_pz",
"double",
"1",
"z momentum of reference particle in lab cs");
103 columns_m.
addColumn(
"DebyeLength",
"double",
"m",
"Debye length in the boosted frame");
105 "plasmaParameter",
"double",
"1",
106 "Plasma parameter that gives no. of particles in a Debye sphere");
112 "Number of field solver bins, potentially after adaptive binning.");
192 for (
size_t i = 0; i < losses.size(); ++i) {
193 columns_m.
addColumn(losses[i].first,
"long",
"1",
"Number of lost particles in element");
196 if (
mode_m == std::ios::app)
return;
199 std::string dateStr(simtimer.
date());
200 std::string timeStr(simtimer.
time());
202 std::stringstream ss;
208 std::stringstream revision;
209 revision << buildinfo::project_name <<
" " << buildinfo::project_version <<
" "
212 addParameter(
"processors",
"long",
"Number of Cores used", ippl::Comm->size());
213 addParameter(
"revision",
"string",
"git revision of opal", revision.str());
214 addParameter(
"species",
"string",
"Particle species of container", species);
221 const double& azimuth,
const size_t npOutside,
size_t particleContainerIndex) {
223 std::shared_ptr<ParticleContainer_t> pc = beam.getParticleContainer(particleContainerIndex);
228 double pathLength = pc->get_sPos();
229 const std::string species = beam.
getParticleName(particleContainerIndex);
235 const size_t numParticles = pc->getTotalNum();
236 double Q = numParticles == 0 ? 0.0 : pc->getTotalCharge();
238 if (ippl::Comm->rank() != 0) {
260 double debyeLength = 0.0;
261 double plasmaParameter = 0.0;
262 double temperature = 0.0;
264 if (numParticles > 0) {
265 energy = pc->getMeanKineticEnergy();
266 rmsR = pc->getRmsR();
267 rmsP = pc->getRmsP();
268 normEmit = pc->getNormEmit();
269 meanR = pc->getMeanR();
270 maxR = pc->getMaxR();
271 rmsRP = pc->getRmsRP();
272 dE = pc->getStdKineticEnergy();
277 debyeLength = pc->getDebyeLength();
278 plasmaParameter = pc->getPlasmaParameter();
279 temperature = pc->getTemperature();
394 if (ippl::Comm->size() == 1) {
395 if (pc->getLocalNum() > 0) {
396 auto rDev = pc->R.getView();
397 auto pDev = pc->P.getView();
398 auto rHost = Kokkos::create_mirror_view(rDev);
399 auto pHost = Kokkos::create_mirror_view(pDev);
400 Kokkos::deep_copy(rHost, rDev);
401 Kokkos::deep_copy(pHost, pDev);
425 for (
size_t i = 0; i < losses.size(); ++i) {
426 long unsigned int loss = losses[i].second;
ippl::Vector< T, Dim > Vector_t
Template PIC bunch: IPPL PicManager, shared field mesh/solver, and multiple particle containers.
std::string time() const
Return time.
std::string date() const
Return date.
std::string getInputFn()
get opals input filename
static OpalData * getInstance()
std::string getParticleName(size_t i) const
Particle species name for container i (from BEAM PARTICLE input).
double getdT() const
Get the global time step.
double getT() const
Get the current simulation time.
int getCurrentNBins() const
Effective bin count for diagnostics (1 if binning inactive or still at max bins).
double get_rmsDensity() const
Legacy RMS density field (may be unused).
Vector_t< double, Dim > get_halo() const
Stub; logs and returns zero vector.
Container for all per-particle (and per-simulation) fields tracked during OPALX tracking.
void addColumn(const std::string &name, const std::string &type, const std::string &unit, const std::string &desc, std::ios_base::fmtflags flags=std::ios_base::scientific, unsigned short precision=15)
void addColumnValue(const std::string &name, const T &val)
void addDescription(const std::string &text, const std::string &content)
void writeHeader()
Write SDDS header.
std::ios_base::openmode mode_m
First write to the statistics output file.
void addInfo(const std::string &mode, const size_t &no_row_counts)
void addParameter(const std::string &name, const std::string &type, const std::string &desc, const T &value)
std::vector< std::pair< std::string, unsigned int > > losses_t
void fillHeader(const losses_t &losses=losses_t(), const std::string &species="")
void write(PartBunch_t &beam, Vector_t< double, 3 > FDext[], const losses_t &losses=losses_t(), const double &azimuth=-1, const size_t npOutside=0, size_t particleContainerIndex=0)
Write statistical data.
StatWriter(const std::string &fname, bool restart)
std::string getGitRevision()