7#ifndef WARPX_PARTICLES_COLLISION_ELASTIC_COLLISION_PEREZ_H_
8#define WARPX_PARTICLES_COLLISION_ELASTIC_COLLISION_PEREZ_H_
41template <
typename T_index,
typename T_PR,
typename T_R,
typename SoaData_type>
44 T_index
const I1s, T_index
const I1e,
45 T_index
const I2s, T_index
const I2e,
48 SoaData_type soa_1, SoaData_type soa_2,
49 T_PR
const n1, T_PR
const n2,
50 T_PR
const T1, T_PR
const T2,
51 T_PR
const q1, T_PR
const q2,
52 T_PR
const m1, T_PR
const m2,
53 T_R
const dt, T_R
const global_lamdb, T_PR
const L, T_R
const dV,
55 bool const isSameSpecies, T_index coll_idx)
57 const T_index NI1 = I1e - I1s;
58 const T_index NI2 = I2e - I2s;
73 T_PR lmdD = T_PR(-1.0);
74 if ( L <= T_PR(0.0) ) {
75 if (global_lamdb <= T_PR(0.0)) {
85 const auto rmin =
static_cast<T_PR
>( 1.0/std::cbrt(4.0*
MathConst::pi/3.0*maxn) );
91 const T_PR sigma_max = T_PR(1.0) / (maxn * rmin);
95 T_index i1 = I1s + coll_idx;
96 T_index i2 = I2s + coll_idx;
100 for (T_index k = coll_idx; k < max_N; k += min_N)
111 const T_PR wpmax =
amrex::max(w1[ I1[i1] ],w2[ I2[i2] ]);
112 if (isSameSpecies) { n12 = wpmax*
static_cast<T_PR
>(min_N+max_N-1)/dV; }
113 else { n12 = wpmax*
static_cast<T_PR
>(min_N)/dV; }
116 u1x[ I1[i1] ], u1y[ I1[i1] ], u1z[ I1[i1] ],
117 u2x[ I2[i2] ], u2y[ I2[i2] ], u2z[ I2[i2] ],
118 q1, m1, w1[ I1[i1] ], q2, m2, w2[ I2[i2] ],
119 n12, sigma_max, L, bmax, dt, engine );
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_INLINE void ElasticCollisionPerez(T_index const I1s, T_index const I1e, T_index const I2s, T_index const I2e, T_index const *AMREX_RESTRICT I1, T_index const *AMREX_RESTRICT I2, SoaData_type soa_1, SoaData_type soa_2, T_PR const n1, T_PR const n2, T_PR const T1, T_PR const T2, T_PR const q1, T_PR const q2, T_PR const m1, T_PR const m2, T_R const dt, T_R const global_lamdb, T_PR const L, T_R const dV, amrex::RandomEngine const &engine, bool const isSameSpecies, T_index coll_idx)
Definition ElasticCollisionPerez.H:43
AMREX_GPU_HOST_DEVICE AMREX_INLINE void UpdateMomentumPerezElastic(T_PR &u1x, T_PR &u1y, T_PR &u1z, T_PR &u2x, T_PR &u2y, T_PR &u2z, T_PR const q1, T_PR const m1, T_PR const w1, T_PR const q2, T_PR const m2, T_PR const w2, T_PR const n12, T_PR const sigma_max, T_PR const L, T_PR const bmax, T_R const dt, amrex::RandomEngine const &engine)
Definition UpdateMomentumPerezElastic.H:37
constexpr auto epsilon_0
vacuum permittivity: dielectric permittivity of vacuum [F/m]
Definition constant.H:156
constexpr auto pi
ratio of a circle's circumference to its diameter
Definition constant.H:29
__host__ __device__ constexpr const T & min(const T &a, const T &b) noexcept
__host__ __device__ constexpr const T & max(const T &a, const T &b) noexcept
@ uz
Definition WarpXParticleContainer.H:70
@ w
Definition WarpXParticleContainer.H:70
@ uy
Definition WarpXParticleContainer.H:70
@ ux
Definition WarpXParticleContainer.H:70