From d29b23f5d4d456342c1ad74e076fe0f11739817f Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Fri, 11 Oct 2024 12:51:12 -0700 Subject: [PATCH] Fix compilation errors --- .../BinaryCollision/DSMC/SplitAndScatterFunc.H | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/Particles/Collision/BinaryCollision/DSMC/SplitAndScatterFunc.H b/Source/Particles/Collision/BinaryCollision/DSMC/SplitAndScatterFunc.H index 0e26c6da59c..d46b7b56bac 100644 --- a/Source/Particles/Collision/BinaryCollision/DSMC/SplitAndScatterFunc.H +++ b/Source/Particles/Collision/BinaryCollision/DSMC/SplitAndScatterFunc.H @@ -240,7 +240,7 @@ public: // calculate kinetic energy of the incident electron double E_coll; double energy_cost = 0; // TODO: update this: get from scattering process - const ParticleReal u_coll2 = ux1*ux1 + uy1*uy1 + uz1*uz1; + const amrex::ParticleReal u_coll2 = ux1*ux1 + uy1*uy1 + uz1*uz1; ParticleUtils::getEnergy(u_coll2, m1, E_coll); // each of the two electron (the scattered e) gets half the energy (could change this later) const auto E_out = static_cast((E_coll - energy_cost) / 2.0_prt * PhysConst::q_e); @@ -249,8 +249,13 @@ public: const amrex::ParticleReal up = sqrt(E_out * (E_out + 2.0_prt*mc2) / c2) / m1; // isotropically scatter electrons - ParticleUtils::RandomizeVelocity(ux, uy, uz, up, engine); - ParticleUtils::RandomizeVelocity(e_ux, e_uy, e_uz, up, engine); + // - The incident electron + ParticleUtils::RandomizeVelocity(ux1, uy1, uz1, up, engine); + // - The newly created electron + auto& e_ux1 = soa_products_data[0].m_rdata[PIdx::ux][product1_index+1]; + auto& e_uy1 = soa_products_data[0].m_rdata[PIdx::uy][product1_index+1]; + auto& e_uz1 = soa_products_data[0].m_rdata[PIdx::uz][product1_index+1]; + ParticleUtils::RandomizeVelocity(e_ux1, e_uy1, e_uz1, up, engine); } else { amrex::Abort("Unknown scattering process.");