8#ifndef WARPX_TWO_PRODUCT_UTIL_H
9#define WARPX_TWO_PRODUCT_UTIL_H
50 void TwoProductComputeProductMomenta (
93 m1_in*m1_in*c2 + p1x_in*p1x_in + p1y_in*p1y_in + p1z_in*p1z_in);
95 m2_in*m2_in*c2 + p2x_in*p2x_in + p2y_in*p2y_in + p2z_in*p2z_in);
114 - E_rest_in + E_rest_out + E_reaction);
122 +
powi<2>(m1_out - m2_out)*
c2*0.25_prt *
powi<2>( E_ratio - 1._prt/E_ratio );
144 if ( vc_sq > std::numeric_limits<amrex::ParticleReal>::min() )
151 p1x_star_in = p1x_in + vcx * factor;
152 p1y_star_in = p1y_in + vcy * factor;
153 p1z_star_in = p1z_in + vcz * factor;
157 p1x_star_in = p1x_in;
158 p1y_star_in = p1y_in;
159 p1z_star_in = p1z_in;
161 const amrex::ParticleReal p1_star_in = std::sqrt(p1x_star_in*p1x_star_in + p1y_star_in*p1y_star_in + p1z_star_in*p1z_star_in);
166 px_star_out = p1x_star_in * scaling;
167 py_star_out = p1y_star_in * scaling;
168 pz_star_out = p1z_star_in * scaling;
175 if ( vc_sq > std::numeric_limits<amrex::ParticleReal>::min() )
181 p1x_out = px_star_out + vcx * factor;
182 p1y_out = py_star_out + vcy * factor;
183 p1z_out = pz_star_out + vcz * factor;
187 p1x_out = px_star_out;
188 p1y_out = py_star_out;
189 p1z_out = pz_star_out;
199 u1x_out = (m1_out == 0) ? p1x_out/me : p1x_out/m1_out;
200 u1y_out = (m1_out == 0) ? p1y_out/me : p1y_out/m1_out;
201 u1z_out = (m1_out == 0) ? p1z_out/me : p1z_out/m1_out;
202 u2x_out = (m2_out == 0) ? p2x_out/me : p2x_out/m2_out;
203 u2y_out = (m2_out == 0) ? p2y_out/me : p2y_out/m2_out;
204 u2z_out = (m2_out == 0) ? p2z_out/me : p2z_out/m2_out;
#define AMREX_GPU_HOST_DEVICE
ScatteringAngleModel
For binary collision algorithms, the strategy to determine the scattering angle in the center of mass...
Definition WarpXAlgorithmSelection.H:198
@ Isotropic
Definition WarpXAlgorithmSelection.H:198
@ Forward
Definition WarpXAlgorithmSelection.H:198
amrex_particle_real ParticleReal
AMREX_GPU_HOST_DEVICE AMREX_INLINE void RandomizeVelocity(amrex::ParticleReal &ux, amrex::ParticleReal &uy, amrex::ParticleReal &uz, const amrex::ParticleReal vp, amrex::RandomEngine const &engine)
Function to perform scattering of a particle that results in a random velocity vector with given magn...
Definition ParticleUtils.H:217
constexpr auto c
vacuum speed of light [m/s]
Definition constant.H:153
constexpr auto c2
square of the vacuum speed of light [m^2/s^2]
Definition constant.H:214
constexpr auto inv_c2_v
inverse of the square of the vacuum speed of light [s^2/m^2] (variable template)
Definition constant.H:146
constexpr auto m_e
electron mass [kg]
Definition constant.H:165
constexpr auto c2_v
square of the vacuum speed of light [m^2/s^2] (variable template)
Definition constant.H:138
constexpr auto inv_c2
inverse of the square of the vacuum speed of light [s^2/m^2]
Definition constant.H:220
constexpr T powi(T x) noexcept