ImpactX
Loading...
Searching...
No Matches
RFCavity.H
Go to the documentation of this file.
1/* Copyright 2022-2026 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/beamoptic.H"
17#include "mixin/dynamicdata.H"
19#include "mixin/named.H"
20#include "mixin/nofinalize.H"
21#include "mixin/pipeaperture.H"
22#include "mixin/thick.H"
23#include "mixin/spintransport.H"
24#include "mixin/TrackedVector.H"
25
26#include <ablastr/constant.H>
27
28#include <AMReX.H>
29#include <AMReX_Extension.H>
30#include <AMReX_Math.H>
31#include <AMReX_REAL.H>
32#include <AMReX_SIMD.H>
33#include <AMReX_SmallMatrix.H>
34
35#include <cmath>
36#include <memory>
37#include <stdexcept>
38#include <tuple>
39#include <vector>
40
41
42namespace impactx::elements
43{
54 {
56 0.1644024074311037,
57 -0.1324009958969339,
58 4.3443060026047219e-002,
59 8.5602654094946495e-002,
60 -0.2433578169042885,
61 0.5297150596779437,
62 0.7164884680963959,
63 -5.2579522442877296e-003,
64 -5.5025369142193678e-002,
65 4.6845673335028933e-002,
66 -2.3279346335638568e-002,
67 4.0800777539657775e-003,
68 4.1378326533752169e-003,
69 -2.5040533340490805e-003,
70 -4.0654981400000964e-003,
71 9.6630592067498289e-003,
72 -8.5275895985990214e-003,
73 -5.8078747006425020e-002,
74 -2.4044337836660403e-002,
75 1.0968240064697212e-002,
76 -3.4461179858301418e-003,
77 -8.1201564869443749e-004,
78 2.1438992904959380e-003,
79 -1.4997753525697276e-003,
80 1.8685171825676386e-004
81 };
82
84 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
85 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
86 0, 0, 0
87 };
88 };
89
100
101 struct RFCavity
102 : public mixin::Named,
103 public mixin::BeamOptic<RFCavity>,
104 public mixin::LinearTransport<RFCavity>,
105 public mixin::Thick,
106 public mixin::Alignment,
107 public mixin::NoFinalize,
108 public mixin::PipeAperture,
110 public amrex::simd::Vectorized<amrex::simd::native_simd_size_particlereal>
111 {
112 static constexpr auto type = "RFCavity";
114
116
137 amrex::ParticleReal escale,
140 std::vector<amrex::ParticleReal> cos_coef,
141 std::vector<amrex::ParticleReal> sin_coef,
144 amrex::ParticleReal rotation_degree = 0,
147 int mapsteps = 10,
148 int nslice = 1,
149 std::optional<std::string> name = std::nullopt
150 )
151 : Named(std::move(name)),
152 Thick(ds, nslice),
153 Alignment(dx, dy, rotation_degree),
155 m_escale(escale), m_freq(freq), m_phase(phase), m_mapsteps(mapsteps),
156 m_id(DynamicData::allocate_id())
157 {
158 m_ncoef = int(cos_coef.size());
159 if (m_ncoef != int(sin_coef.size()))
160 throw std::runtime_error("RFCavity: cos and sin coefficients must have same length!");
161
162 auto& coef = DynamicData::emplace(
163 m_id,
164 std::move(cos_coef),
165 std::move(sin_coef)
166 );
167 m_cos_h_data = coef.cos.host_const().data();
168 m_sin_h_data = coef.sin.host_const().data();
169 }
170
172 void reverse () {
173 // Reversing ds traverses the Fourier profile in the opposite z direction,
174 // so the odd sine terms change sign implicitly via sin(-kz) = -sin(kz).
175 Thick::reverse();
176 }
177
179 using BeamOptic::operator();
180
188 void compute_constants (RefPart const & refpart)
189 {
190 using namespace amrex::literals; // for _rt and _prt
191
192 Alignment::compute_constants(refpart);
193
194 auto const & coef = *DynamicData::get(m_id);
195 m_cos_d_data = coef.cos.device_const().data();
196 m_sin_d_data = coef.sin.device_const().data();
197 }
198
213 template<typename T_Real=amrex::ParticleReal, typename T_IdCpu=uint64_t>
216 T_Real & AMREX_RESTRICT x,
217 T_Real & AMREX_RESTRICT y,
218 T_Real & AMREX_RESTRICT t,
219 T_Real & AMREX_RESTRICT px,
220 T_Real & AMREX_RESTRICT py,
221 T_Real & AMREX_RESTRICT pt,
222 T_IdCpu & AMREX_RESTRICT idcpu,
223 RefPart const & AMREX_RESTRICT refpart
224 ) const
225 {
226 using namespace amrex::literals; // for _rt and _prt
227
228 // shift due to alignment errors of the element
229 shift_in(x, y, px, py);
230
231 // get the linear map
233
234 // symplectic linear map for the RF cavity is computed using the
235 // Hamiltonian formalism as described in:
236 // https://uspas.fnal.gov/materials/09UNM/ComputationalMethods.pdf.
237 // R denotes the transfer matrix in the basis (x,px,y,py,t,pt),
238 // so that, e.g., R(3,4) = dyf/dpyi.
239 amrex::SmallVector<T_Real, 6, 1> const v{x, px, y, py, t, pt};
240
241 // push particles using the linear map
242 auto const out = R * v;
243
244 // assign updated values
245 x = out[1];
246 px = out[2];
247 y = out[3];
248 py = out[4];
249 t = out[5];
250 pt = out[6];
251
252 // apply transverse aperture
253 apply_aperture(x, y, idcpu);
254
255 // undo shift due to alignment errors of the element
256 shift_out(x, y, px, py);
257 }
258
264 void operator() (RefPart & AMREX_RESTRICT refpart) const
265 {
266 using namespace amrex::literals; // for _rt and _prt
267 using amrex::Math::powi;
268
269 // assign input reference particle values
270 amrex::ParticleReal const x = refpart.x;
271 amrex::ParticleReal const px = refpart.px;
272 amrex::ParticleReal const y = refpart.y;
273 amrex::ParticleReal const py = refpart.py;
274 amrex::ParticleReal const z = refpart.z;
275 amrex::ParticleReal const pz = refpart.pz;
276 amrex::ParticleReal const pt = refpart.pt;
277 amrex::ParticleReal const s = refpart.s;
278 amrex::ParticleReal const sedge = refpart.sedge;
279
280 // initialize linear map (deviation) values
281 refpart.map = decltype(refpart.map)::Identity();
282
283 // initialize the spin-orbit coupling matrix
284 refpart.spin_coupling = {};
285
286 // length of the current slice
287 amrex::ParticleReal const slice_ds = m_ds / nslice();
288
289 // compute initial value of beta*gamma
290 amrex::ParticleReal const bgi = std::sqrt(powi<2>(pt) - 1.0_prt);
291
292 // call integrator to advance (t,pt)
293 amrex::ParticleReal const zin = s - sedge;
294 amrex::ParticleReal const zout = zin + slice_ds;
295 int const nsteps = m_mapsteps;
296
297 integrators::symp2_integrate_split3(refpart,zin,zout,nsteps,*this);
298 amrex::ParticleReal const ptf = refpart.pt;
299
300 // advance position (x,y,z)
301 refpart.x = x + slice_ds*px/bgi;
302 refpart.y = y + slice_ds*py/bgi;
303 refpart.z = z + slice_ds*pz/bgi;
304
305 // compute final value of beta*gamma
306 amrex::ParticleReal const bgf = std::sqrt(powi<2>(ptf) - 1.0_prt);
307
308 // advance momentum (px,py,pz)
309 refpart.px = px*bgf/bgi;
310 refpart.py = py*bgf/bgi;
311 refpart.pz = pz*bgf/bgi;
312
313 // convert linear map from dynamic to static units
314 amrex::ParticleReal scale_in = 1.0_prt;
315 amrex::ParticleReal scale_fin = 1.0_prt;
316
317 for (int i=1; i<7; i++) {
318 for (int j=1; j<7; j++) {
319 if( i % 2 == 0)
320 scale_fin = bgf;
321 else
322 scale_fin = 1.0_prt;
323 if( j % 2 == 0)
324 scale_in = bgi;
325 else
326 scale_in = 1.0_prt;
327 refpart.map(i, j) = refpart.map(i, j) * scale_in / scale_fin;
328 }
329 }
330
331 // convert spin-orbit coupling map from dynamic to static units
332 for (int i=1; i<4; i++) {
333 for (int j=2; j<7; j+=2) {
334 refpart.spin_coupling(i, j) *= bgi;
335 }
336 }
337
338 // advance integrated path length
339 refpart.s = s + slice_ds;
340 }
341
342
357 template<typename T_Real=amrex::ParticleReal, typename T_IdCpu=uint64_t>
360 T_Real & AMREX_RESTRICT x,
361 T_Real & AMREX_RESTRICT y,
362 T_Real & AMREX_RESTRICT t,
363 T_Real & AMREX_RESTRICT px,
364 T_Real & AMREX_RESTRICT py,
365 T_Real & AMREX_RESTRICT pt,
366 T_Real & AMREX_RESTRICT sx,
367 T_Real & AMREX_RESTRICT sy,
368 T_Real & AMREX_RESTRICT sz,
369 T_IdCpu & AMREX_RESTRICT idcpu,
370 RefPart const & AMREX_RESTRICT refpart
371 ) const
372 {
373 using namespace amrex::literals; // for _rt and _prt
374
375 // initialize the three components of the axis-angle vector
376 T_Real lambdax = 0_prt;
377 T_Real lambday = 0_prt;
378 T_Real lambdaz = 0_prt;
379
380 // store the phase space variables in vector form
381 amrex::SmallVector<T_Real, 6, 1> const v{x, px, y, py, t, pt};
382
383 // get the spin-orbit coupling matrix
385
386 // use phase space variables to obtain the angle-axis generator of spin rotation
387 auto const out = A * v;
388
389 // update the angle-axis generator
390 lambdax = out[1];
391 lambday = out[2];
392 lambdaz = out[3];
393
394 // push the spin vector using the generator just determined
395 rotate_spin(lambdax,lambday,lambdaz,sx,sy,sz);
396
397 // phase space push
398 (*this)(x, y, t, px, py, pt, idcpu, refpart);
399 }
400
401
403 using LinearTransport::operator();
404
410 Map6x6
411 transport_map ([[maybe_unused]] RefPart const & AMREX_RESTRICT refpart) const
412 {
413
415 R = refpart.map;
416
417 return R;
418 }
419
426 std::tuple<amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal>
428 RF_Efield (amrex::ParticleReal const zeval) const
429 {
430 using namespace amrex::literals; // for _rt and _prt
431 using amrex::Math::powi;
432
433 // pick the right data depending if we are on the host side
434 // (reference particle push) or device side (particles):
435#if AMREX_DEVICE_COMPILE
436 amrex::ParticleReal const * cos_data = m_cos_d_data;
437 amrex::ParticleReal const * sin_data = m_sin_d_data;
438#else
439 amrex::ParticleReal const * cos_data = m_cos_h_data;
440 amrex::ParticleReal const * sin_data = m_sin_h_data;
441#endif
442
443 // specify constants
445 amrex::ParticleReal const zlen = std::abs(m_ds);
446 amrex::ParticleReal const zmid = zlen * 0.5_prt;
447
448 // compute on-axis electric field (z is relative to cavity midpoint)
449 amrex::ParticleReal efield = 0.0;
450 amrex::ParticleReal efieldp = 0.0;
451 amrex::ParticleReal efieldpp = 0.0;
452 amrex::ParticleReal efieldint = 0.0;
453 amrex::ParticleReal const z = zeval - zmid;
454
455 if (std::abs(z) <= zmid)
456 {
457 efield = 0.5_prt*cos_data[0];
458 efieldint = z*efield;
459 for (int j=1; j < m_ncoef; ++j)
460 {
461 efield = efield + cos_data[j] * std::cos(j*2*pi*z/zlen) +
462 sin_data[j] * std::sin(j*2*pi*z/zlen);
463 efieldp = efieldp-j*2*pi*cos_data[j] * std::sin(j*2*pi*z/zlen)/zlen +
464 j*2*pi*sin_data[j] * std::cos(j*2*pi*z/zlen)/zlen;
465 efieldpp = efieldpp- powi<2>(j*2*pi*cos_data[j]/zlen) * std::cos(j*2*pi*z/zlen) -
466 powi<2>(j*2*pi*sin_data[j]/zlen) * std::sin(j*2*pi*z/zlen);
467 efieldint = efieldint + zlen*cos_data[j] * std::sin(j*2*pi*z/zlen)/(j*2*pi) -
468 zlen*sin_data[j] * std::cos(j*2*pi*z/zlen)/(j*2*pi);
469 }
470 }
471 else // endpoint of the RF, outsize zlen
472 {
473 efieldint = std::copysign(zmid, z)*0.5_prt*cos_data[0];
474 for (int j=1; j < m_ncoef; ++j)
475 {
476 efieldint = efieldint - zlen*sin_data[j] * std::cos(j*pi)/(j*2*pi);
477 }
478 }
479 return std::make_tuple(efield, efieldp, efieldint);
480 }
481
491 void map3 (amrex::ParticleReal const tau,
492 RefPart & refpart,
493 [[maybe_unused]] amrex::ParticleReal & zeval) const
494 {
495 using namespace amrex::literals; // for _rt and _prt
496 using amrex::Math::powi;
497
498 // push the reference particle
499 amrex::ParticleReal const t = refpart.t;
500 amrex::ParticleReal const pt = refpart.pt;
501
502 if (pt < -1.0_prt) {
503 refpart.t = t + tau/std::sqrt(1.0_prt - powi<-2>(pt));
504 refpart.pt = pt;
505 }
506 else {
507 refpart.t = t;
508 refpart.pt = pt;
509 }
510
511 // push the linear map equations
515 amrex::ParticleReal const betgam = refpart.beta_gamma();
516
517 refpart.map(5,5) = R(5,5) + tau*R(6,5)/powi<3>(betgam);
518 refpart.map(5,6) = R(5,6) + tau*R(6,6)/powi<3>(betgam);
519
520 // BELOW: if spin is needed only:
521 // Define parameters and intermediate constants
524 amrex::ParticleReal const k = (2_prt*pi/c)*m_freq;
525 amrex::ParticleReal const phi = m_phase*(pi/180_prt);
526 amrex::ParticleReal const E0 = m_escale;
527 auto [ez, ezp, ezint] = RF_Efield(zeval);
529
530 // Update spin-orbit coupling matrix here
532 amrex::ParticleReal cos_term = std::cos(k*t+phi);
533 amrex::ParticleReal sin_term = std::sin(k*t+phi);
534 dA(1,3) = E0 * tau / 2_prt * (k * ez * (G*pt - 1_prt) * sin_term / std::sqrt(1_prt + powi<2>(pt)) + cos_term * (G + 1_prt/(1_prt - pt)) * ezp);
535 dA(1,4) = E0 * tau / std::sqrt(1_prt + powi<2>(pt)) * cos_term * (G + 1_prt/(1_prt - pt));
536 dA(2,1) = -dA(1,3);
537 dA(2,2) = -dA(1,4);
538
539 // update the spin-orbit coupling matrix here
540 refpart.spin_coupling = A + dA*R;
541 }
542
552 void map2 (amrex::ParticleReal const tau,
553 RefPart & refpart,
554 amrex::ParticleReal & zeval) const
555 {
556 using namespace amrex::literals; // for _rt and _prt
557 using amrex::Math::powi;
558
559 amrex::ParticleReal const t = refpart.t;
560 amrex::ParticleReal const pt = refpart.pt;
561
562 // Define parameters and intermediate constants
565 amrex::ParticleReal const k = (2_prt*pi/c)*m_freq;
566 amrex::ParticleReal const phi = m_phase*(pi/180_prt);
567 amrex::ParticleReal const E0 = m_escale;
568
569 // push the reference particle
570 auto [ez, ezp, ezint] = RF_Efield(zeval);
571 amrex::ignore_unused(ez, ezint);
572
573 refpart.t = t;
574 refpart.pt = pt;
575
576 // push the linear map equations
578 amrex::ParticleReal const s = tau/refpart.beta_gamma();
579 amrex::ParticleReal const L = E0*ezp * std::sin(k*t+phi)/(2_prt*k);
580
581 refpart.map(1,1) = (1_prt-s*L)*R(1,1) + s*R(2,1);
582 refpart.map(1,2) = (1_prt-s*L)*R(1,2) + s*R(2,2);
583 refpart.map(2,1) = -s * powi<2>(L)*R(1,1) + (1_prt+s*L)*R(2,1);
584 refpart.map(2,2) = -s * powi<2>(L)*R(1,2) + (1_prt+s*L)*R(2,2);
585
586 refpart.map(3,3) = (1_prt-s*L)*R(3,3) + s*R(4,3);
587 refpart.map(3,4) = (1_prt-s*L)*R(3,4) + s*R(4,4);
588 refpart.map(4,3) = -s * powi<2>(L)*R(3,3) + (1_prt+s*L)*R(4,3);
589 refpart.map(4,4) = -s * powi<2>(L)*R(3,4) + (1_prt+s*L)*R(4,4);
590
591 }
592
602 void map1 (amrex::ParticleReal const tau,
603 RefPart & refpart,
604 amrex::ParticleReal & zeval) const
605 {
606 using namespace amrex::literals; // for _rt and _prt
607
608 amrex::ParticleReal const t = refpart.t;
609 amrex::ParticleReal const pt = refpart.pt;
610 amrex::ParticleReal const z = zeval;
611
612 // Define parameters and intermediate constants
615 amrex::ParticleReal const k = (2_prt*pi/c)*m_freq;
616 amrex::ParticleReal const phi = m_phase*(pi/180_prt);
617 amrex::ParticleReal const E0 = m_escale;
618
619 // push the reference particle
620 auto [ez, ezp, ezint] = RF_Efield(z);
622 zeval = z + tau;
623 auto [ezf, ezpf, ezintf] = RF_Efield(zeval);
625
626 refpart.t = t;
627 refpart.pt = pt - E0*(ezintf-ezint) * std::cos(k*t+phi);
628
629 // push the linear map equations
631 amrex::ParticleReal const M = E0*(ezintf-ezint)*k * std::sin(k*t+phi);
632 amrex::ParticleReal const L = E0*(ezpf-ezp) * std::sin(k*t+phi)/(2_prt*k)+M*0.5_prt;
633
634 refpart.map(2,1) = L*R(1,1) + R(2,1);
635 refpart.map(2,2) = L*R(1,2) + R(2,2);
636
637 refpart.map(4,3) = L*R(3,3) + R(4,3);
638 refpart.map(4,4) = L*R(3,4) + R(4,4);
639
640 refpart.map(6,5) = M*R(5,5) + R(6,5);
641 refpart.map(6,6) = M*R(5,6) + R(6,6);
642
643 }
644
649 int m_id;
650
651 int m_ncoef = 0;
656 };
657
658} // namespace impactx
659
662
663#endif // IMPACTX_RFCAVITY_H
#define AMREX_FORCE_INLINE
#define AMREX_RESTRICT
#define AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST
#define IMPACTX_PUSH_EXTERN_TEMPLATE(ElementType)
Definition PushAll.H:78
#define IMPACTX_GPUDATA_EXTERN(ElementType)
Definition dynamicdata.H:169
amrex_particle_real ParticleReal
constexpr auto c
constexpr T powi(T x) noexcept
__host__ __device__ void ignore_unused(const Ts &...)
SmallMatrix< T, N, 1, Order::F, StartIndex > SmallVector
Definition All.H:56
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:33
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal beta_gamma() const
Definition ReferenceParticle.H:168
amrex::ParticleReal pt
energy, normalized by rest energy
Definition ReferenceParticle.H:42
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > map
linearized map
Definition ReferenceParticle.H:48
amrex::SmallMatrix< amrex::ParticleReal, 3, 6, amrex::Order::F, 1 > spin_coupling
linearized spin-orbit coupling matrix
Definition ReferenceParticle.H:49
amrex::ParticleReal gyromagnetic_anomaly
anomalous magnetic moment [unitless]
Definition ReferenceParticle.H:45
amrex::ParticleReal t
clock time * c in meters
Definition ReferenceParticle.H:38
mixin::TrackedVector< amrex::ParticleReal > sin
Definition RFCavity.H:98
mixin::TrackedVector< amrex::ParticleReal > cos
Definition RFCavity.H:97
Definition RFCavity.H:54
amrex::Vector< amrex::ParticleReal > default_sin_coef
Definition RFCavity.H:83
amrex::Vector< amrex::ParticleReal > default_cos_coef
Definition RFCavity.H:55
Definition RFCavity.H:111
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void spin_and_phasespace_push(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_Real &AMREX_RESTRICT sx, T_Real &AMREX_RESTRICT sy, T_Real &AMREX_RESTRICT sz, T_IdCpu &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition RFCavity.H:359
void compute_constants(RefPart const &refpart)
Definition RFCavity.H:188
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:428
int m_ncoef
unique RF cavity id used for data lookup map
Definition RFCavity.H:651
static constexpr auto type
Definition RFCavity.H:112
int m_id
number of map integration steps per slice
Definition RFCavity.H:649
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map1(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition RFCavity.H:602
amrex::ParticleReal m_escale
Definition RFCavity.H:645
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map3(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition RFCavity.H:491
mixin::GPUDataRegistry< CavityFourierCoefficients > DynamicData
Definition RFCavity.H:115
void reverse()
Definition RFCavity.H:172
amrex::ParticleReal const * m_cos_h_data
number of Fourier coefficients
Definition RFCavity.H:652
amrex::ParticleReal m_freq
scaling factor for RF electric field
Definition RFCavity.H:646
int m_mapsteps
RF driven phase in deg.
Definition RFCavity.H:648
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map2(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition RFCavity.H:552
amrex::ParticleReal const * m_cos_d_data
non-owning pointer to host sine coefficients
Definition RFCavity.H:654
amrex::ParticleReal const * m_sin_d_data
non-owning pointer to device cosine coefficients
Definition RFCavity.H:655
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=10, int nslice=1, std::optional< std::string > name=std::nullopt)
Definition RFCavity.H:135
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition RFCavity.H:411
amrex::ParticleReal const * m_sin_h_data
non-owning pointer to host cosine coefficients
Definition RFCavity.H:653
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:215
ImpactXParticleContainer::ParticleType PType
Definition RFCavity.H:113
amrex::ParticleReal m_phase
RF frequency in Hz.
Definition RFCavity.H:647
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:436
static std::shared_ptr< CavityFourierCoefficients > const & get(int id)
Definition dynamicdata.H:98
static CavityFourierCoefficients & emplace(int id, Args &&... args)
Definition dynamicdata.H:125
Definition lineartransport.H:50
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 nofinalize.H:22
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 spintransport.H:36
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void rotate_spin(T_Real const &AMREX_RESTRICT lambdax, T_Real const &AMREX_RESTRICT lambday, T_Real const &AMREX_RESTRICT lambdaz, T_Real &AMREX_RESTRICT sx, T_Real &AMREX_RESTRICT sy, T_Real &AMREX_RESTRICT sz) const
Definition spintransport.H:48
Definition thick.H:24
Thick(amrex::ParticleReal ds, int nslice)
Definition thick.H:30
amrex::ParticleReal m_ds
Definition thick.H:68
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
Definition TrackedVector.H:49