OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
ThickTracker.cpp
Go to the documentation of this file.
1 //
2 // Class ThickTracker
3 // Tracks using thick-lens algorithm.
4 //
5 // Copyright (c) 2018, Philippe Ganz, ETH Zürich
6 // All rights reserved
7 //
8 // Implemented as part of the Master thesis
9 // "s-based maps from TPS & Lie-Series applied to Proton-Therapy Gantries"
10 //
11 // This file is part of OPAL.
12 //
13 // OPAL is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
20 //
21 
22 #include <cfloat>
23 #include <fstream>
24 #include <typeinfo>
25 
27 
28 #include "Beamlines/Beamline.h"
30 
32 
33 #include "Structure/DataSink.h"
34 #include "Utilities/Options.h"
35 #include "Utilities/Util.h"
36 #include "Utilities/Timer.h"
37 
38 #include "Physics/Physics.h"
39 
40 
42  const PartData &reference,
43  bool revBeam, bool revTrack)
44  : Tracker(beamline, reference, revBeam, revTrack)
45  , hamiltonian_m(1)
46  , RefPartR_m(0.0)
47  , RefPartP_m(0.0)
48  , itsDataSink_m(nullptr)
49  , itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getInitialDirection())
50  , zstart_m(0.0)
51  , zstop_m(0.0)
52  , threshold_m(1.0e-6)
53  , truncOrder_m(1) // linear
54  , mapCreation_m( IpplTimings::getTimer("mapCreation"))
55  , mapCombination_m(IpplTimings::getTimer("mapCombination"))
56  , mapTracking_m( IpplTimings::getTimer("mapTracking"))
57 {
58  CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
59  beamline.getInitialDirection());
60  referenceToLabCSTrafo_m = labToRef.inverted();
61 }
62 
63 
66  Beam &/*beam*/,
67  DataSink &ds,
68  const PartData &reference,
69  bool revBeam, bool revTrack,
70  const std::vector<unsigned long long> &/*maxSteps*/,
71  double zstart,
72  const std::vector<double> &zstop,
73  const std::vector<double> &/*dt*/,
74  const int& truncOrder)
75  : Tracker(beamline, bunch, reference, revBeam, revTrack)
76  , hamiltonian_m(truncOrder)
77  , RefPartR_m(0.0)
78  , RefPartP_m(0.0)
79  , itsDataSink_m(&ds)
80  , itsOpalBeamline_m(beamline.getOrigin3D(), beamline.getInitialDirection())
81  , zstart_m(zstart)
82  , zstop_m(zstop[0])
83  , threshold_m(1.0e-6)
84  , truncOrder_m(truncOrder)
85  , mapCreation_m( IpplTimings::getTimer("mapCreation"))
86  , mapCombination_m(IpplTimings::getTimer("mapCombination"))
87  , mapTracking_m( IpplTimings::getTimer("mapTracking"))
88 {
89  if ( zstop.size() > 1 )
90  throw OpalException("ThickTracker::ThickTracker()",
91  "Multiple tracks not yet supported.");
92 
93 
94  CoordinateSystemTrafo labToRef(beamline.getOrigin3D(),
95  beamline.getInitialDirection());
96  referenceToLabCSTrafo_m = labToRef.inverted();
97 }
98 
99 
101 {}
102 
103 
104 
106 
107  const FlaggedBeamline* fbl = static_cast<const FlaggedBeamline*>(&bl);
108  if (fbl->getRelativeFlag()) {
109  *gmsg << " do stuff" << endl;
110  OpalBeamline stash(fbl->getOrigin3D(), fbl->getInitialDirection());
111  stash.swap(itsOpalBeamline_m);
112  fbl->iterate(*this, false);
115  stash.merge(itsOpalBeamline_m);
116  stash.swap(itsOpalBeamline_m);
117  } else {
118  fbl->iterate(*this, false);
119  }
120 }
121 
122 
124  itsBeamline_m.accept(*this);
126 }
127 
128 
129 
130 
131 /*
132 //TODO complete and test fringe fields
133 void ThickTracker::insertFringeField(SBend* pSBend, lstruct_t& mBL,
134  double& beta0, double& gamma0, double& P0, double& q, std::array<double,2>& paramFringe, std::string e){
135 
136 
137  series_t H;
138  map_t tempMap, fieldMap;
139  lstruct_t::iterator mBLit;
140  double lenFringe = paramFringe[0] + paramFringe[1];
141 
142  //double intHeight = 0.1; //:TODO: change or argument for that value
143  double stepSize = 0.01; //:TODO: change or argument for that value maybe minStepIfSC?
144 
145 
146  //entrFringe = std::fabs(intHeight * std::tan(pSBend->getEntranceAngle()));
147 
148  //get proper slices for the fringe field
149  double nSlices = std::ceil(2 * lenFringe / stepSize);
150  stepSize = 2 * lenFringe / nSlices;
151 
152  //Create structMapTracking and push in BeamLine
153  double K0= pSBend ->getB()*(Physics::c/itsReference.getP());
154  K0= std::round(K0*1e6)/1e6 *q*(Physics::c/P0);
155 
156  double h = 1./ pSBend ->getBendRadius(); //inverse bending radius [1/m]
157  K0<0 ? h = -1*h : h = 1*h;
158 
159  series_t az = - K0 / (2 * lenFringe) * (hamiltonian_m.y*hamiltonian_m.y - hamiltonian_m.x*hamiltonian_m.x) * std::tan(pSBend->getEntranceAngle());
160  if (e == "out") {
161  az = -az;
162  }
163  std::cout << az.getMaxOrder() << std::endl;
164  for ( int i = 0 ; i < nSlices; i++ ){
165  double l = stepSize * i;
166  series_t ax = 0.5 * K0 / (2 * lenFringe) * (l*l - hamiltonian_m.y*hamiltonian_m.y);
167  H = hamiltonian_m.bendFringe(beta0, gamma0, h, K0, ax, az);
168  tempMap = ExpMap(-H * stepSize ,truncOrder_m);
169  fieldMap = (tempMap * fieldMap).truncate(truncOrder_m);
170  }
171 
172  structMapTracking fringeField;
173  fringeField.elementName=pSBend->getName() + "accumulated Fringe Field Map";
174  if (e == "in"){
175  fringeField.elementPos=(pSBend->getElementPosition() - paramFringe[0]);
176  } else if (e == "out") {
177  fringeField.elementPos=(pSBend->getElementPosition() + pSBend->getArcLength() - paramFringe[1]);
178  }
179  fringeField.stepSize= lenFringe;
180  fringeField.nSlices=1;
181  fringeField.elementMap=fieldMap;
182  mBL.push_back(fringeField);
183 }
184 */
185 
186 
192 
193  /*
194  * global settings
195  */
196  Inform msg("ThickTracker", *gmsg);
197 
199 
201 
202  if ( OpalData::getInstance()->hasPriorTrack() ||
203  OpalData::getInstance()->inRestartRun() )
204  {
206  }
207 
208  prepareSections();
209 
210  msg << "Truncation order: " << this->truncOrder_m << endl;
211 
212 
213  this->checkElementOrder_m();
214 
215  this->fillGaps_m();
216 
217  //FIXME in local system only
218  RefPartR_m = Vector_t(0.0);
220 
222 
223 // IpplTimings::startTimer(mapCreation_m);
224 
225  // TODO need a way to implement Initial dispersion Values
226  //dispInitialVal[0][0]= 0.5069938765;
227  //dispInitialVal[0][1]= -0.1681363086;
229 
230  track_m();
231 
232  // fMatrix_t sigMatrix = itsBunch_m->getSigmaMatrix();
233  // linSigAnalyze(sigMatrix);
234 }
235 
236 
238 
239  // check order of beam line
241  beamline_t::const_iterator el = elements_m.cbegin();
242 
243  double currentEnd = zstart_m;
244  for (FieldList::iterator it = elements.begin(); it != elements.end(); ++it) {
245  double pos = it->getElement()->getElementPosition();
246  // we have to take this length due to dipole --> arclength
247  if ( currentEnd - pos > threshold_m ) {
248 
249  throw OpalException("ThickTracker::checkOrder_m()",
250  std::string("Elements are not in ascending order or overlap.") +
251  " Element Name: " + it->getElement()->getName() +
252  " ELEMEDGE position: " + std::to_string(pos) +
253  " Beamline end " + std::to_string(currentEnd) +
254  " element length " + std::to_string(std::get<2>(*el))) ;
255  }
256  currentEnd = pos + std::get<2>(*el);
257  ++el;
258  while (std::get<2>(*el) == 0) ++el; // skip zero-length elements (aka fringe fields)
259  }
260 }
261 
262 
264 
268 
269  beamline_t tmp;
270 
272  beamline_t::const_iterator el = elements_m.cbegin();
273 
274  double currentEnd = zstart_m;
275  for (FieldList::iterator it = elements.begin(); it != elements.end(); ++it) {
276 
277  tmp.push_back( *el );
278 
279  double pos = it->getElement()->getElementPosition();
280 
281  double length = std::abs(pos - currentEnd);
282  if ( length > threshold_m ) {
283  //FIXME if gamma changes this is an error!!!
284  double gamma = itsReference.getGamma();
285  tmp.push_back(std::make_tuple(hamiltonian_m.drift(gamma), 1, length));
286  }
287 
288  currentEnd = pos + std::get<2>(*el);
289  ++el;
290  }
291 
292  double length = std::abs(zstop_m - currentEnd);
293  if ( length > threshold_m ) {
294  //FIXME if gamma changes this is an error!!!
295  double gamma = itsReference.getGamma();
296  tmp.push_back(std::make_tuple(hamiltonian_m.drift(gamma), 1, length));
297  }
298 
299  elements_m.swap(tmp);
300 }
301 
302 
304 {
306 
307  fMatrix_t tFMatrix;
308  for (int i=0; i<6; i++){
309  tFMatrix[i][i]=1.;
310  }
311 
312  FMatrix<double, 1, 4> dispInitialVal;
313  for (int i=2; i<4; i++){
314  dispInitialVal[0][i]=0;
315  }
316 
317  map_t transferMap;
318 
319  fMatrix_t refSigma;
320  refSigma = (itsBunch_m->getSigmaMatrix());
321 
322  double spos = zstart_m;
323 
324 
325  this->advanceDispersion_m(tFMatrix, dispInitialVal, spos);
326 
327 
328  std::size_t step = 0;
329 
330  this->dump_m();
331 
332  //(1) Loop Beamline
333  for(beamline_t::const_iterator it = elements_m.cbegin(); it != elements_m.end(); ++it) {
334  //(2) Loop Slices
335 
336  const series_t& H = std::get<0>(*it);
337  const std::size_t& nSlices = std::get<1>(*it);
338  const double& length = std::get<2>(*it);
339 
340  const double ds = length / double(nSlices);
341 
342  map_t map = ExpMap(- H * ds, truncOrder_m);
343 
344  // global truncation order is truncOrder_m + 1
345  map = map.truncate(truncOrder_m);
346 
347  for (std::size_t slice = 0; slice < nSlices; ++slice) {
348 
349  this->advanceParticles_m(map);
350 
351  this->concatenateMaps_m(map, transferMap);
352 
353  tFMatrix= transferMap.linearTerms();
354  this->advanceDispersion_m(tFMatrix, dispInitialVal, spos);
355 
356  spos += ds;
357  ++step;
358 
359  this->update_m(spos, step);
360 
361  this->dump_m();
362 
363  refSigma = itsBunch_m->getSigmaMatrix();
364 
365  //printPhaseShift(refSigma ,mapBeamLineit->elementMap.linearTerms(), N);
366  }
367  }
368 
369 
370  this->write_m(transferMap);
371 
373 }
374 
375 
378  const Vector_t& P) const
379 {
380  particle_t particle;
381  for (int d = 0; d < 3; ++d) {
382  particle[2 * d] = R(d);
383  particle[2 *d + 1] = P(d);
384  }
385  return particle;
386 }
387 
388 
390  Vector_t& R,
391  Vector_t& P) const
392 {
393  for (int d = 0; d < 3; ++d) {
394  R(d) = particle[2 * d];
395  P(d) = particle[2 *d + 1];
396  }
397 }
398 
399 
400 void ThickTracker::write_m(const map_t& map) {
401 
402  if ( Ippl::myNode() == 0 ) {
403 
404  static bool first = true;
405 
406  std::string fn = OpalData::getInstance()->getInputBasename() + ".map";
407 
408  std::ofstream out;
409 
410  if ( first ) {
411  first = false;
412  out.open(fn, std::ios::out);
413  } else {
414  out.open(fn, std::ios::app);
415  }
416 
417  out << std::setprecision(16)
418  << map
419  << std::endl;
420 
421  out.close();
422  }
423 }
424 
425 
427  for (std::size_t ip = 0; ip < itsBunch_m->getLocalNum(); ++ip) {
428 
429  particle_t particle = this->particleToVector_m(itsBunch_m->R[ip],
430  itsBunch_m->P[ip]);
431 
432  this->updateParticle_m(particle, map);
433 
434  this->vectorToParticle_m(particle,
435  itsBunch_m->R[ip],
436  itsBunch_m->P[ip]);
437  }
438 
439  // update reference particle
440  particle_t particle = this->particleToVector_m(RefPartR_m,
441  RefPartP_m);
442 
443  this->updateParticle_m(particle, map);
444 
445  this->vectorToParticle_m(particle,
446  RefPartR_m,
447  RefPartP_m);
448 }
449 
450 
452  const map_t& map)
453 {
454  double betagamma = itsBunch_m->getInitialBeta() * itsBunch_m->getInitialGamma();
455 
456  //Units
457  double pParticle= std::sqrt( particle[1] * particle[1] +
458  particle[3] * particle[3] +
459  particle[5] * particle[5]); // [beta gamma]
460 
461  particle[1] /= betagamma;
462  particle[3] /= betagamma;
463 
464  particle[5] = std::sqrt( 1.0 + pParticle * pParticle ) / betagamma
465  - 1.0 / itsBunch_m->getInitialBeta();
466 
467  //Apply element map
468  particle = map * particle;
469 
470  //Units back
471  particle[1] *= betagamma;
472  particle[3] *= betagamma;
473 
474  double tempGamma = (particle[5] + 1.0 / itsBunch_m->getInitialBeta())
475  * betagamma ;
476 
477  pParticle = std::sqrt( tempGamma * tempGamma -1.0);
478 
479  particle[5] = std::sqrt(pParticle * pParticle -
480  particle[1] * particle[1] -
481  particle[3] * particle[3] );
482 }
483 
484 
487  y = x * y;
488  y = y.truncate(truncOrder_m);
490 }
491 
492 
494 
503  FMatrix<double, 1, 4> initialVal,
504  double pos)
505 {
506  if ( Ippl::myNode() == 0 ) {
507  static bool first = true;
508 
509  std::ofstream out;
510  std::string fn = OpalData::getInstance()->getInputBasename() + ".dispersion";
511 
512  if ( first ) {
513  first = false;
514  out.open(fn, std::ios::out);
515  } else {
516  out.open(fn, std::ios::app);
517  }
518 
519  out << std::setprecision(16);
520 
521 
522  FMatrix<double, 2, 2> subx, suby;
523  FMatrix<double, 2, 1> subdx, subdy;
524  FMatrix<double, 2, 1> dxi, dyi, dx, dy;
525 
526  for (int i=0; i<2; i++){
527  dxi[i][0]= initialVal[0][i]; //
528  dyi[i][0]= initialVal[0][i+2];
529 
530  subdx[i][0]=tempMatrix[i][5]*itsBunch_m->getInitialBeta();
531  subdy[i][0]=tempMatrix[i+2][5]*itsBunch_m->getInitialBeta();
532 
533  for (int j=0; j<2; j++){
534 
535  subx[i][j]=tempMatrix[i][j];
536  suby[i][j]=tempMatrix[i+2][j+2];
537 
538  }
539  }
540 
541  dx= subx*dxi + subdx;
542  dy= suby*dyi + subdy;
543 
544 
545 
546  out <<pos<< "\t" << dx[0][0] << "\t" << dx[0][1] << "\t" << dy[0][0] << "\t" << dy[0][1] << std::endl;
547  }
548 }
549 
550 
552 
553  if ( itsBunch_m->getTotalNum() == 0 )
554  return;
555 
556  Inform msg("ThickTracker", *gmsg);
557 
558  msg << *itsBunch_m << endl;
559 
560  const std::size_t step = itsBunch_m->getGlobalTrackStep();
561 
562  bool psDump = ((step + 1) % Options::psDumpFreq == 0);
563  bool statDump = ((step + 1) % Options::statDumpFreq == 0);
564 
565  // Sample fields at (xmin, ymin, zmin), (xmax, ymax, zmax) and the centroid location. We
566  // are sampling the electric and magnetic fields at the back, front and
567  // center of the beam.
568 
569  Vector_t FDext[2]; // FDext = {BHead, EHead, BRef, ERef, BTail, ETail}.
570 
571  if (psDump || statDump) {
572 
573  Vector_t externalE, externalB;
574 
575  Vector_t rmin, rmax;
576  itsBunch_m->get_bounds(rmin, rmax);
577 
578  externalB = Vector_t(0.0);
579  externalE = Vector_t(0.0);
582  itsBunch_m->getT() - 0.5 * itsBunch_m->getdT(),
583  externalE,
584  externalB);
585  FDext[0] = referenceToLabCSTrafo_m.rotateFrom(externalB);
586  FDext[1] = referenceToLabCSTrafo_m.rotateFrom(externalE * 1e-6);
587  }
588 
589 
590  if ( psDump ) {
592  }
593 
594  if ( statDump ) {
595  std::vector<std::pair<std::string, unsigned int> > collimatorLosses;
596  itsDataSink_m->dumpSDDS(itsBunch_m, FDext, collimatorLosses);
597  }
598 }
599 
600 
601 void ThickTracker::update_m(const double& spos,
602  const std::size_t& step)
603 {
604  // update dt and t
605  double ds = spos - itsBunch_m->get_sPos();
606  double gamma = itsBunch_m->get_gamma();
607  double beta = std::sqrt(1.0 - 1.0 / (gamma * gamma) );
608  double dt = ds / Physics::c / beta;
609  itsBunch_m->setdT(dt);
610  itsBunch_m->setT(itsBunch_m->getT() + dt);
611 
612  const unsigned int localNum = itsBunch_m->getLocalNum();
613  for (unsigned int i = 0; i < localNum; ++i) {
614  itsBunch_m->dt[i] = dt;
615  }
616 
617 
618  itsBunch_m->set_sPos(spos);
622 }
Inform * gmsg
Definition: Main.cpp:62
elements
Definition: IndexMap.cpp:163
Tps< T > sqrt(const Tps< T > &x)
Square root.
Definition: TpsMath.h:91
T euclidean_norm(const Vector< T > &)
Euclidean norm.
Definition: Vector.h:243
FVps< T, N > ExpMap(const FTps< T, N > &H, int trunc=FTps< T, N >::EXACT)
Build the exponential series.
Definition: FTps.hpp:1994
std::list< ClassicField > FieldList
Definition: ClassicField.h:42
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
Inform & endl(Inform &inf)
Definition: Inform.cpp:42
constexpr double e
The value of.
Definition: Physics.h:39
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:51
std::string::iterator iterator
Definition: MSLang.h:16
int psDumpFreq
The frequency to dump the phase space, i.e.dump data when steppsDumpFreq==0.
Definition: Options.cpp:39
int statDumpFreq
The frequency to dump statistical values, e.e. dump data when stepstatDumpFreq==0.
Definition: Options.cpp:41
ParticlePos_t & R
size_t getLocalNum() const
void set_sPos(double s)
size_t getTotalNum() const
double get_gamma() const
ParticleAttrib< Vector_t > P
double getdT() const
double getInitialBeta() const
void calcBeamParameters()
double getInitialGamma() const
Vector_t get_pmean_Distribution() const
ParticleAttrib< double > dt
void setdT(double dt)
void get_bounds(Vector_t &rmin, Vector_t &rmax)
void setGlobalTrackStep(long long n)
step in multiple TRACK commands
FMatrix< double, 2 *Dim, 2 *Dim > getSigmaMatrix()
long long getGlobalTrackStep() const
void setT(double t)
double get_sPos() const
double getT() const
void setOpenMode(OPENMODE openMode)
Definition: OpalData.cpp:348
std::string getInputBasename()
get input file name without extension
Definition: OpalData.cpp:658
void setInPrepState(bool state)
Definition: OpalData.cpp:299
void setGlobalPhaseShift(double shift)
units: (sec)
Definition: OpalData.cpp:446
static OpalData * getInstance()
Definition: OpalData.cpp:195
Hamiltonian::series_t drift(const double &gamma0)
Definition: Hamiltonian.cpp:37
Vector_t RefPartP_m
Definition: ThickTracker.h:319
OpalBeamline itsOpalBeamline_m
Definition: ThickTracker.h:323
void advanceDispersion_m(fMatrix_t tempMatrix, FMatrix< double, 1, 4 > initialVal, double pos)
Writes Dispersion in X and Y plane.
int truncOrder_m
truncation order of map tracking
Definition: ThickTracker.h:333
std::list< tuple_t > beamline_t
Definition: ThickTracker.h:93
particle_t particleToVector_m(const Vector_t &R, const Vector_t &P) const
Vector_t RefPartR_m
Definition: ThickTracker.h:318
void fillGaps_m()
Fills undefined beam path with a Drift Space.
CoordinateSystemTrafo referenceToLabCSTrafo_m
Definition: ThickTracker.h:330
void advanceParticles_m(const map_t &map)
double threshold_m
Threshold for element overlaps and gaps.
Definition: ThickTracker.h:327
beamline_t elements_m
elements in beam line
Definition: ThickTracker.h:328
virtual void visitBeamline(const Beamline &)
Apply the algorithm to a beam line.
void prepareSections()
void concatenateMaps_m(const map_t &x, map_t &y)
void updateParticle_m(particle_t &particle, const map_t &map)
void write_m(const map_t &map)
ThickTracker()=delete
Hamiltonian hamiltonian_m
Definition: ThickTracker.h:315
void vectorToParticle_m(const particle_t &particle, Vector_t &R, Vector_t &P) const
IpplTimings::TimerRef mapTracking_m
track particles trough maps of elements_m
Definition: ThickTracker.h:337
IpplTimings::TimerRef mapCombination_m
map accumulation along elements_m -> Transfermap
Definition: ThickTracker.h:336
virtual void execute()
Apply the algorithm to the top-level beamline.
virtual ~ThickTracker()
void update_m(const double &spos, const std::size_t &step)
void checkElementOrder_m()
double zstart_m
Start of beam line.
Definition: ThickTracker.h:325
DataSink * itsDataSink_m
Definition: ThickTracker.h:321
double zstop_m
End of beam line.
Definition: ThickTracker.h:326
Vector truncated power series in n variables.
Definition: FVps.h:39
FVps truncate(int trunc)
Truncate.
Definition: FVps.hpp:234
FMatrix< T, N, N > linearTerms() const
Extract the linear part of the map.
Definition: FVps.hpp:561
virtual void accept(BeamlineVisitor &visitor) const =0
Apply visitor.
const PartData itsReference
The reference information.
Vector_t rotateFrom(const Vector_t &r) const
Vector_t transformTo(const Vector_t &r) const
Vector_t rotateTo(const Vector_t &r) const
CoordinateSystemTrafo inverted() const
Particle reference data.
Definition: PartData.h:35
double getGamma() const
The relativistic gamma per particle.
Definition: PartData.h:129
const Beamline & itsBeamline_m
Definition: Tracker.h:122
PartBunchBase< double, 3 > * itsBunch_m
The bunch of particles to be tracked.
Definition: Tracker.h:151
An abstract sequence of beam line components.
Definition: Beamline.h:34
virtual Quaternion getInitialDirection() const
Definition: Beamline.cpp:53
virtual Vector_t getOrigin3D() const
Definition: Beamline.cpp:49
bool getRelativeFlag() const
Definition: TBeamline.h:451
Quaternion getInitialDirection() const
Definition: TBeamline.h:441
Vector_t getOrigin3D() const
Definition: TBeamline.h:431
virtual void iterate(BeamlineVisitor &, bool r2l) const
Apply visitor to all elements of the line.
Definition: TBeamline.h:203
A templated representation for vectors.
Definition: FVector.h:38
FieldList getElementByType(ElementBase::ElementType)
void merge(OpalBeamline &rhs)
void prepareSections()
void compute3DLattice()
unsigned long getFieldAt(const unsigned int &, const Vector_t &, const long &, const double &, Vector_t &, Vector_t &)
void swap(OpalBeamline &rhs)
Definition: Beam.h:32
void dumpSDDS(PartBunchBase< double, 3 > *beam, Vector_t FDext[], const double &azimuth=-1) const
Definition: DataSink.cpp:109
void dumpH5(PartBunchBase< double, 3 > *beam, Vector_t FDext[]) const
Definition: DataSink.cpp:90
The base class for all OPAL exceptions.
Definition: OpalException.h:28
Definition: Inform.h:42
static int myNode()
Definition: IpplInfo.cpp:691
static void stopTimer(TimerRef t)
Definition: IpplTimings.h:192
static void startTimer(TimerRef t)
Definition: IpplTimings.h:187
Vektor< double, 3 > Vector_t
Definition: Vektor.h:6