10#ifndef IMPACTX_NONLINEARLENS_H
11#define IMPACTX_NONLINEARLENS_H
43 static constexpr auto type =
"NonlinearLens";
78 using BeamOptic::operator();
91 Alignment::compute_constants(refpart);
111 template<
typename T_Real=amrex::ParticleReal,
typename T_IdCpu=u
int64_t>
145 Complex const re1(1.0_prt, 0.0_prt);
146 Complex const im1(0.0_prt, 1.0_prt);
154 Complex carcsin = im1 * zeta + croot;
159 dF =
dF + carcsin / powi<3>(croot);
162 T_Real
const dpx = +
m_kick *
dF.m_real;
163 T_Real
const dpy = -
m_kick *
dF.m_imag;
185 using Thin::operator();
188 using LinearTransport::operator();
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real dF(const amrex::Array4< amrex::Real > &U_minus, const amrex::Array4< amrex::Real > &U_plus, int i, int j, int k, amrex::Real clight, int comp, int dir)
#define IMPACTX_PUSH_EXTERN_TEMPLATE(ElementType)
Definition PushAll.H:78
amrex::GpuComplex< amrex::Real > Complex
T_ParticleType ParticleType
amrex_particle_real ParticleReal
constexpr T powi(T x) noexcept
__host__ __device__ GpuComplex< T > log(const GpuComplex< T > &a_z) noexcept
__host__ __device__ GpuComplex< T > sqrt(const GpuComplex< T > &a_z) noexcept
@ 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
Definition NonlinearLens.H:42
void reverse()
Definition NonlinearLens.H:75
amrex::ParticleReal m_kick
1 / m_cnll
Definition NonlinearLens.H:242
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(T_Real const &AMREX_RESTRICT x, T_Real const &AMREX_RESTRICT y, T_Real const &AMREX_RESTRICT t, T_Real &AMREX_RESTRICT px, T_Real &AMREX_RESTRICT py, T_Real const &AMREX_RESTRICT pt, T_IdCpu const &AMREX_RESTRICT idcpu, RefPart const &AMREX_RESTRICT refpart) const
Definition NonlinearLens.H:113
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 transport_map(RefPart const &AMREX_RESTRICT refpart) const
Definition NonlinearLens.H:220
amrex::ParticleReal m_cnll
integrated strength of the nonlinear lens (m)
Definition NonlinearLens.H:236
amrex::ParticleReal m_inv_cnll
distance of singularities from the origin (m)
Definition NonlinearLens.H:241
amrex::ParticleReal m_knll
Definition NonlinearLens.H:235
NonlinearLens(amrex::ParticleReal knll, amrex::ParticleReal cnll, amrex::ParticleReal dx=DEFAULT_dx, amrex::ParticleReal dy=DEFAULT_dy, amrex::ParticleReal rotation_degree=DEFAULT_rotation_degree, std::optional< std::string > name=DEFAULT_name)
Definition NonlinearLens.H:60
void compute_constants(RefPart const &refpart)
Definition NonlinearLens.H:87
static constexpr auto type
Definition NonlinearLens.H:43
ImpactXParticleContainer::ParticleType PType
Definition NonlinearLens.H:44
Definition alignment.H:29
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dy() const
Definition alignment.H:193
static constexpr amrex::ParticleReal DEFAULT_dy
Definition alignment.H:34
static constexpr amrex::ParticleReal DEFAULT_dx
Definition alignment.H:33
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::ParticleReal dx() const
Definition alignment.H:183
AMREX_GPU_HOST AMREX_FORCE_INLINE Map6x6 rotate_aligned_map(Map6x6 const &R) const
Definition alignment.H:267
Alignment(amrex::ParticleReal dx, amrex::ParticleReal dy, amrex::ParticleReal rotation_degree)
Definition alignment.H:43
static constexpr amrex::ParticleReal DEFAULT_rotation_degree
Definition alignment.H:35
Definition beamoptic.H:567
Definition lineartransport.H:50
static constexpr std::nullopt_t DEFAULT_name
Definition named.H:30
AMREX_GPU_HOST Named(std::optional< std::string > name)
Definition named.H:59
AMREX_FORCE_INLINE std::string name() const
Definition named.H:124
Definition nofinalize.H:22