diff options
Diffstat (limited to '')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 417f76bef..9b8184823 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -316,19 +316,19 @@ PhysicalParticleContainer::AddGaussianBeam ( u.z *= PhysConst::c; if (do_symmetrize){ // Add four particles to the beam: - CheckAndAddParticle(x, y, z, { u.x, u.y, u.z}, weight/4., + CheckAndAddParticle(x, y, z, { u.x, u.y, u.z}, weight/4._rt, particle_x, particle_y, particle_z, particle_ux, particle_uy, particle_uz, particle_w); - CheckAndAddParticle(x, -y, z, { u.x, -u.y, u.z}, weight/4., + CheckAndAddParticle(x, -y, z, { u.x, -u.y, u.z}, weight/4._rt, particle_x, particle_y, particle_z, particle_ux, particle_uy, particle_uz, particle_w); - CheckAndAddParticle(-x, y, z, { -u.x, u.y, u.z}, weight/4., + CheckAndAddParticle(-x, y, z, { -u.x, u.y, u.z}, weight/4._rt, particle_x, particle_y, particle_z, particle_ux, particle_uy, particle_uz, particle_w); - CheckAndAddParticle(-x, -y, z, { -u.x, -u.y, u.z}, weight/4., + CheckAndAddParticle(-x, -y, z, { -u.x, -u.y, u.z}, weight/4._rt, particle_x, particle_y, particle_z, particle_ux, particle_uy, particle_uz, particle_w); @@ -1941,11 +1941,13 @@ PhysicalParticleContainer::InitIonizationModule () // For now, we assume l=0 and m=0. // The approximate expressions are used, // without Gamma function - Real wa = std::pow(PhysConst::alpha,3) * PhysConst::c / PhysConst::r_e; + constexpr auto a3 = PhysConst::alpha*PhysConst::alpha*PhysConst::alpha; + constexpr auto a4 = a3 * PhysConst::alpha; + Real wa = a3 * PhysConst::c / PhysConst::r_e; Real Ea = PhysConst::m_e * PhysConst::c*PhysConst::c /PhysConst::q_e * - std::pow(PhysConst::alpha,4)/PhysConst::r_e; + a4/PhysConst::r_e; Real UH = table_ionization_energies[0]; - Real l_eff = std::sqrt(UH/h_ionization_energies[0]) - 1.; + Real l_eff = std::sqrt(UH/h_ionization_energies[0]) - 1._rt; const Real dt = WarpX::GetInstance().getdt(0); |