aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/WarpXParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2022-02-04 17:12:55 -0800
committerGravatar GitHub <noreply@github.com> 2022-02-05 01:12:55 +0000
commit5692067b01252146b8d0a90137a1bd952644c8ca (patch)
treebfb704a14588a54207b883254264a8c474d65a14 /Source/Particles/WarpXParticleContainer.cpp
parent9263e6a9832f7ec69a8cc54fda3f6f1de51caaf1 (diff)
downloadWarpX-5692067b01252146b8d0a90137a1bd952644c8ca.tar.gz
WarpX-5692067b01252146b8d0a90137a1bd952644c8ca.tar.zst
WarpX-5692067b01252146b8d0a90137a1bd952644c8ca.zip
Fixes removing implicit double to float conversions (#2687)
* Fixes removing implicit double to float conversions * Minor fix in Evolve * Removed comments * Reverted amrex::second to original version. This change will be made in a separate PR * More fixes * Performance: pow2 & pow3 * One more pow2 * Cleaning: auto where types are repetitive std::pow(float, int): see comments and https://stackoverflow.com/a/5627278/2719194
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r--Source/Particles/WarpXParticleContainer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp
index 659db5046..806eb92c9 100644
--- a/Source/Particles/WarpXParticleContainer.cpp
+++ b/Source/Particles/WarpXParticleContainer.cpp
@@ -416,7 +416,7 @@ WarpXParticleContainer::DepositCurrent (WarpXParIter& pti,
// Take into account Galilean shift
Real cur_time = warpx.gett_new(lev);
const auto& time_of_last_gal_shift = warpx.time_of_last_gal_shift;
- Real time_shift = (cur_time + 0.5*dt - time_of_last_gal_shift);
+ Real time_shift = (cur_time + 0.5_rt*dt - time_of_last_gal_shift);
amrex::Array<amrex::Real,3> galilean_shift = {
m_v_galilean[0]* time_shift,
m_v_galilean[1]*time_shift,
@@ -820,13 +820,13 @@ Real WarpXParticleContainer::sumParticleCharge(bool local) {
std::array<Real, 3> WarpXParticleContainer::meanParticleVelocity(bool local) {
- amrex::Real vx_total = 0.0;
- amrex::Real vy_total = 0.0;
- amrex::Real vz_total = 0.0;
+ amrex::Real vx_total = 0.0_rt;
+ amrex::Real vy_total = 0.0_rt;
+ amrex::Real vz_total = 0.0_rt;
amrex::Long np_total = 0;
- amrex::Real inv_clight_sq = 1.0/PhysConst::c/PhysConst::c;
+ amrex::Real inv_clight_sq = 1.0_rt/PhysConst::c/PhysConst::c;
const int nLevels = finestLevel();