OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
OrbitThreader.cpp
Go to the documentation of this file.
1 //
2 // Class OrbitThreader
3 //
4 // This class determines the design path by tracking the reference particle through
5 // the 3D lattice.
6 //
7 // Copyright (c) 2016, Christof Metzger-Kraus, Helmholtz-Zentrum Berlin, Germany
8 // 2017 - 2022 Christof Metzger-Kraus
9 //
10 // All rights reserved
11 //
12 // This file is part of OPAL.
13 //
14 // OPAL is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
21 //
22 
24 
25 #include "AbsBeamline/BendBase.h"
26 #include "AbsBeamline/RFCavity.h"
30 #include "BasicActions/Option.h"
31 #include "BeamlineCore/MarkerRep.h"
32 #include "Physics/Units.h"
34 #include "Utilities/Options.h"
35 #include "Utilities/Util.h"
36 
37 #include <cmath>
38 #include <filesystem>
39 #include <iostream>
40 #include <limits>
41 
42 #define HITMATERIAL 0x80000000
43 #define EOL 0x40000000
44 #define EVERYTHINGFINE 0x00000000
45 extern Inform *gmsg;
46 
48  const Vector_t &r,
49  const Vector_t &p,
50  double s,
51  double maxDiffZBunch,
52  double t,
53  double dt,
54  StepSizeConfig stepSizes,
55  OpalBeamline &bl) :
56  r_m(r),
57  p_m(p),
58  pathLength_m(s),
59  time_m(t),
60  dt_m(dt),
61  stepSizes_m(stepSizes),
62  zstop_m(stepSizes.getFinalZStop() + std::copysign(1.0, dt) * 2 * maxDiffZBunch),
63  itsOpalBeamline_m(bl),
64  errorFlag_m(0),
65  integrator_m(ref),
66  reference_m(ref)
67 {
68  auto opal = OpalData::getInstance();
69  if (Ippl::myNode() == 0 && !opal->isOptimizerRun()) {
70  std::string fileName = Util::combineFilePath({
71  opal->getAuxiliaryOutputDirectory(),
72  opal->getInputBasename() + "_DesignPath.dat"
73  });
74  if (opal->getOpenMode() == OpalData::OpenMode::WRITE ||
75  !std::filesystem::exists(fileName)) {
76  logger_m.open(fileName);
77  logger_m << "#"
78  << std::setw(17) << "1 - s"
79  << std::setw(18) << "2 - Rx"
80  << std::setw(18) << "3 - Ry"
81  << std::setw(18) << "4 - Rz"
82  << std::setw(18) << "5 - Px"
83  << std::setw(18) << "6 - Py"
84  << std::setw(18) << "7 - Pz"
85  << std::setw(18) << "8 - Efx"
86  << std::setw(18) << "9 - Efy"
87  << std::setw(18) << "10 - Efz"
88  << std::setw(18) << "11 - Bfx"
89  << std::setw(18) << "12 - Bfy"
90  << std::setw(18) << "13 - Bfz"
91  << std::setw(18) << "14 - Ekin"
92  << std::setw(18) << "15 - t"
93  << std::endl;
94  } else {
95  logger_m.open(fileName, std::ios_base::app);
96  }
97 
98  loggingFrequency_m = std::max(1.0, std::round(1e-11 / std::abs(dt_m)));
99  } else {
101  }
107  distTrackBack_m = std::min(pathLength_m, std::max(0.0, maxDiffZBunch));
109 }
110 
111 void OrbitThreader::checkElementLengths(const std::set<std::shared_ptr<Component>>& fields) {
113  ++ stepSizes_m;
114  }
115  if (stepSizes_m.reachedEnd()) {
116  return;
117  }
118  double driftLength = Physics::c * std::abs(stepSizes_m.getdT()) * euclidean_norm(p_m) / Util::getGamma(p_m);
119  for (const std::shared_ptr<Component>& field : fields) {
120  double length = field->getElementLength();
121  int numSteps = field->getRequiredNumberOfTimeSteps();
122 
123  if (length < numSteps * driftLength) {
124  throw OpalException("OrbitThreader::checkElementLengths",
125  "The time step is too long compared to the length of the\n"
126  "element '" + field->getName() + "'\n" +
127  "The length of the element is: " + std::to_string(length) + "\n"
128  "The distance the particles drift in " + std::to_string(numSteps) +
129  " time step(s) is: " + std::to_string(numSteps * driftLength));
130  }
131  }
132 }
133 
135  double initialPathLength = pathLength_m;
136 
138  std::set<std::string> visitedElements;
139 
140  trackBack();
143 
144  Vector_t nextR = r_m / (Physics::c * dt_m);
145  integrator_m.push(nextR, p_m, dt_m);
146  nextR *= Physics::c * dt_m;
147 
148  setDesignEnergy(allElements, visitedElements);
149 
150  auto elementSet = itsOpalBeamline_m.getElements(nextR);
151  std::set<std::shared_ptr<Component>> intersection, currentSet;
153  do {
154  checkElementLengths(elementSet);
155  if (containsCavity(elementSet)) {
156  autophaseCavities(elementSet, visitedElements);
157  }
158 
159  double initialS = pathLength_m;
160  Vector_t initialR = r_m;
161  Vector_t initialP = p_m;
162  double maxDistance = computeDriftLengthToBoundingBox(elementSet, r_m, p_m);
163  integrate(elementSet, maxDistance);
164 
165  registerElement(elementSet, initialS, initialR, initialP);
166 
167  if (errorFlag_m == HITMATERIAL) {
168  // Shouldn't be reached because reference particle
169  // isn't stopped by collimators
170  pathLength_m += std::copysign(1.0, dt_m);
171  }
172 
173  imap_m.add(initialS, pathLength_m, elementSet);
174 
175  IndexMap::value_t::const_iterator it = elementSet.begin();
176  const IndexMap::value_t::const_iterator end = elementSet.end();
177  for (; it != end; ++ it) {
178  visitedElements.insert((*it)->getName());
179  }
180 
181  setDesignEnergy(allElements, visitedElements);
182 
183  currentSet = elementSet;
184  if (errorFlag_m == EVERYTHINGFINE) {
185  nextR = r_m / (Physics::c * dt_m);
186  integrator_m.push(nextR, p_m, dt_m);
187  nextR *= Physics::c * dt_m;
188 
189  elementSet = itsOpalBeamline_m.getElements(nextR);
190  }
191  intersection.clear();
192  std::set_intersection(currentSet.begin(), currentSet.end(),
193  elementSet.begin(), elementSet.end(),
194  std::inserter(intersection, intersection.begin()));
195  } while (errorFlag_m != HITMATERIAL &&
196  errorFlag_m != EOL &&
199  intersection.empty() && !(elementSet.empty() || currentSet.empty())));
200 
202  *gmsg << level1 << "\n" << imap_m << endl;
203  imap_m.saveSDDS(initialPathLength);
204 
206 }
207 
208 void OrbitThreader::integrate(const IndexMap::value_t &activeSet, double /*maxDrift*/) {
210  Vector_t nextR;
211  do {
213 
214  IndexMap::value_t::const_iterator it = activeSet.begin();
215  const IndexMap::value_t::const_iterator end = activeSet.end();
216  Vector_t oldR = r_m;
217 
218  r_m /= Physics::c * dt_m;
219  integrator_m.push(r_m, p_m, dt_m);
220  r_m *= Physics::c * dt_m;
221 
222  Vector_t Ef(0.0), Bf(0.0);
223  std::string names("\t");
224  for (; it != end; ++ it) {
227  Vector_t localE(0.0), localB(0.0);
228 
229  if ((*it)->applyToReferenceParticle(localR, localP, time_m + 0.5 * dt_m, localE, localB)) {
231  return;
232  }
233  names += (*it)->getName() + ", ";
234 
235  Ef += itsOpalBeamline_m.rotateFromLocalCS(*it, localE);
236  Bf += itsOpalBeamline_m.rotateFromLocalCS(*it, localB);
237  }
238 
239  if (((pathLength_m > 0.0 &&
240  pathLength_m < zstop_m) || dt_m < 0.0) &&
241  currentStep_m % loggingFrequency_m == 0 && Ippl::myNode() == 0 &&
242  !OpalData::getInstance()->isOptimizerRun()) {
243  logger_m << std::setw(18) << std::setprecision(8) << pathLength_m + std::copysign(euclidean_norm(r_m - oldR), dt_m)
244  << std::setw(18) << std::setprecision(8) << r_m(0)
245  << std::setw(18) << std::setprecision(8) << r_m(1)
246  << std::setw(18) << std::setprecision(8) << r_m(2)
247  << std::setw(18) << std::setprecision(8) << p_m(0)
248  << std::setw(18) << std::setprecision(8) << p_m(1)
249  << std::setw(18) << std::setprecision(8) << p_m(2)
250  << std::setw(18) << std::setprecision(8) << Ef(0)
251  << std::setw(18) << std::setprecision(8) << Ef(1)
252  << std::setw(18) << std::setprecision(8) << Ef(2)
253  << std::setw(18) << std::setprecision(8) << Bf(0)
254  << std::setw(18) << std::setprecision(8) << Bf(1)
255  << std::setw(18) << std::setprecision(8) << Bf(2)
256  << std::setw(18) << std::setprecision(8) << reference_m.getM() * (sqrt(dot(p_m, p_m) + 1) - 1) * Units::eV2MeV
257  << std::setw(18) << std::setprecision(8) << (time_m + 0.5 * dt_m) * Units::s2ns
258  << names
259  << std::endl;
260  }
261 
262  r_m /= Physics::c * dt_m;
263  integrator_m.kick(r_m, p_m, Ef, Bf, dt_m);
264  integrator_m.push(r_m, p_m, dt_m);
265  r_m *= Physics::c * dt_m;
266 
267  pathLength_m += std::copysign(euclidean_norm(r_m - oldR), dt_m);
268  ++ currentStep_m;
269  time_m += dt_m;
270 
271  nextR = r_m / (Physics::c * dt_m);
272  integrator_m.push(nextR, p_m, dt_m);
273  nextR *= Physics::c * dt_m;
274 
275  if (activeSet.empty() &&
278  errorFlag_m = EOL;
280  return;
281  }
282 
283  } while (activeSet == itsOpalBeamline_m.getElements(nextR));
284 }
285 
287  IndexMap::value_t::const_iterator it = activeSet.begin();
288  const IndexMap::value_t::const_iterator end = activeSet.end();
289 
290  for (; it != end; ++ it) {
291  if ((*it)->getType() == ElementType::TRAVELINGWAVE ||
292  (*it)->getType() == ElementType::RFCAVITY) {
293  return true;
294  }
295  }
296 
297  return false;
298 }
299 
301  const std::set<std::string> &visitedElements) {
302  if (Options::autoPhase == 0) return;
303 
304  IndexMap::value_t::const_iterator it = activeSet.begin();
305  const IndexMap::value_t::const_iterator end = activeSet.end();
306 
307  for (; it != end; ++ it) {
308  if (((*it)->getType() == ElementType::TRAVELINGWAVE ||
309  (*it)->getType() == ElementType::RFCAVITY) &&
310  visitedElements.find((*it)->getName()) == visitedElements.end()) {
311 
314 
315  CavityAutophaser ap(reference_m, *it);
316  ap.getPhaseAtMaxEnergy(initialR,
317  initialP,
318  time_m,
319  dt_m);
320  }
321  }
322 }
323 
324 
326 {
327  IndexMap::value_t::const_iterator it = elementSet.begin();
328  const IndexMap::value_t::const_iterator end = elementSet.end();
329 
330  double designEnergy = 0.0;
331  for (; it != end; ++ it) {
332  if ((*it)->getType() == ElementType::TRAVELINGWAVE ||
333  (*it)->getType() == ElementType::RFCAVITY) {
334  const RFCavity *element = static_cast<const RFCavity *>((*it).get());
335  designEnergy = std::max(designEnergy, element->getDesignEnergy());
336  }
337  }
338 
339  return designEnergy;
340 }
341 
343  dt_m *= -1;
344  ValueRange<double> tmpRange;
345  std::swap(tmpRange, pathLengthRange_m);
346  double initialPathLength = pathLength_m;
347 
348  Vector_t nextR = r_m / (Physics::c * dt_m);
349  integrator_m.push(nextR, p_m, dt_m);
350  nextR *= Physics::c * dt_m;
351 
352  while (std::abs(initialPathLength - pathLength_m) < distTrackBack_m) {
353  auto elementSet = itsOpalBeamline_m.getElements(nextR);
354 
355  double maxDrift = computeDriftLengthToBoundingBox(elementSet, r_m, -p_m);
356  maxDrift = std::min(maxDrift, distTrackBack_m);
357  integrate(elementSet, maxDrift);
358 
359  nextR = r_m / (Physics::c * dt_m);
360  integrator_m.push(nextR, p_m, dt_m);
361  nextR *= Physics::c * dt_m;
362  }
363  std::swap(tmpRange, pathLengthRange_m);
364  currentStep_m *= -1;
365  dt_m *= -1;
366 
368 }
369 
371  double start,
372  const Vector_t &R,
373  const Vector_t &P) {
374 
375  IndexMap::value_t::const_iterator it = elementSet.begin();
376  const IndexMap::value_t::const_iterator end = elementSet.end();
377 
378  for (; it != end; ++ it) {
379  bool found = false;
380  std::string name = (*it)->getName();
381  auto prior = elementRegistry_m.equal_range(name);
382 
383  for (auto pit = prior.first; pit != prior.second; ++ pit) {
384  if (std::abs((*pit).second.endField_m - start) < 1e-10) {
385  found = true;
386  (*pit).second.endField_m = pathLength_m;
387  break;
388  }
389  }
390 
391  if (found) continue;
392 
393  Vector_t initialR = itsOpalBeamline_m.transformToLocalCS(*it, R);
394  Vector_t initialP = itsOpalBeamline_m.rotateToLocalCS(*it, P);
395  double elementEdge = start - initialR(2) * euclidean_norm(initialP) / initialP(2);
396 
397  elementPosition ep = {start, pathLength_m, elementEdge};
398  elementRegistry_m.insert(std::make_pair(name, ep));
399  }
400 }
401 
403  std::map<std::string, std::set<elementPosition, elementPositionComp> > tmpRegistry;
404 
405  for (auto it = elementRegistry_m.begin(); it != elementRegistry_m.end(); ++ it) {
406  const std::string &name = (*it).first;
407  elementPosition &ep = (*it).second;
408 
409  auto prior = tmpRegistry.find(name);
410  if (prior == tmpRegistry.end()) {
411  std::set<elementPosition, elementPositionComp> tmpSet;
412  tmpSet.insert(ep);
413  tmpRegistry.insert(std::make_pair(name, tmpSet));
414  continue;
415  }
416 
417  std::set<elementPosition, elementPositionComp> &set = (*prior).second;
418  set.insert(ep);
419  }
420 
422  FieldList::iterator it = allElements.begin();
423  const FieldList::iterator end = allElements.end();
424  for (; it != end; ++ it) {
425  std::string name = (*it).getElement()->getName();
426  auto trit = tmpRegistry.find(name);
427  if (trit == tmpRegistry.end()) continue;
428 
429  std::queue<std::pair<double, double> > range;
430  std::set<elementPosition, elementPositionComp> &set = (*trit).second;
431 
432  for (auto sit = set.begin(); sit != set.end(); ++ sit) {
433  range.push(std::make_pair((*sit).elementEdge_m, (*sit).endField_m));
434  }
435  (*it).getElement()->setActionRange(range);
436  }
437 }
438 
439 void OrbitThreader::setDesignEnergy(FieldList &allElements, const std::set<std::string> &visitedElements) {
440  double kineticEnergyeV = reference_m.getM() * (sqrt(dot(p_m, p_m) + 1.0) - 1.0);
441 
442  FieldList::iterator it = allElements.begin();
443  const FieldList::iterator end = allElements.end();
444  for (; it != end; ++ it) {
445  std::shared_ptr<Component> element = (*it).getElement();
446  if (visitedElements.find(element->getName()) == visitedElements.end() &&
447  !(element->getType() == ElementType::RFCAVITY ||
448  element->getType() == ElementType::TRAVELINGWAVE)) {
449 
450  element->setDesignEnergy(kineticEnergyeV);
451  }
452  }
453 }
454 
457  FieldList::iterator it = allElements.begin();
458  const FieldList::iterator end = allElements.end();
459 
460  for (; it != end; ++ it) {
461  if (it->getElement()->getType() == ElementType::MARKER) {
462  continue;
463  }
464  BoundingBox other = it->getBoundingBoxInLabCoords();
466  }
467 
469 }
470 
471 
474  for (const Vector_t& pos : {r_m - 10 * dR, r_m + 10 * dR}) {
476  }
477 }
478 
479 double OrbitThreader::computeDriftLengthToBoundingBox(const std::set<std::shared_ptr<Component>> & elements,
480  const Vector_t & position,
481  const Vector_t & direction) const {
482  if (elements.empty() ||
483  (elements.size() == 1 && (*elements.begin())->getType() == ElementType::DRIFT)) {
484  boost::optional<Vector_t> intersectionPoint = globalBoundingBox_m.getIntersectionPoint(position, direction);
485 
486  return intersectionPoint ? euclidean_norm(intersectionPoint.get() - position): 10.0;
487  }
488 
490 }
ValueRange< long > stepRange_m
Definition: OrbitThreader.h:75
static OpalData * getInstance()
Definition: OpalData.cpp:196
Tps< T > sqrt(const Tps< T > &x)
Square root.
Definition: TpsMath.h:91
std::ofstream logger_m
Definition: OrbitThreader.h:91
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:45
double getZStop() const
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
Definition: LICENSE:43
Vector_t transformToLocalCS(const std::shared_ptr< Component > &comp, const Vector_t &r) const
Definition: OpalBeamline.h:166
PETE_TBTree< FnCopysign, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > copysign(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
const double zstop_m
Definition: OrbitThreader.h:80
double pathLength_m
position of reference particle in path length
Definition: OrbitThreader.h:67
void processElementRegister()
double distTrackBack_m
Definition: OrbitThreader.h:70
double dt_m
the time step
Definition: OrbitThreader.h:74
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
static int myNode()
Definition: IpplInfo.cpp:691
BoundingBox globalBoundingBox_m
Definition: OrbitThreader.h:94
void autophaseCavities(const IndexMap::value_t &activeSet, const std::set< std::string > &visitedElements)
std::set< std::shared_ptr< Component > > value_t
Definition: IndexMap.h:47
bool reachedEnd() const
void updateBoundingBoxWithCurrentPosition()
Vector_t rotateToLocalCS(const std::shared_ptr< Component > &comp, const Vector_t &r) const
Definition: OpalBeamline.h:178
std::set< std::shared_ptr< Component > > getElements(const Vector_t &x)
ValueRange< double > getPathLengthRange() const
void enlargeToContainPosition(const Vector_t &position)
Definition: BoundingBox.cpp:41
void computeBoundingBox()
CoordinateSystemTrafo getCSTrafoLab2Local(const std::shared_ptr< Component > &comp) const
Definition: OpalBeamline.h:190
void push(Vector_t &R, const Vector_t &P, const double &dt) const
Definition: BorisPusher.h:131
double getM() const
The constant mass per particle.
Definition: PartData.h:122
Inform & endl(Inform &inf)
Definition: Inform.cpp:42
virtual double getDesignEnergy() const override
Definition: RFCavity.h:339
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Definition: ReductionLoc.h:76
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Definition: ReductionLoc.h:84
std::multimap< std::string, elementPosition > elementRegistry_m
std::string::iterator iterator
Definition: MSLang.h:15
T euclidean_norm(const Vector< T > &)
Euclidean norm.
Definition: Vector.h:243
void setDesignEnergy(FieldList &allElements, const std::set< std::string > &visitedElements)
bool isInside(T value) const
Definition: ValueRange.h:41
alter the names
Definition: LICENSE:330
void enlargeToContainBoundingBox(const BoundingBox &boundingBox)
Definition: BoundingBox.cpp:49
void tidyUp(double zstop)
Definition: IndexMap.cpp:148
The base class for all OPAL exceptions.
Definition: OpalException.h:28
int autoPhase
Definition: Options.cpp:69
OpalBeamline & itsOpalBeamline_m
Definition: OrbitThreader.h:83
void checkElementLengths(const std::set< std::shared_ptr< Component >> &elements)
elements
Definition: IndexMap.cpp:163
Definition: Inform.h:42
set(_SRCS Action.cpp Attribute.cpp AttributeBase.cpp AttributeHandler.cpp BeamSequence.cpp Definition.cpp Directory.cpp Element.cpp Invalidator.cpp OpalData.cpp Object.cpp ObjectFunction.cpp PlaceRep.cpp RangeRep.cpp Table.cpp TableRowRep.cpp ValueDefinition.cpp) include_directories($
Definition: CMakeLists.txt:1
unsigned long long getNumStepsFinestResolution() const
constexpr double s2ns
Definition: Units.h:44
OrbitThreader(const PartData &ref, const Vector_t &r, const Vector_t &p, double s, double maxDiffZBunch, double t, double dT, StepSizeConfig stepSizes, OpalBeamline &bl)
double getdT() const
#define EVERYTHINGFINE
double getGamma(Vector_t p)
Definition: Util.h:46
boost::optional< Vector_t > getIntersectionPoint(const Vector_t &position, const Vector_t &direction) const
Definition: BoundingBox.cpp:57
void saveSDDS(double startS) const
Definition: IndexMap.cpp:177
ValueRange< double > pathLengthRange_m
Definition: OrbitThreader.h:81
without end fields(Default:1 m)\item[ANGLE] Physical angle of the magnet(radians).If not specified
const std::string name
Vector_t rotateFromLocalCS(const std::shared_ptr< Component > &comp, const Vector_t &r) const
Definition: OpalBeamline.h:184
std::string combineFilePath(std::initializer_list< std::string > ilist)
Definition: Util.cpp:197
BorisPusher integrator_m
Definition: OrbitThreader.h:88
FieldList getElementByType(ElementType)
double computeDriftLengthToBoundingBox(const std::set< std::shared_ptr< Component >> &elements, const Vector_t &position, const Vector_t &direction) const
StepSizeConfig stepSizes_m
final position in path length
Definition: OrbitThreader.h:79
double time_m
the simulated time
Definition: OrbitThreader.h:72
size_t loggingFrequency_m
Definition: OrbitThreader.h:92
double getPhaseAtMaxEnergy(const Vector_t &R, const Vector_t &P, double t, double dt)
std::list< ClassicField > FieldList
Definition: ClassicField.h:43
constexpr double e
The value of .
Definition: Physics.h:39
unsigned int errorFlag_m
Definition: OrbitThreader.h:86
Vector_t p_m
momentum of reference particle
Definition: OrbitThreader.h:65
double getMaxDesignEnergy(const IndexMap::value_t &elementSet) const
IndexMap imap_m
Definition: OrbitThreader.h:84
Vector_t r_m
position of reference particle in lab coordinates
Definition: OrbitThreader.h:63
void kick(const Vector_t &R, Vector_t &P, const Vector_t &Ef, const Vector_t &Bf, const double &dt) const
Definition: BorisPusher.h:65
bool containsCavity(const IndexMap::value_t &activeSet)
#define EOL
Inform & level1(Inform &inf)
Definition: Inform.cpp:45
void integrate(const IndexMap::value_t &activeSet, double maxDrift=10.0)
void enlargeIfOutside(T value)
Definition: ValueRange.h:36
void add(key_t::first_type initialStep, key_t::second_type finalStep, const value_t &val)
Definition: IndexMap.cpp:113
Inform * gmsg
Definition: Main.cpp:70
end
Definition: multipole_t.tex:9
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
Definition: Vector3D.cpp:118
bool isOutside(T value) const
Definition: ValueRange.h:46
const PartData & reference_m
Definition: OrbitThreader.h:89
constexpr double eV2MeV
Definition: Units.h:77
void registerElement(const IndexMap::value_t &elementSet, double, const Vector_t &r, const Vector_t &p)
#define HITMATERIAL