ImpactX
Loading...
Searching...
No Matches
RFCavity.H
Go to the documentation of this file.
1/* Copyright 2022-2023 The Regents of the University of California, through Lawrence
2 * Berkeley National Laboratory (subject to receipt of any required
3 * approvals from the U.S. Dept. of Energy). All rights reserved.
4 *
5 * This file is part of ImpactX.
6 *
7 * Authors: Chad Mitchell, Axel Huebl
8 * License: BSD-3-Clause-LBNL
9 */
10#ifndef IMPACTX_RFCAVITY_H
11#define IMPACTX_RFCAVITY_H
12
15#include "mixin/alignment.H"
16#include "mixin/pipeaperture.H"
17#include "mixin/beamoptic.H"
19#include "mixin/named.H"
20#include "mixin/thick.H"
21
22#include <ablastr/constant.H>
23
24#include <AMReX.H>
25#include <AMReX_Extension.H>
26#include <AMReX_Math.H>
27#include <AMReX_REAL.H>
28#include <AMReX_SIMD.H>
29#include <AMReX_SmallMatrix.H>
30
31#include <cmath>
32#include <stdexcept>
33#include <tuple>
34#include <vector>
35
36
37namespace impactx::elements
38{
49 {
51 0.1644024074311037,
52 -0.1324009958969339,
53 4.3443060026047219e-002,
54 8.5602654094946495e-002,
55 -0.2433578169042885,
56 0.5297150596779437,
57 0.7164884680963959,
58 -5.2579522442877296e-003,
59 -5.5025369142193678e-002,
60 4.6845673335028933e-002,
61 -2.3279346335638568e-002,
62 4.0800777539657775e-003,
63 4.1378326533752169e-003,
64 -2.5040533340490805e-003,
65 -4.0654981400000964e-003,
66 9.6630592067498289e-003,
67 -8.5275895985990214e-003,
68 -5.8078747006425020e-002,
69 -2.4044337836660403e-002,
70 1.0968240064697212e-002,
71 -3.4461179858301418e-003,
72 -8.1201564869443749e-004,
73 2.1438992904959380e-003,
74 -1.4997753525697276e-003,
75 1.8685171825676386e-004
76 };
77
79 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
80 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
81 0, 0, 0
82 };
83 };
84
91namespace RFCavityData
92{
94 inline int next_id = 0;
95
97 inline std::map<int, std::vector<amrex::ParticleReal>> h_cos_coef = {};
99 inline std::map<int, std::vector<amrex::ParticleReal>> h_sin_coef = {};
100
102 inline std::map<int, amrex::Gpu::DeviceVector<amrex::ParticleReal>> d_cos_coef = {};
104 inline std::map<int, amrex::Gpu::DeviceVector<amrex::ParticleReal>> d_sin_coef = {};
105
106} // namespace RFCavityData
107
108 struct RFCavity
109 : public mixin::Named,
110 public mixin::BeamOptic<RFCavity>,
111 public mixin::LinearTransport<RFCavity>,
112 public mixin::Thick,
113 public mixin::Alignment,
114 public mixin::PipeAperture,
115 public amrex::simd::Vectorized<amrex::simd::native_simd_size_particlereal>
116 {
117 static constexpr auto type = "RFCavity";
119
139 amrex::ParticleReal ds,
140 amrex::ParticleReal escale,
141 amrex::ParticleReal freq,
142 amrex::ParticleReal phase,
143 std::vector<amrex::ParticleReal> cos_coef,
144 std::vector<amrex::ParticleReal> sin_coef,
145 amrex::ParticleReal dx = 0,
146 amrex::ParticleReal dy = 0,
147 amrex::ParticleReal rotation_degree = 0,
148 amrex::ParticleReal aperture_x = 0,
149 amrex::ParticleReal aperture_y = 0,
150 int mapsteps = 1,
151 int nslice = 1,
152 std::optional<std::string> name = std::nullopt
153 )
154 : Named(std::move(name)),
155 Thick(ds, nslice),
156 Alignment(dx, dy, rotation_degree),
158 m_escale(escale), m_freq(freq), m_phase(phase), m_mapsteps(mapsteps), m_id(RFCavityData::next_id)
159 {
160 // next created RF cavity has another id for its data
162
163 // validate sin and cos coefficients are the same length
164 m_ncoef = int(cos_coef.size());
165 if (m_ncoef != int(sin_coef.size()))
166 throw std::runtime_error("RFCavity: cos and sin coefficients must have same length!");
167
168 // host data
169 RFCavityData::h_cos_coef[m_id] = cos_coef;
170 RFCavityData::h_sin_coef[m_id] = sin_coef;
173
174 // device data
178 cos_coef.begin(), cos_coef.end(),
181 sin_coef.begin(), sin_coef.end(),
184
185 // low-level objects we can use on device
188 }
189
191 using BeamOptic::operator();
192
200 void compute_constants (RefPart const & refpart)
201 {
202 using namespace amrex::literals; // for _rt and _prt
203
204 Alignment::compute_constants(refpart);
205 }
206
221 template<typename T_Real=amrex::ParticleReal, typename T_IdCpu=uint64_t>
224 T_Real & AMREX_RESTRICT x,
225 T_Real & AMREX_RESTRICT y,
226 T_Real & AMREX_RESTRICT t,
227 T_Real & AMREX_RESTRICT px,
228 T_Real & AMREX_RESTRICT py,
229 T_Real & AMREX_RESTRICT pt,
230 T_IdCpu & AMREX_RESTRICT idcpu,
231 RefPart const & AMREX_RESTRICT refpart
232 ) const
233 {
234 using namespace amrex::literals; // for _rt and _prt
235
236 // shift due to alignment errors of the element
237 shift_in(x, y, px, py);
238
239 // get the linear map
241
242 // symplectic linear map for the RF cavity is computed using the
243 // Hamiltonian formalism as described in:
244 // https://uspas.fnal.gov/materials/09UNM/ComputationalMethods.pdf.
245 // R denotes the transfer matrix in the basis (x,px,y,py,t,pt),
246 // so that, e.g., R(3,4) = dyf/dpyi.
247 amrex::SmallVector<T_Real, 6, 1> const v{x, px, y, py, t, pt};
248
249 // push particles using the linear map
250 auto const out = R * v;
251
252 // assign updated values
253 x = out[1];
254 px = out[2];
255 y = out[3];
256 py = out[4];
257 t = out[5];
258 pt = out[6];
259
260 // apply transverse aperture
261 apply_aperture(x, y, idcpu);
262
263 // undo shift due to alignment errors of the element
264 shift_out(x, y, px, py);
265 }
266
272 void operator() (RefPart & AMREX_RESTRICT refpart) const
273 {
274 using namespace amrex::literals; // for _rt and _prt
275 using amrex::Math::powi;
276
277 // assign input reference particle values
278 amrex::ParticleReal const x = refpart.x;
279 amrex::ParticleReal const px = refpart.px;
280 amrex::ParticleReal const y = refpart.y;
281 amrex::ParticleReal const py = refpart.py;
282 amrex::ParticleReal const z = refpart.z;
283 amrex::ParticleReal const pz = refpart.pz;
284 amrex::ParticleReal const pt = refpart.pt;
285 amrex::ParticleReal const s = refpart.s;
286 amrex::ParticleReal const sedge = refpart.sedge;
287
288 // initialize linear map (deviation) values
289 refpart.map = decltype(refpart.map)::Identity();
290
291 // length of the current slice
292 amrex::ParticleReal const slice_ds = m_ds / nslice();
293
294 // compute initial value of beta*gamma
295 amrex::ParticleReal const bgi = std::sqrt(powi<2>(pt) - 1.0_prt);
296
297 // call integrator to advance (t,pt)
298 amrex::ParticleReal const zin = s - sedge;
299 amrex::ParticleReal const zout = zin + slice_ds;
300 int const nsteps = m_mapsteps;
301
302 integrators::symp2_integrate_split3(refpart,zin,zout,nsteps,*this);
303 amrex::ParticleReal const ptf = refpart.pt;
304
305 // advance position (x,y,z)
306 refpart.x = x + slice_ds*px/bgi;
307 refpart.y = y + slice_ds*py/bgi;
308 refpart.z = z + slice_ds*pz/bgi;
309
310 // compute final value of beta*gamma
311 amrex::ParticleReal const bgf = std::sqrt(powi<2>(ptf) - 1.0_prt);
312
313 // advance momentum (px,py,pz)
314 refpart.px = px*bgf/bgi;
315 refpart.py = py*bgf/bgi;
316 refpart.pz = pz*bgf/bgi;
317
318 // convert linear map from dynamic to static units
319 amrex::ParticleReal scale_in = 1.0_prt;
320 amrex::ParticleReal scale_fin = 1.0_prt;
321
322 for (int i=1; i<7; i++) {
323 for (int j=1; j<7; j++) {
324 if( i % 2 == 0)
325 scale_fin = bgf;
326 else
327 scale_fin = 1.0_prt;
328 if( j % 2 == 0)
329 scale_in = bgi;
330 else
331 scale_in = 1.0_prt;
332 refpart.map(i, j) = refpart.map(i, j) * scale_in / scale_fin;
333 }
334 }
335
336 // advance integrated path length
337 refpart.s = s + slice_ds;
338 }
339
341 using LinearTransport::operator();
342
348 Map6x6
349 transport_map ([[maybe_unused]] RefPart const & AMREX_RESTRICT refpart) const
350 {
351
353 R = refpart.map;
354
355 return R;
356 }
357
364 std::tuple<amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal>
366 RF_Efield (amrex::ParticleReal const zeval) const
367 {
368 using namespace amrex::literals; // for _rt and _prt
369 using amrex::Math::powi;
370
371 // pick the right data depending if we are on the host side
372 // (reference particle push) or device side (particles):
373#if AMREX_DEVICE_COMPILE
374 amrex::ParticleReal* cos_data = m_cos_d_data;
375 amrex::ParticleReal* sin_data = m_sin_d_data;
376#else
377 amrex::ParticleReal* cos_data = m_cos_h_data;
378 amrex::ParticleReal* sin_data = m_sin_h_data;
379#endif
380
381 // specify constants
383 amrex::ParticleReal const zlen = m_ds;
384 amrex::ParticleReal const zmid = zlen * 0.5_prt;
385
386 // compute on-axis electric field (z is relative to cavity midpoint)
387 amrex::ParticleReal efield = 0.0;
388 amrex::ParticleReal efieldp = 0.0;
389 amrex::ParticleReal efieldpp = 0.0;
390 amrex::ParticleReal efieldint = 0.0;
391 amrex::ParticleReal const z = zeval - zmid;
392
393 if (std::abs(z) <= zmid)
394 {
395 efield = 0.5_prt*cos_data[0];
396 efieldint = z*efield;
397 for (int j=1; j < m_ncoef; ++j)
398 {
399 efield = efield + cos_data[j] * std::cos(j*2*pi*z/zlen) +
400 sin_data[j] * std::sin(j*2*pi*z/zlen);
401 efieldp = efieldp-j*2*pi*cos_data[j] * std::sin(j*2*pi*z/zlen)/zlen +
402 j*2*pi*sin_data[j] * std::cos(j*2*pi*z/zlen)/zlen;
403 efieldpp = efieldpp- powi<2>(j*2*pi*cos_data[j]/zlen) * std::cos(j*2*pi*z/zlen) -
404 powi<2>(j*2*pi*sin_data[j]/zlen) * std::sin(j*2*pi*z/zlen);
405 efieldint = efieldint + zlen*cos_data[j] * std::sin(j*2*pi*z/zlen)/(j*2*pi) -
406 zlen*sin_data[j] * std::cos(j*2*pi*z/zlen)/(j*2*pi);
407 }
408 }
409 else // endpoint of the RF, outsize zlen
410 {
411 efieldint = std::copysign(z, z)*zmid*0.5_prt*cos_data[0];;
412 for (int j=1; j < m_ncoef; ++j)
413 {
414 efieldint = efieldint - zlen*sin_data[j] * std::cos(j*pi)/(j*2*pi);
415 }
416 }
417 return std::make_tuple(efield, efieldp, efieldint);
418 }
419
429 void map3 (amrex::ParticleReal const tau,
430 RefPart & refpart,
431 [[maybe_unused]] amrex::ParticleReal & zeval) const
432 {
433 using namespace amrex::literals; // for _rt and _prt
434 using amrex::Math::powi;
435
436 // push the reference particle
437 amrex::ParticleReal const t = refpart.t;
438 amrex::ParticleReal const pt = refpart.pt;
439
440 if (pt < -1.0_prt) {
441 refpart.t = t + tau/std::sqrt(1.0_prt - powi<-2>(pt));
442 refpart.pt = pt;
443 }
444 else {
445 refpart.t = t;
446 refpart.pt = pt;
447 }
448
449 // push the linear map equations
451 amrex::ParticleReal const betgam = refpart.beta_gamma();
452
453 refpart.map(5,5) = R(5,5) + tau*R(6,5)/powi<3>(betgam);
454 refpart.map(5,6) = R(5,6) + tau*R(6,6)/powi<3>(betgam);
455 }
456
466 void map2 (amrex::ParticleReal const tau,
467 RefPart & refpart,
468 amrex::ParticleReal & zeval) const
469 {
470 using namespace amrex::literals; // for _rt and _prt
471 using amrex::Math::powi;
472
473 amrex::ParticleReal const t = refpart.t;
474 amrex::ParticleReal const pt = refpart.pt;
475
476 // Define parameters and intermediate constants
479 amrex::ParticleReal const k = (2_prt*pi/c)*m_freq;
480 amrex::ParticleReal const phi = m_phase*(pi/180_prt);
481 amrex::ParticleReal const E0 = m_escale;
482
483 // push the reference particle
484 auto [ez, ezp, ezint] = RF_Efield(zeval);
485 amrex::ignore_unused(ez, ezint);
486
487 refpart.t = t;
488 refpart.pt = pt;
489
490 // push the linear map equations
492 amrex::ParticleReal const s = tau/refpart.beta_gamma();
493 amrex::ParticleReal const L = E0*ezp * std::sin(k*t+phi)/(2_prt*k);
494
495 refpart.map(1,1) = (1_prt-s*L)*R(1,1) + s*R(2,1);
496 refpart.map(1,2) = (1_prt-s*L)*R(1,2) + s*R(2,2);
497 refpart.map(2,1) = -s * powi<2>(L)*R(1,1) + (1_prt+s*L)*R(2,1);
498 refpart.map(2,2) = -s * powi<2>(L)*R(1,2) + (1_prt+s*L)*R(2,2);
499
500 refpart.map(3,3) = (1_prt-s*L)*R(3,3) + s*R(4,3);
501 refpart.map(3,4) = (1_prt-s*L)*R(3,4) + s*R(4,4);
502 refpart.map(4,3) = -s * powi<2>(L)*R(3,3) + (1_prt+s*L)*R(4,3);
503 refpart.map(4,4) = -s * powi<2>(L)*R(3,4) + (1_prt+s*L)*R(4,4);
504 }
505
515 void map1 (amrex::ParticleReal const tau,
516 RefPart & refpart,
517 amrex::ParticleReal & zeval) const
518 {
519 using namespace amrex::literals; // for _rt and _prt
520
521 amrex::ParticleReal const t = refpart.t;
522 amrex::ParticleReal const pt = refpart.pt;
523 amrex::ParticleReal const z = zeval;
524
525 // Define parameters and intermediate constants
528 amrex::ParticleReal const k = (2_prt*pi/c)*m_freq;
529 amrex::ParticleReal const phi = m_phase*(pi/180_prt);
530 amrex::ParticleReal const E0 = m_escale;
531
532 // push the reference particle
533 auto [ez, ezp, ezint] = RF_Efield(z);
535 zeval = z + tau;
536 auto [ezf, ezpf, ezintf] = RF_Efield(zeval);
538
539 refpart.t = t;
540 refpart.pt = pt - E0*(ezintf-ezint) * std::cos(k*t+phi);
541
542 // push the linear map equations
544 amrex::ParticleReal const M = E0*(ezintf-ezint)*k * std::sin(k*t+phi);
545 amrex::ParticleReal const L = E0*(ezpf-ezp) * std::sin(k*t+phi)/(2_prt*k)+M*0.5_prt;
546
547 refpart.map(2,1) = L*R(1,1) + R(2,1);
548 refpart.map(2,2) = L*R(1,2) + R(2,2);
549
550 refpart.map(4,3) = L*R(3,3) + R(4,3);
551 refpart.map(4,4) = L*R(3,4) + R(4,4);
552
553 refpart.map(6,5) = M*R(5,5) + R(6,5);
554 refpart.map(6,6) = M*R(5,6) + R(6,6);
555 }
556
559 void
561 {
562 // remove from unique data map
563 if (RFCavityData::h_cos_coef.count(m_id) != 0u)
565 if (RFCavityData::h_sin_coef.count(m_id) != 0u)
567
568 if (RFCavityData::d_cos_coef.count(m_id) != 0u)
570 if (RFCavityData::d_sin_coef.count(m_id) != 0u)
572 }
573
574 amrex::ParticleReal m_escale;
575 amrex::ParticleReal m_freq;
576 amrex::ParticleReal m_phase;
578 int m_id;
579
580 int m_ncoef = 0;
581 amrex::ParticleReal* m_cos_h_data = nullptr;
582 amrex::ParticleReal* m_sin_h_data = nullptr;
583 amrex::ParticleReal* m_cos_d_data = nullptr;
584 amrex::ParticleReal* m_sin_d_data = nullptr;
585 };
586
587} // namespace impactx
588
589#endif // IMPACTX_RFCAVITY_H
#define AMREX_FORCE_INLINE
#define AMREX_RESTRICT
#define AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST
static constexpr auto c
static constexpr amrex::Real pi
void copyAsync(HostToDevice, InIter begin, InIter end, OutIter result) noexcept
static constexpr HostToDevice hostToDevice
void streamSynchronize() noexcept
PODVector< T, ArenaAllocator< T > > DeviceVector
constexpr T powi(T x) noexcept
__host__ __device__ void ignore_unused(const Ts &...)
SmallMatrix< T, N, 1, Order::F, StartIndex > SmallVector
Definition RFCavity.H:92
std::map< int, amrex::Gpu::DeviceVector< amrex::ParticleReal > > d_cos_coef
device: cosine coefficients in Fourier expansion of on-axis electric field Ez
Definition RFCavity.H:102
std::map< int, amrex::Gpu::DeviceVector< amrex::ParticleReal > > d_sin_coef
device: sine coefficients in Fourier expansion of on-axis electric field Ez
Definition RFCavity.H:104
std::map< int, std::vector< amrex::ParticleReal > > h_cos_coef
host: cosine coefficients in Fourier expansion of on-axis electric field Ez
Definition RFCavity.H:97
int next_id
last used id for a created RF cavity
Definition RFCavity.H:94
std::map< int, std::vector< amrex::ParticleReal > > h_sin_coef
host: sine coefficients in Fourier expansion of on-axis electric field Ez
Definition RFCavity.H:99
Definition All.H:54
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void symp2_integrate_split3(RefPart &refpart, amrex::ParticleReal const zin, amrex::ParticleReal const zout, int const nsteps, T_Element const &element)
Definition Integrators.H:79
@ s
fixed s as the independent variable
Definition ImpactXParticleContainer.H:37
@ t
fixed t as the independent variable
Definition ImpactXParticleContainer.H:38
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > Map6x6
Definition CovarianceMatrix.H:20
static constexpr __host__ __device__ SmallMatrix< T, NRows, NCols, ORDER, StartIndex > Identity() noexcept
Definition ReferenceParticle.H:31
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal beta_gamma() const
Definition ReferenceParticle.H:110
amrex::ParticleReal pt
energy, normalized by rest energy
Definition ReferenceParticle.H:40
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > map
linearized map
Definition ReferenceParticle.H:45
amrex::ParticleReal t
clock time * c in meters
Definition ReferenceParticle.H:36
Definition RFCavity.H:49
amrex::Vector< amrex::ParticleReal > default_sin_coef
Definition RFCavity.H:78
amrex::Vector< amrex::ParticleReal > default_cos_coef
Definition RFCavity.H:50
amrex::ParticleReal * m_cos_d_data
non-owning pointer to host sine coefficients
Definition RFCavity.H:583
void compute_constants(RefPart const &refpart)
Definition RFCavity.H:200
std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RF_Efield(amrex::ParticleReal const zeval) const
Definition RFCavity.H:366
int m_ncoef
unique RF cavity id used for data lookup map
Definition RFCavity.H:580
static constexpr auto type
Definition RFCavity.H:117
RFCavity(amrex::ParticleReal ds, amrex::ParticleReal escale, amrex::ParticleReal freq, amrex::ParticleReal phase, std::vector< amrex::ParticleReal > cos_coef, std::vector< amrex::ParticleReal > sin_coef, amrex::ParticleReal dx=0, amrex::ParticleReal dy=0, amrex::ParticleReal rotation_degree=0, amrex::ParticleReal aperture_x=0, amrex::ParticleReal aperture_y=0, int mapsteps=1, int nslice=1, std::optional< std::string > name=std::nullopt)
Definition RFCavity.H:138
int m_id
number of map integration steps per slice
Definition RFCavity.H:578
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map1(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition RFCavity.H:515
amrex::ParticleReal m_escale
Definition RFCavity.H:574
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map3(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition RFCavity.H:429
amrex::ParticleReal m_freq
scaling factor for RF electric field
Definition RFCavity.H:575
amrex::ParticleReal * m_sin_h_data
non-owning pointer to host cosine coefficients
Definition RFCavity.H:582
int m_mapsteps
RF driven phase in deg.
Definition RFCavity.H:577
amrex::ParticleReal * m_cos_h_data
number of Fourier coefficients
Definition RFCavity.H:581
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map2(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition RFCavity.H:466
void finalize()
Definition RFCavity.H:560
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition RFCavity.H:349
amrex::ParticleReal * m_sin_d_data
non-owning pointer to device cosine coefficients
Definition RFCavity.H:584
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_Real &AMREX_RESTRICT t, T_Real &AMREX_RESTRICT px, T_Real &AMREX_RESTRICT py, T_Real &AMREX_RESTRICT pt, T_IdCpu &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition RFCavity.H:223
ImpactXParticleContainer::ParticleType PType
Definition RFCavity.H:118
amrex::ParticleReal m_phase
RF frequency in Hz.
Definition RFCavity.H:576
Definition alignment.H:27
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void shift_out(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_Real &AMREX_RESTRICT px, T_Real &AMREX_RESTRICT py) const
Definition alignment.H:109
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy() const
Definition alignment.H:146
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx() const
Definition alignment.H:136
Alignment(amrex::ParticleReal dx, amrex::ParticleReal dy, amrex::ParticleReal rotation_degree)
Definition alignment.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void shift_in(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_Real &AMREX_RESTRICT px, T_Real &AMREX_RESTRICT py) const
Definition alignment.H:78
Definition beamoptic.H:219
Definition lineartransport.H:29
Definition named.H:29
AMREX_GPU_HOST Named(std::optional< std::string > name)
Definition named.H:57
AMREX_FORCE_INLINE std::string name() const
Definition named.H:122
Definition pipeaperture.H:26
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void apply_aperture(T_Real &AMREX_RESTRICT x, T_Real &AMREX_RESTRICT y, T_IdCpu &AMREX_RESTRICT idcpu) const
Definition pipeaperture.H:59
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_x() const
Definition pipeaperture.H:90
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal aperture_y() const
Definition pipeaperture.H:101
PipeAperture(amrex::ParticleReal aperture_x, amrex::ParticleReal aperture_y)
Definition pipeaperture.H:32
Definition thick.H:24
Thick(amrex::ParticleReal ds, int nslice)
Definition thick.H:30
amrex::ParticleReal m_ds
Definition thick.H:58
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal ds() const
Definition thick.H:53
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int nslice() const
Definition thick.H:43