OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
MultiBunchHandler.cpp
Go to the documentation of this file.
1 //
2 // Class MultiBunchHandler
3 // Helper class that stores bunch injection
4 // information like azimuth, radius etc. of first
5 // bunch in multi-bunch mode of ParallelCyclotronTracker.
6 //
7 // Copyright (c) 2007 - 2014, Jianjun Yang, Paul Scherrer Institut, Villigen PSI, Switzerland
8 // Copyright (c) 2012 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
9 // All rights reserved
10 //
11 // Implemented as part of the PhD thesis
12 // "Beam dynamics in high intensity cyclotrons including neighboring bunch effects"
13 // and the paper
14 // "Beam dynamics in high intensity cyclotrons including neighboring bunch effects:
15 // Model, implementation, and application"
16 // (https://journals.aps.org/prab/pdf/10.1103/PhysRevSTAB.13.064201)
17 //
18 // This file is part of OPAL.
19 //
20 // OPAL is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 // You should have received a copy of the GNU General Public License
26 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
27 //
28 #include "MultiBunchHandler.h"
29 
31 
32 //FIXME Remove headers and dynamic_cast in
33 #include "Algorithms/PartBunch.h"
34 #ifdef ENABLE_AMR
35  #include "Algorithms/AmrPartBunch.h"
36 #endif
37 
38 extern Inform *gmsg;
39 
41  const int& numBunch,
42  const double& eta,
43  const double& para,
44  const std::string& mode,
45  const std::string& binning)
46  : onebunch_m(OpalData::getInstance()->getInputBasename() + "-onebunch.h5")
47  , numBunch_m(numBunch)
48  , eta_m(eta)
49  , coeffDBunches_m(para)
50  , radiusLastTurn_m(0.0)
51  , radiusThisTurn_m(0.0)
52  , bunchCount_m(1)
53 {
54  PAssert_GT(numBunch, 1);
55 
56  binfo_m.reserve(numBunch);
57  for (int i = 0; i < beam->getNumBunch(); ++i) {
58  binfo_m.push_back(beaminfo_t());
59  }
60 
61  this->setBinning(binning);
62 
63  // mode of generating new bunches:
64  // "FORCE" means generating one bunch after each revolution, until get "TURNS" bunches.
65  // "AUTO" means only when the distance between two neighbor bunches is below the limitation,
66  // then starts to generate new bunches after each revolution,until get "TURNS" bunches;
67  // otherwise, run single bunch track
68 
69  *gmsg << "***---------------------------- MULTI-BUNCHES MULTI-ENERGY-BINS MODE "
70  << "----------------------------*** " << endl;
71 
72  // only for regular run of multi bunches, instantiate the PartBins class
73  // note that for restart run of multi bunches, PartBins class is instantiated in function
74  // Distribution::doRestartOpalCycl()
75  if (!OpalData::getInstance()->inRestartRun()) {
76 
77  // already exist bins number initially
78  const int BinCount = 1;
79  //allowed maximal bin
80  const int MaxBinNum = 1000;
81 
82  // initialize particles number for each bin (both existed and not yet emmitted)
83  size_t partInBin[MaxBinNum] = {0};
84  partInBin[0] = beam->getTotalNum();
85 
86  beam->setPBins(new PartBinsCyc(MaxBinNum, BinCount, partInBin));
87  // the allowed maximal bin number is set to 100
88  //beam->setPBins(new PartBins(100));
89 
90  this->setMode(mode);
91 
92  } else {
93  if(beam->pbin_m->getLastemittedBin() < 2) {
94  *gmsg << "In this restart job, the multi-bunches mode is forcely set to AUTO mode." << endl;
96  } else {
97  *gmsg << "In this restart job, the multi-bunches mode is forcely set to FORCE mode." << endl
98  << "If the existing bunch number is less than the specified number of TURN, "
99  << "readin the phase space of STEP#0 from h5 file consecutively" << endl;
101  }
102  }
103 }
104 
105 
107 {
108  static IpplTimings::TimerRef saveBunchTimer = IpplTimings::getTimer("Save Bunch H5");
109  IpplTimings::startTimer(saveBunchTimer);
110  *gmsg << endl;
111  *gmsg << "* Store beam to H5 file for multibunch simulation ... ";
112 
113  Ppos_t coord, momentum;
114  ParticleAttrib<double> mass, charge;
116 
117  std::size_t localNum = beam->getLocalNum();
118 
119  coord.create(localNum);
120  coord = beam->R;
121 
122  momentum.create(localNum);
123  momentum = beam->P;
124 
125  mass.create(localNum);
126  mass = beam->M;
127 
128  charge.create(localNum);
129  charge = beam->Q;
130 
131  porigin.create(localNum);
132  porigin = beam->POrigin;
133 
134  std::map<std::string, double> additionalAttributes = {
135  std::make_pair("REFPR", 0.0),
136  std::make_pair("REFPT", 0.0),
137  std::make_pair("REFPZ", 0.0),
138  std::make_pair("REFR", 0.0),
139  std::make_pair("REFTHETA", 0.0),
140  std::make_pair("REFZ", 0.0),
141  std::make_pair("AZIMUTH", 0.0),
142  std::make_pair("ELEVATION", 0.0),
143  std::make_pair("B-ref_x", 0.0),
144  std::make_pair("B-ref_z", 0.0),
145  std::make_pair("B-ref_y", 0.0),
146  std::make_pair("E-ref_x", 0.0),
147  std::make_pair("E-ref_z", 0.0),
148  std::make_pair("E-ref_y", 0.0),
149  std::make_pair("B-head_x", 0.0),
150  std::make_pair("B-head_z", 0.0),
151  std::make_pair("B-head_y", 0.0),
152  std::make_pair("E-head_x", 0.0),
153  std::make_pair("E-head_z", 0.0),
154  std::make_pair("E-head_y", 0.0),
155  std::make_pair("B-tail_x", 0.0),
156  std::make_pair("B-tail_z", 0.0),
157  std::make_pair("B-tail_y", 0.0),
158  std::make_pair("E-tail_x", 0.0),
159  std::make_pair("E-tail_z", 0.0),
160  std::make_pair("E-tail_y", 0.0)
161  };
162 
163  H5PartWrapperForPC h5wrapper(onebunch_m, H5_O_WRONLY);
164  h5wrapper.writeHeader();
165  h5wrapper.writeStep(beam, additionalAttributes);
166  h5wrapper.close();
167 
168  *gmsg << "Done." << endl;
169  IpplTimings::stopTimer(saveBunchTimer);
170 }
171 
172 
174  const PartData& ref)
175 {
176  static IpplTimings::TimerRef readBunchTimer = IpplTimings::getTimer("Read Bunch H5");
177  IpplTimings::startTimer(readBunchTimer);
178  *gmsg << endl;
179  *gmsg << "* Read beam from H5 file for multibunch simulation ... ";
180 
181  std::size_t localNum = beam->getLocalNum();
182 
183  /*
184  * 2nd argument: 0 --> step zero is fine since the file has only this step
185  * 3rd argument: "" --> onebunch_m is used
186  * 4th argument: H5_O_RDONLY does not work with this constructor
187  */
188  H5PartWrapperForPC h5wrapper(onebunch_m, 0, "", H5_O_WRONLY);
189 
190  size_t numParticles = h5wrapper.getNumParticles();
191 
192  const int bunchNum = bunchCount_m - 1;
193 
194  beam->setTotalNumPerBunch(numParticles, bunchNum);
195 
196  if ( numParticles == 0 ) {
197  throw OpalException("MultiBunchHandler::readBunch()",
198  "No particles in file " + onebunch_m + ".");
199  }
200 
201  size_t numParticlesPerNode = numParticles / Ippl::getNodes();
202 
203  size_t firstParticle = numParticlesPerNode * Ippl::myNode();
204  size_t lastParticle = firstParticle + numParticlesPerNode - 1;
205  if (Ippl::myNode() == Ippl::getNodes() - 1)
206  lastParticle = numParticles - 1;
207 
208  PAssert_LT(firstParticle, lastParticle +1);
209 
210  numParticles = lastParticle - firstParticle + 1;
211 
212  beam->setLocalNumPerBunch(numParticles, bunchNum);
213 
214  //FIXME
215  std::unique_ptr<PartBunchBase<double, 3> > tmpBunch = nullptr;
216 #ifdef ENABLE_AMR
217  AmrPartBunch* amrbunch_p = dynamic_cast<AmrPartBunch*>(beam);
218  if ( amrbunch_p != nullptr ) {
219  tmpBunch.reset(new AmrPartBunch(&ref,
220  amrbunch_p->getAmrParticleBase()));
221  } else
222 #endif
223  tmpBunch.reset(new PartBunch(&ref));
224 
225  tmpBunch->create(numParticles);
226 
227  h5wrapper.readStep(tmpBunch.get(), firstParticle, lastParticle);
228  h5wrapper.close();
229 
230  beam->create(numParticles);
231 
232  for(size_t ii = 0; ii < numParticles; ++ ii, ++ localNum) {
233  beam->R[localNum] = tmpBunch->R[ii];
234  beam->P[localNum] = tmpBunch->P[ii];
235  beam->M[localNum] = tmpBunch->M[ii];
236  beam->Q[localNum] = tmpBunch->Q[ii];
237  beam->POrigin[localNum] = ParticleOrigin::REGULAR;
238  beam->Bin[localNum] = bunchNum;
239  beam->bunchNum[localNum] = bunchNum;
240  }
241 
242  beam->boundp();
243 
244  binfo_m.push_back(beaminfo_t(injection_m));
245 
246  *gmsg << "Done." << endl;
247 
248  IpplTimings::stopTimer(readBunchTimer);
249  return true;
250 }
251 
252 
254  const PartData& ref,
255  bool& flagTransition)
256 {
257  short result = 0;
258  if ((bunchCount_m == 1) && (mode_m == MB_MODE::AUTO) && (!flagTransition)) {
259 
260  // we have still a single bunch
261  beam->setTotalNumPerBunch(beam->getTotalNum(), 0);
262  beam->setLocalNumPerBunch(beam->getLocalNum(), 0);
263 
264  // If all of the following conditions are met, this code will be executed
265  // to check the distance between two neighboring bunches:
266  // 1. Only one bunch exists (bunchCount_m == 1)
267  // 2. We are in multi-bunch mode, AUTO sub-mode (mode_m == 2)
268  // 3. It has been a full revolution since the last check (stepsNextCheck)
269 
270  *gmsg << "* MBM: Checking for automatically injecting new bunch ..." << endl;
271 
272  //beam->R *= Vector_t(0.001); // mm --> m
273  beam->calcBeamParameters();
274  //beam->R *= Vector_t(1000.0); // m --> mm
275 
276  Vector_t Rmean = beam->get_centroid(); // m
277 
278  radiusThisTurn_m = std::hypot(Rmean[0],Rmean[1]);
279 
280  Vector_t Rrms = beam->get_rrms(); // m
281 
282  double XYrms = std::hypot(Rrms[0], Rrms[1]);
283 
284  // If the distance between two neighboring bunches is less than 5 times of its 2D rms size
285  // start multi-bunch simulation, fill current phase space to initialR and initialP arrays
287  // since next turn, start multi-bunches
288  saveBunch(beam);
289  flagTransition = true;
290  }
291 
292  *gmsg << "* MBM: RLastTurn = " << radiusLastTurn_m << " [m]" << endl;
293  *gmsg << "* MBM: RThisTurn = " << radiusThisTurn_m << " [m]" << endl;
294  *gmsg << "* MBM: XYrms = " << XYrms << " [m]" << endl;
295 
297  result = 1;
298  }
299 
300  else if (bunchCount_m < numBunch_m) {
301  // Matthias: SteptoLastInj was used in MtsTracker, removed by DW in GenericTracker
302 
303  // If all of the following conditions are met, this code will be executed
304  // to read new bunch from hdf5 format file:
305  // 1. We are in multi-bunch mode (numBunch_m > 1)
306  // 2. It has been a full revolution since the last check
307  // 3. Number of existing bunches is less than the desired number of bunches
308  // 4. FORCE mode, or AUTO mode with flagTransition = true
309  // Note: restart from 1 < BunchCount < numBunch_m must be avoided.
310  *gmsg << "* MBM: Injecting a new bunch ..." << endl;
311 
312  bunchCount_m++;
313 
314  beam->setNumBunch(bunchCount_m);
315 
316  // read initial distribution from h5 file
317  switch ( mode_m ) {
318  case MB_MODE::FORCE:
319  case MB_MODE::AUTO:
320  readBunch(beam, ref);
321  updateParticleBins(beam);
323  break;
324  default:
325  throw OpalException("MultiBunchHandler::injectBunch()",
326  "We shouldn't be here in single bunch mode.");
327  }
328 
329  Ippl::Comm->barrier();
330 
331  *gmsg << "* MBM: Bunch " << bunchCount_m
332  << " injected, total particle number = "
333  << beam->getTotalNum() << endl;
334  result = 2;
335  }
336  return result;
337 }
338 
339 
341  if (bunchCount_m < 2)
342  return;
343 
344  static IpplTimings::TimerRef binningTimer = IpplTimings::getTimer("Particle Binning");
345  IpplTimings::startTimer(binningTimer);
346  switch ( binning_m ) {
347  case MB_BINNING::GAMMA:
348  beam->resetPartBinID2(eta_m);
349  break;
350  case MB_BINNING::BUNCH:
351  beam->resetPartBinBunch();
352  break;
353  default:
354  beam->resetPartBinID2(eta_m);
355  }
356  IpplTimings::stopTimer(binningTimer);
357 }
358 
359 
360 void MultiBunchHandler::setMode(const std::string& mbmode) {
361  if ( mbmode.compare("FORCE") == 0 ) {
362  *gmsg << "FORCE mode: The multi bunches will be injected consecutively" << endl
363  << " after each revolution, until get \"TURNS\" bunches." << endl;
365  } else if ( mbmode.compare("AUTO") == 0 ) {
366  *gmsg << "AUTO mode: The multi bunches will be injected only when the" << endl
367  << " distance between two neighboring bunches is below" << endl
368  << " the limitation. The control parameter is set to "
369  << coeffDBunches_m << endl;
371  }
372 }
373 
374 
375 void MultiBunchHandler::setBinning(std::string binning) {
376 
377  if ( binning.compare("BUNCH_BINNING") == 0 ) {
378  *gmsg << "Use 'BUNCH_BINNING' injection for binnning." << endl;
380  } else if ( binning.compare("GAMMA_BINNING") == 0 ) {
381  *gmsg << "Use 'GAMMA_BINNING' for binning." << endl;
383  }
384 }
385 
386 
387 void MultiBunchHandler::setRadiusTurns(const double& radius) {
388  if ( mode_m != MB_MODE::AUTO )
389  return;
390 
391  radiusLastTurn_m = radius;
393 
394  if (OpalData::getInstance()->inRestartRun()) {
395  *gmsg << "Radial position at restart position = ";
396  } else {
397  *gmsg << "Initial radial position = ";
398  }
399  // New OPAL 2.0: Init in m -DW
400  *gmsg << radiusThisTurn_m << " m" << endl;
401 }
402 
403 
405  short bunchNr)
406 {
407  if ( !OpalData::getInstance()->isInOPALCyclMode() ) {
408  return false;
409  }
410 
411  const unsigned long localNum = beam->getLocalNum();
412 
413  long int bunchTotalNum = 0;
414  unsigned long bunchLocalNum = 0;
415 
416  /* container:
417  *
418  * ekin, <x>, <y>, <z>, <p_x>, <p_y>, <p_z>,
419  * <x^2>, <y^2>, <z^2>, <p_x^2>, <p_y^2>, <p_z^2>,
420  * <xp_x>, <y_py>, <zp_z>,
421  * <x^3>, <y^3>, <z^3>, <x^4>, <y^4>, <z^4>
422  */
423  const unsigned int dim = PartBunchBase<double, 3>::Dimension;
424  std::vector<double> local(7 * dim + 1);
425 
426  beaminfo_t& binfo = getBunchInfo(bunchNr);
427 
428  for(unsigned long k = 0; k < localNum; ++k) {
429  if ( beam->bunchNum[k] != bunchNr ) { //|| ID[k] == 0 ) {
430  continue;
431  }
432 
433  ++bunchTotalNum;
434  ++bunchLocalNum;
435 
436  // ekin
437  local[0] += std::sqrt(dot(beam->P[k], beam->P[k]) + 1.0);
438 
439  for (unsigned int i = 0; i < dim; ++i) {
440 
441  double r = beam->R[k](i);
442  double p = beam->P[k](i);
443 
444  // <x>, <y>, <z>
445  local[i + 1] += r;
446 
447  // <p_x>, <p_y, <p_z>
448  local[i + dim + 1] += p;
449 
450  // <x^2>, <y^2>, <z^2>
451  double r2 = r * r;
452  local[i + 2 * dim + 1] += r2;
453 
454  // <p_x^2>, <p_y^2>, <p_z^2>
455  local[i + 3 * dim + 1] += p * p;
456 
457  // <xp_x>, <y_py>, <zp_z>
458  local[i + 4 * dim + 1] += r * p;
459 
460  // <x^3>, <y^3>, <z^3>
461  local[i + 5 * dim + 1] += r2 * r;
462 
463  // <x^4>, <y^4>, <z^4>
464  local[i + 6 * dim + 1] += r2 * r2;
465  }
466  }
467 
468  // inefficient
469  allreduce(bunchTotalNum, 1, std::plus<long int>());
470 
471  // here we also update the number of particles of *this* bunch
472  if (bunchNr >= (short)beam->getNumBunch())
473  throw OpalException("MultiBunchHandler::calcBunchBeamParameters()",
474  "Bunch number " + std::to_string(bunchNr) +
475  " exceeds bunch index " + std::to_string(beam->getNumBunch() - 1));
476 
477  beam->setTotalNumPerBunch(bunchTotalNum, bunchNr);
478  beam->setLocalNumPerBunch(bunchLocalNum, bunchNr);
479 
480  if ( bunchTotalNum == 0 )
481  return false;
482 
483  // ekin
484  const double m0 = beam->getM() * 1.0e-6;
485  local[0] -= bunchLocalNum;
486  local[0] *= m0;
487 
488  allreduce(local.data(), local.size(), std::plus<double>());
489 
490  double invN = 1.0 / double(bunchTotalNum);
491  binfo.ekin = local[0] * invN;
492 
493  binfo.time = beam->getT() * 1e9; // ns
494  binfo.nParticles = bunchTotalNum;
495 
496  for (unsigned int i = 0; i < dim; ++i) {
497 
498  double w = local[i + 1] * invN;
499  double pw = local[i + dim + 1] * invN;
500  double w2 = local[i + 2 * dim + 1] * invN;
501  double pw2 = local[i + 3 * dim + 1] * invN;
502  double wpw = local[i + 4 * dim + 1] * invN;
503  double w3 = local[i + 5 * dim + 1] * invN;
504  double w4 = local[i + 6 * dim + 1] * invN;
505 
506  // <x>, <y>, <z>
507  binfo.mean[i] = w;
508 
509  // central: <p_w^2> - <p_w>^2 (w = x, y, z)
510  binfo.prms[i] = pw2 - pw * pw;
511  if ( binfo.prms[i] < 0 ) {
512  binfo.prms[i] = 0.0;
513  }
514 
515  // central: <wp_w> - <w><p_w>
516  wpw = wpw - w * pw;
517 
518  // central: <w^2> - <w>^2 (w = x, y, z)
519  binfo.rrms[i] = w2 - w * w;
520 
521  // central: normalized emittance
522  binfo.emit[i] = (binfo.rrms[i] * binfo.prms[i] - wpw * wpw);
523  binfo.emit[i] = std::sqrt(std::max(binfo.emit[i], 0.0));
524 
525  // central: <w^4> - 4 * <w> * <w^3> + 6 * <w>^2 * <w^2> - 3 * <w>^4
526  double tmp = w4
527  - 4.0 * w * w3
528  + 6.0 * w * w * w2
529  - 3.0 * w * w * w * w;
530  binfo.halo[i] = tmp / ( binfo.rrms[i] * binfo.rrms[i] );
531 
532  // central: sqrt(<w^2> - <w>^2) (w = x, y, z)
533  binfo.rrms[i] = std::sqrt(binfo.rrms[i]);
534 
535  // central: sqrt(<p_w^2> - <p_w>^2)
536  binfo.prms[i] = std::sqrt(binfo.prms[i]);
537 
538  // central: rms correlation --> (<wp_w> - <w><p_w>) / sqrt(<w^2> * <p_w^2>)
539  double denom = 1.0 / (binfo.rrms[i] * binfo.prms[i]);
540  binfo.correlation[i] = (std::isfinite(denom)) ? wpw * denom : 0.0;
541  }
542 
543  double tmp = 1.0 / std::pow(binfo.ekin / m0 + 1.0, 2.0);
544  binfo.dEkin = binfo.prms[1] * m0 * std::sqrt(1.0 - tmp);
545 
546  return true;
547 }
548 
549 
550 void MultiBunchHandler::updateTime(const double& dt) {
551  for (short b = 0; b < bunchCount_m; ++b) {
552  binfo_m[b].time += dt;
553  }
554 }
555 
556 
557 void MultiBunchHandler::updatePathLength(const std::vector<double>& lpaths) {
558  PAssert_EQ(bunchCount_m, (short)lpaths.size() - 1);
559  for (short b = 0; b < bunchCount_m; ++b) {
560  binfo_m[b].pathlength += lpaths[b];
561  }
562 }
Inform * gmsg
Definition: Main.cpp:62
Tps< T > pow(const Tps< T > &x, int y)
Integer power.
Definition: TpsMath.h:76
Tps< T > sqrt(const Tps< T > &x)
Square root.
Definition: TpsMath.h:91
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
Definition: Vector3D.cpp:118
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Definition: ReductionLoc.h:84
void allreduce(const T *input, T *output, int count, Op op)
Definition: GlobalComm.hpp:510
Inform & endl(Inform &inf)
Definition: Inform.cpp:42
#define PAssert_LT(a, b)
Definition: PAssert.h:106
#define PAssert_EQ(a, b)
Definition: PAssert.h:104
#define PAssert_GT(a, b)
Definition: PAssert.h:108
ParticlePos_t & R
ParticleAttrib< int > Bin
bool resetPartBinID2(const double eta)
reset Bin[] for each particle according to the method given in paper PAST-AB(064402) by G....
void setNumBunch(short n)
size_t getLocalNum() const
ParticleAttrib< double > M
size_t getTotalNum() const
bool resetPartBinBunch()
ParticleAttrib< Vector_t > P
void setLocalNumPerBunch(size_t numpart, short n)
ParticleAttrib< ParticleOrigin > POrigin
Vector_t get_rrms() const
ParticleAttrib< double > Q
void calcBeamParameters()
PartBins * pbin_m
short getNumBunch() const
Vector_t get_centroid() const
ParticleAttrib< short > bunchNum
void setTotalNumPerBunch(size_t numpart, short n)
void setPBins(PartBins *pbin)
virtual void boundp()
void create(size_t M)
double getM() const
double getT() const
The global OPAL structure.
Definition: OpalData.h:49
static OpalData * getInstance()
Definition: OpalData.cpp:195
void saveBunch(PartBunchBase< double, 3 > *beam)
bool calcBunchBeamParameters(PartBunchBase< double, 3 > *beam, short bunchNr)
MultiBunchHandler(PartBunchBase< double, 3 > *beam, const int &numBunch, const double &eta, const double &para, const std::string &mode, const std::string &binning)
beaminfo_t & getBunchInfo(short bunchNr)
void setMode(const std::string &mbmode)
set the working sub-mode for multi-bunch mode: "FORCE" or "AUTO"
void updateTime(const double &dt)
void setRadiusTurns(const double &radius)
short numBunch_m
The number of bunches specified in TURNS of RUN command.
bool readBunch(PartBunchBase< double, 3 > *beam, const PartData &ref)
void setBinning(std::string binning)
void updatePathLength(const std::vector< double > &lpaths)
short injectBunch(PartBunchBase< double, 3 > *beam, const PartData &ref, bool &flagTransition)
std::vector< beaminfo_t > binfo_m
void updateParticleBins(PartBunchBase< double, 3 > *beam)
pbase_t * getAmrParticleBase()
int getLastemittedBin()
Definition: PartBins.h:136
Particle reference data.
Definition: PartData.h:35
size_t getNumParticles() const
virtual void writeStep(PartBunchBase< double, 3 > *, const std::map< std::string, double > &additionalStepAttributes)
virtual void writeHeader()
virtual void readStep(PartBunchBase< double, 3 > *, h5_ssize_t firstParticle, h5_ssize_t lastParticle)
The base class for all OPAL exceptions.
Definition: OpalException.h:28
virtual void create(size_t)
void barrier(void)
Definition: Inform.h:42
static int getNodes()
Definition: IpplInfo.cpp:670
static int myNode()
Definition: IpplInfo.cpp:691
static Communicate * Comm
Definition: IpplInfo.h:84
Timing::TimerRef TimerRef
Definition: IpplTimings.h:176
static TimerRef getTimer(const char *nm)
Definition: IpplTimings.h:182
static void stopTimer(TimerRef t)
Definition: IpplTimings.h:192
static void startTimer(TimerRef t)
Definition: IpplTimings.h:187