ImpactX
Loading...
Searching...
No Matches
SoftSol.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_SOFTSOL_H
11#define IMPACTX_SOFTSOL_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/TrackedVector.H"
24
25#include <ablastr/constant.H>
26
27#include <AMReX.H>
28#include <AMReX_Extension.H>
29#include <AMReX_Math.H>
30#include <AMReX_REAL.H>
31#include <AMReX_SIMD.H>
32#include <AMReX_SmallMatrix.H>
33
34#include <cmath>
35#include <memory>
36#include <stdexcept>
37#include <tuple>
38#include <vector>
39
40
41namespace impactx::elements
42{
56 {
58 0.350807812299706,
59 0.323554693720069,
60 0.260320578919415,
61 0.182848575294969,
62 0.106921016050403,
63 4.409581845710694E-002,
64 -9.416427163897508E-006,
65 -2.459452716865687E-002,
66 -3.272762575737291E-002,
67 -2.936414401076162E-002,
68 -1.995780078926890E-002,
69 -9.102893342953847E-003,
70 -2.456410658713271E-006,
71 5.788233017324325E-003,
72 8.040408292420691E-003,
73 7.480064552867431E-003,
74 5.230254569468851E-003,
75 2.447614547094685E-003,
76 -1.095525090532255E-006,
77 -1.614586867387170E-003,
78 -2.281365457438345E-003,
79 -2.148709081338292E-003,
80 -1.522541739363011E-003,
81 -7.185505862719508E-004,
82 -6.171194824600157E-007,
83 4.842109305036943E-004,
84 6.874508102002901E-004,
85 6.535550288205728E-004,
86 4.648795813759210E-004,
87 2.216564722797528E-004,
88 -4.100982995210341E-007,
89 -1.499332112463395E-004,
90 -2.151538438342482E-004,
91 -2.044590946652016E-004,
92 -1.468242784844341E-004
93 };
94
96 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
97 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
98 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
99 0, 0, 0, 0, 0
100 };
101 };
102
113
115 : public mixin::Named,
116 public mixin::BeamOptic<SoftSolenoid>,
117 public mixin::LinearTransport<SoftSolenoid>,
118 public mixin::Thick,
119 public mixin::Alignment,
120 public mixin::NoFinalize,
121 public mixin::PipeAperture,
123 public amrex::simd::Vectorized<amrex::simd::native_simd_size_particlereal>
124 {
125 static constexpr auto type = "SoftSolenoid";
127
129
153 amrex::ParticleReal bscale,
154 std::vector<amrex::ParticleReal> cos_coef,
155 std::vector<amrex::ParticleReal> sin_coef,
156 int unit,
159 amrex::ParticleReal rotation_degree = 0,
162 int mapsteps = 10,
163 int nslice = 1,
164 std::optional<std::string> name = std::nullopt
165 )
166 : Named(std::move(name)),
167 Thick(ds, nslice),
168 Alignment(dx, dy, rotation_degree),
170 m_bscale(bscale), m_unit(unit), m_mapsteps(mapsteps),
171 m_id(DynamicData::allocate_id())
172 {
173 m_ncoef = int(cos_coef.size());
174 if (m_ncoef != int(sin_coef.size()))
175 throw std::runtime_error("SoftSolenoid: cos and sin coefficients must have same length!");
176
177 auto& coef = DynamicData::emplace(
178 m_id,
179 std::move(cos_coef),
180 std::move(sin_coef)
181 );
182 m_cos_h_data = coef.cos.host_const().data();
183 m_sin_h_data = coef.sin.host_const().data();
184 }
185
187 void reverse () {
188 // Reversing ds traverses the Fourier profile in the opposite z direction,
189 // so the odd sine terms change sign implicitly via sin(-kz) = -sin(kz).
190 Thick::reverse();
191 }
192
194 using BeamOptic::operator();
195
203 void compute_constants (RefPart const & refpart)
204 {
205 using namespace amrex::literals; // for _rt and _prt
206
207 Alignment::compute_constants(refpart);
208
209 // Ensure dynamic coefficient data is on GPU and we have fresh pointers to it
210 auto const & coef = *DynamicData::get(m_id);
211 m_cos_d_data = coef.cos.device_const().data();
212 m_sin_d_data = coef.sin.device_const().data();
213 }
214
229 template<typename T_Real=amrex::ParticleReal, typename T_IdCpu=uint64_t>
232 T_Real & AMREX_RESTRICT x,
233 T_Real & AMREX_RESTRICT y,
234 T_Real & AMREX_RESTRICT t,
235 T_Real & AMREX_RESTRICT px,
236 T_Real & AMREX_RESTRICT py,
237 T_Real & AMREX_RESTRICT pt,
238 [[maybe_unused]] T_IdCpu const & AMREX_RESTRICT idcpu,
239 [[maybe_unused]] RefPart const & AMREX_RESTRICT refpart
240 ) const
241 {
242 using namespace amrex::literals; // for _rt and _prt
243
244 // get the linear map
246
247 // symplectic linear map for a solenoid is computed using the
248 // Hamiltonian formalism as described in:
249 // https://uspas.fnal.gov/materials/09UNM/ComputationalMethods.pdf.
250 // R denotes the transfer matrix in the basis (x,px,y,py,t,pt),
251 // so that, e.g., R(3,4) = dyf/dpyi.
252 amrex::SmallVector<T_Real, 6, 1> const v{x, px, y, py, t, pt};
253
254 // push particles using the linear map
255 auto const out = R * v;
256
257 // assign updated values
258 x = out[1];
259 px = out[2];
260 y = out[3];
261 py = out[4];
262 t = out[5];
263 pt = out[6];
264 }
265
271 void operator() (RefPart & AMREX_RESTRICT refpart) const
272 {
273 using namespace amrex::literals; // for _rt and _prt
274 using amrex::Math::powi;
275
276 // assign input reference particle values
277 amrex::ParticleReal const x = refpart.x;
278 amrex::ParticleReal const px = refpart.px;
279 amrex::ParticleReal const y = refpart.y;
280 amrex::ParticleReal const py = refpart.py;
281 amrex::ParticleReal const z = refpart.z;
282 amrex::ParticleReal const pz = refpart.pz;
283 amrex::ParticleReal const pt = refpart.pt;
284 amrex::ParticleReal const s = refpart.s;
285 amrex::ParticleReal const sedge = refpart.sedge;
286
287 // initialize linear map (deviation) values
288 m_map = decltype(m_map)::Identity();
289
290 // initialize the spin-orbit coupling matrix and the spin rotation vector
292 m_spin_coupling = {};
293
294 // length of the current slice
295 amrex::ParticleReal const slice_ds = m_ds / nslice();
296
297 // compute initial value of beta*gamma
298 amrex::ParticleReal const bgi = std::sqrt(powi<2>(pt) - 1.0_prt);
299
300 // call integrator to advance (t,pt)
301 amrex::ParticleReal const zin = s - sedge;
302 amrex::ParticleReal const zout = zin + slice_ds;
303 int const nsteps = m_mapsteps;
304
305 integrators::symp2_integrate_split3(refpart,zin,zout,nsteps,*this);
306 amrex::ParticleReal const ptf = refpart.pt;
307
308 /* print computed linear map:
309 for(int i=1; i<7; ++i){
310 for(int j=1; j<7; ++j){
311 amrex::PrintToFile("SolMap.txt") << i << " " <<
312 j << " " << m_map(i,j) << "\n";
313 }
314 }
315 */
316
317 // advance position (x,y,z)
318 refpart.x = x + slice_ds*px/bgi;
319 refpart.y = y + slice_ds*py/bgi;
320 refpart.z = z + slice_ds*pz/bgi;
321
322 // compute final value of beta*gamma
323 amrex::ParticleReal const bgf = std::sqrt(powi<2>(ptf) - 1.0_prt);
324
325 // advance momentum (px,py,pz)
326 refpart.px = px*bgf/bgi;
327 refpart.py = py*bgf/bgi;
328 refpart.pz = pz*bgf/bgi;
329
330 // advance integrated path length
331 refpart.s = s + slice_ds;
332 }
333
334
349 template<typename T_Real=amrex::ParticleReal, typename T_IdCpu=uint64_t>
352 T_Real & AMREX_RESTRICT x,
353 T_Real & AMREX_RESTRICT y,
354 T_Real & AMREX_RESTRICT t,
355 T_Real & AMREX_RESTRICT px,
356 T_Real & AMREX_RESTRICT py,
357 T_Real & AMREX_RESTRICT pt,
358 T_Real & AMREX_RESTRICT sx,
359 T_Real & AMREX_RESTRICT sy,
360 T_Real & AMREX_RESTRICT sz,
361 T_IdCpu const & AMREX_RESTRICT idcpu,
362 RefPart const & AMREX_RESTRICT refpart
363 ) const
364 {
365 using namespace amrex::literals; // for _rt and _prt
366
367 // initialize the three components of the axis-angle vector
368 T_Real lambdax = 0_prt;
369 T_Real lambday = 0_prt;
370 T_Real lambdaz = 0_prt;
371
372 // store the phase space variables in vector form
373 amrex::SmallVector<T_Real, 6, 1> const v{x, px, y, py, t, pt};
374
375 // get the spin-orbit coupling matrix
377
378 // use phase space variables to obtain the angle-axis generator of spin rotation
379 auto const out = A * v;
380
381 // update the angle-axis generator
382 lambdax = out[1];
383 lambday = out[2];
384 lambdaz = out[3];
385
386 // push the spin vector using the generator just determined
387 rotate_spin(lambdax,lambday,lambdaz,sx,sy,sz);
388
389 // axis-angle vector components generating the reference spin map
391 lambdax = lambda(1);
392 lambday = lambda(2);
393 lambdaz = lambda(3);
394
395 // push the spin vector using the generator just determined
396 rotate_spin(lambdax,lambday,lambdaz,sx,sy,sz);
397
398 // phase space push
399 (*this)(x, y, t, px, py, pt, idcpu, refpart);
400 }
401
402
404 using LinearTransport::operator();
405
412 Map6x6
413 transport_map ([[maybe_unused]] RefPart const & AMREX_RESTRICT refpart) const
414 {
415
417 R = m_map;
418
419 // apply the transverse rotation (roll) alignment error
420 return rotate_aligned_map(R);
421 }
422
429 std::tuple<amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal>
431 Sol_Bfield (amrex::ParticleReal const zeval) const
432 {
433 using namespace amrex::literals; // for _rt and _prt
434
435 // pick the right data depending if we are on the host side
436 // (reference particle push) or device side (particles):
437#if AMREX_DEVICE_COMPILE
438 amrex::ParticleReal const * cos_data = m_cos_d_data;
439 amrex::ParticleReal const * sin_data = m_sin_d_data;
440#else
441 amrex::ParticleReal const * cos_data = m_cos_h_data;
442 amrex::ParticleReal const * sin_data = m_sin_h_data;
443#endif
444
445 // specify constants
447 amrex::ParticleReal const zlen = std::abs(m_ds);
448 amrex::ParticleReal const zmid = zlen * 0.5_prt;
449
450 // compute on-axis magnetic field (z is relative to solenoid midpoint)
451 amrex::ParticleReal bfield = 0.0;
452 amrex::ParticleReal bfieldp = 0.0;
453 amrex::ParticleReal bfieldint = 0.0;
454 amrex::ParticleReal const z = zeval - zmid;
455
456 if (std::abs(z) <= zmid)
457 {
458 bfield = 0.5_prt*cos_data[0];
459 bfieldint = z*bfield;
460 for (int j=1; j < m_ncoef; ++j)
461 {
462 bfield = bfield + cos_data[j] * std::cos(j*2*pi*z/zlen) +
463 sin_data[j] * std::sin(j*2*pi*z/zlen);
464 bfieldp = bfieldp-j*2*pi*cos_data[j] * std::sin(j*2*pi*z/zlen)/zlen +
465 j*2*pi*sin_data[j] * std::cos(j*2*pi*z/zlen)/zlen;
466 bfieldint = bfieldint + zlen*cos_data[j] * std::sin(j*2*pi*z/zlen)/(j*2*pi) -
467 zlen*sin_data[j] * std::cos(j*2*pi*z/zlen)/(j*2*pi);
468 }
469 }
470 return std::make_tuple(bfield, bfieldp, bfieldint);
471 }
472
482 void map1 (amrex::ParticleReal const tau,
483 RefPart & refpart,
484 [[maybe_unused]] amrex::ParticleReal & zeval) const
485 {
486 using namespace amrex::literals; // for _rt and _prt
487 using amrex::Math::powi;
488
489 // push the reference particle
490 amrex::ParticleReal const t = refpart.t;
491 amrex::ParticleReal const pt = refpart.pt;
492 amrex::ParticleReal const z = zeval;
493
494 if (pt < -1.0_prt) {
495 refpart.t = t + tau/std::sqrt(1.0_prt - powi<-2>(pt));
496 refpart.pt = pt;
497 }
498 else {
499 refpart.t = t;
500 refpart.pt = pt;
501 }
502
503 zeval = z + tau;
504
505 // push the linear map equations
507 amrex::ParticleReal const betgam = refpart.beta_gamma();
508
509 m_map(1,1) = R(1,1) + tau*R(2,1);
510 m_map(1,2) = R(1,2) + tau*R(2,2);
511 m_map(1,3) = R(1,3) + tau*R(2,3);
512 m_map(1,4) = R(1,4) + tau*R(2,4);
513
514 m_map(3,1) = R(3,1) + tau*R(4,1);
515 m_map(3,2) = R(3,2) + tau*R(4,2);
516 m_map(3,3) = R(3,3) + tau*R(4,3);
517 m_map(3,4) = R(3,4) + tau*R(4,4);
518
519 m_map(5,5) = R(5,5) + tau*R(6,5)/powi<2>(betgam);
520 m_map(5,6) = R(5,6) + tau*R(6,6)/powi<2>(betgam);
521
522 }
523
533 void map2 (amrex::ParticleReal const tau,
534 RefPart & refpart,
535 amrex::ParticleReal & zeval) const
536 {
537 using namespace amrex::literals; // for _rt and _prt
538 using amrex::Math::powi;
539
540 amrex::ParticleReal const t = refpart.t;
541 amrex::ParticleReal const pt = refpart.pt;
542
543 // Define parameters and intermediate constants
544 amrex::ParticleReal const B0 =
545 m_unit == 1 ?
546 m_bscale / refpart.rigidity_Tm() :
547 m_bscale;
548
549 // push the reference particle
550 auto [bz, bzp, bzint] = Sol_Bfield(zeval);
551 amrex::ignore_unused(bzp, bzint);
552
553 refpart.t = t;
554 refpart.pt = pt;
555
556 // push the linear map equations
558 amrex::ParticleReal const alpha = B0*bz*0.5_prt;
559 amrex::ParticleReal const alpha2 = powi<2>(alpha);
560
561 m_map(2,1) = R(2,1) - tau*alpha2*R(1,1);
562 m_map(2,2) = R(2,2) - tau*alpha2*R(1,2);
563 m_map(2,3) = R(2,3) - tau*alpha2*R(1,3);
564 m_map(2,4) = R(2,4) - tau*alpha2*R(1,4);
565
566 m_map(4,1) = R(4,1) - tau*alpha2*R(3,1);
567 m_map(4,2) = R(4,2) - tau*alpha2*R(3,2);
568 m_map(4,3) = R(4,3) - tau*alpha2*R(3,3);
569 m_map(4,4) = R(4,4) - tau*alpha2*R(3,4);
570
571 // BELOW: if spin is needed only:
575 amrex::ParticleReal const gamma = refpart.gamma();
576 amrex::ParticleReal const beta = refpart.beta();
578 amrex::ParticleReal Gfactor = (gamma - 1_prt) * G;
579 amrex::ParticleReal const cs = std::cos(v(3));
580 amrex::ParticleReal const sn = std::sin(v(3));
581
582 // Update spin-orbit coupling matrix here
583 dA(1,1) = Gfactor * tau * alpha2 * (-2_prt*sn + tau*cs*alpha);
584 dA(1,2) = 2_prt * Gfactor * tau * alpha * cs;
585 dA(1,3) = Gfactor * tau * alpha2 * (2_prt*cs + tau*sn*alpha);
586 dA(1,4) = 2_prt * Gfactor * tau * alpha * sn;
587 dA(2,1) = -Gfactor * tau * alpha2 * (2_prt*cs + tau*sn*alpha);
588 dA(2,2) = -2_prt * Gfactor * tau * alpha * sn;
589 dA(2,3) = Gfactor * tau * alpha2 * (-2_prt*sn + tau*cs*alpha);
590 dA(2,4) = 2_prt * Gfactor * tau * cs * alpha;
591 dA(3,6) = -2_prt *(1_prt + G) * tau * alpha/beta;
592
593 // update the spin-orbit coupling matrix here
594 m_spin_coupling = A + dA*R;
595
596 }
597
607 void map3 (amrex::ParticleReal const tau,
608 RefPart & refpart,
609 amrex::ParticleReal & zeval) const
610 {
611 using namespace amrex::literals; // for _rt and _prt
612
613 amrex::ParticleReal const t = refpart.t;
614 amrex::ParticleReal const pt = refpart.pt;
615 amrex::ParticleReal const z = zeval;
616
617 // Define parameters and intermediate constants
618 amrex::ParticleReal const B0 =
619 m_unit == 1 ?
620 m_bscale / refpart.rigidity_Tm() :
621 m_bscale;
622
623 // push the reference particle
624 auto [bz, bzp, bzint] = Sol_Bfield(z);
625 amrex::ignore_unused(bzp, bzint);
626
627 refpart.t = t;
628 refpart.pt = pt;
629
630 // push the linear map equations
632 amrex::ParticleReal const theta = tau*B0*bz*0.5_prt;
633 amrex::ParticleReal const cs = std::cos(theta);
634 amrex::ParticleReal const sn = std::sin(theta);
635
636 m_map(1,1) = R(1,1)*cs + R(3,1)*sn;
637 m_map(1,2) = R(1,2)*cs + R(3,2)*sn;
638 m_map(1,3) = R(1,3)*cs + R(3,3)*sn;
639 m_map(1,4) = R(1,4)*cs + R(3,4)*sn;
640
641 m_map(2,1) = R(2,1)*cs + R(4,1)*sn;
642 m_map(2,2) = R(2,2)*cs + R(4,2)*sn;
643 m_map(2,3) = R(2,3)*cs + R(4,3)*sn;
644 m_map(2,4) = R(2,4)*cs + R(4,4)*sn;
645
646 m_map(3,1) = R(3,1)*cs - R(1,1)*sn;
647 m_map(3,2) = R(3,2)*cs - R(1,2)*sn;
648 m_map(3,3) = R(3,3)*cs - R(1,3)*sn;
649 m_map(3,4) = R(3,4)*cs - R(1,4)*sn;
650
651 m_map(4,1) = R(4,1)*cs - R(2,1)*sn;
652 m_map(4,2) = R(4,2)*cs - R(2,2)*sn;
653 m_map(4,3) = R(4,3)*cs - R(2,3)*sn;
654 m_map(4,4) = R(4,4)*cs - R(2,4)*sn;
655
656 // BELOW: if spin is needed only:
658 amrex::ParticleReal dv_z = 0_prt;
660
661 // Update reference spin rotation vector here
662 dv_z = -(1_prt + G) * tau * B0 * bz;
663 m_spin_rotation_vector(3) = v(3) + dv_z;
664
665 }
666
668 int m_unit;
670 int m_id;
671
672 int m_ncoef = 0;
677
678 // Reference-trajectory linearization around the reference particle.
679 // Computed during the reference-particle push and consumed during the
680 // particle push.
681 // mutable: written by the const reference push before the element is copied
682 // into the particle-push functor.
686 };
687
688} // namespace impactx
689
692
693#endif // IMPACTX_SOFTSOL_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 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:82
@ 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:167
amrex::ParticleReal pt
energy, normalized by rest energy
Definition ReferenceParticle.H:42
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal rigidity_Tm() const
Definition ReferenceParticle.H:260
amrex::ParticleReal gyromagnetic_anomaly
anomalous magnetic moment [unitless]
Definition ReferenceParticle.H:45
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal beta() const
Definition ReferenceParticle.H:151
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal gamma() const
Definition ReferenceParticle.H:139
amrex::ParticleReal t
clock time * c in meters
Definition ReferenceParticle.H:38
Definition SoftSol.H:124
std::tuple< amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal > AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Sol_Bfield(amrex::ParticleReal const zeval) const
Definition SoftSol.H:431
int m_id
number of map integration steps per slice
Definition SoftSol.H:670
int m_mapsteps
unit specification for quad strength
Definition SoftSol.H:669
void compute_constants(RefPart const &refpart)
Definition SoftSol.H:203
amrex::ParticleReal const * m_sin_d_data
non-owning pointer to device cosine coefficients
Definition SoftSol.H:676
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition SoftSol.H:413
static constexpr auto type
Definition SoftSol.H:125
amrex::SmallMatrix< amrex::ParticleReal, 3, 6, amrex::Order::F, 1 > m_spin_coupling
linearized map
Definition SoftSol.H:684
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map3(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition SoftSol.H:607
SoftSolenoid(amrex::ParticleReal ds, amrex::ParticleReal bscale, std::vector< amrex::ParticleReal > cos_coef, std::vector< amrex::ParticleReal > sin_coef, int unit, 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 SoftSol.H:151
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > m_map
non-owning pointer to device sine coefficients
Definition SoftSol.H:683
int m_ncoef
unique soft solenoid id used for data lookup map
Definition SoftSol.H:672
ImpactXParticleContainer::ParticleType PType
Definition SoftSol.H:126
void reverse()
Definition SoftSol.H:187
amrex::ParticleReal const * m_sin_h_data
non-owning pointer to host cosine coefficients
Definition SoftSol.H:674
amrex::ParticleReal const * m_cos_h_data
number of Fourier coefficients
Definition SoftSol.H:673
amrex::ParticleReal m_bscale
Definition SoftSol.H:667
mixin::GPUDataRegistry< SolenoidFourierCoefficients > DynamicData
Definition SoftSol.H:128
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 const &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition SoftSol.H:351
int m_unit
scaling factor for solenoid Bz field
Definition SoftSol.H:668
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map2(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition SoftSol.H:533
amrex::SmallMatrix< amrex::ParticleReal, 3, 1, amrex::Order::F, 1 > m_spin_rotation_vector
linearized spin-orbit coupling matrix
Definition SoftSol.H:685
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void map1(amrex::ParticleReal const tau, RefPart &refpart, amrex::ParticleReal &zeval) const
Definition SoftSol.H:482
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 const &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition SoftSol.H:231
amrex::ParticleReal const * m_cos_d_data
non-owning pointer to host sine coefficients
Definition SoftSol.H:675
Definition SoftSol.H:56
amrex::Vector< amrex::ParticleReal > default_sin_coef
Definition SoftSol.H:95
amrex::Vector< amrex::ParticleReal > default_cos_coef
Definition SoftSol.H:57
mixin::TrackedVector< amrex::ParticleReal > sin
Definition SoftSol.H:111
mixin::TrackedVector< amrex::ParticleReal > cos
Definition SoftSol.H:110
Definition alignment.H:29
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy() const
Definition alignment.H:189
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx() const
Definition alignment.H:179
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 rotate_aligned_map(Map6x6 const &R) const
Definition alignment.H:263
Alignment(amrex::ParticleReal dx, amrex::ParticleReal dy, amrex::ParticleReal rotation_degree)
Definition alignment.H:39
Definition beamoptic.H:529
static std::shared_ptr< SolenoidFourierCoefficients > const & get(int id)
Definition dynamicdata.H:98
static SolenoidFourierCoefficients & 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 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