diff options
author | 2020-09-17 20:09:08 +0200 | |
---|---|---|
committer | 2020-09-17 11:09:08 -0700 | |
commit | 266f2a28b80a5aada004a24c72b9de59af15533b (patch) | |
tree | 641b39f1927e5a27944d02551f9a772e83b7c346 /Source/Particles/WarpXParticleContainer.cpp | |
parent | 8d9193675b3292571478803fbe55f6831afe454b (diff) | |
download | WarpX-266f2a28b80a5aada004a24c72b9de59af15533b.tar.gz WarpX-266f2a28b80a5aada004a24c72b9de59af15533b.tar.zst WarpX-266f2a28b80a5aada004a24c72b9de59af15533b.zip |
Fix few compilation warnings (shift) (#1310)
* fix << declaration of galilean_shift shadows a member of WarpX >>
* fix << unused mu_stag >>
* fix << unused uxp, uyp, uzp >>
* renamed galilean_shift (member variable of WarpX class) into m_galilean_shift
* renamed v_galilean to m_v_galilean when appropriate
* fixed bug introduced in latest commit
* fix <<comparison of integer expressions of different signedness>>
* Update Source/FieldSolver/FiniteDifferenceSolver/MacroscopicEvolveE.cpp
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Particles/WarpXParticleContainer.cpp')
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index 44ebde7af..10ff7f19c 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -304,14 +304,17 @@ WarpXParticleContainer::DepositCurrent(WarpXParIter& pti, Real cur_time = warpx_instance.gett_new(lev); const auto& time_of_last_gal_shift = warpx_instance.time_of_last_gal_shift; Real time_shift = (cur_time + 0.5*dt - time_of_last_gal_shift); - amrex::Array<amrex::Real,3> galilean_shift = { v_galilean[0]* time_shift, v_galilean[1]*time_shift, v_galilean[2]*time_shift }; + amrex::Array<amrex::Real,3> galilean_shift = { + m_v_galilean[0]* time_shift, + m_v_galilean[1]*time_shift, + m_v_galilean[2]*time_shift }; const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(tilebox, galilean_shift, depos_lev); if (WarpX::current_deposition_algo == CurrentDepositionAlgo::Esirkepov) { if (WarpX::do_nodal==1) { amrex::Abort("The Esirkepov algorithm cannot be used with a nodal grid."); } - if ( (v_galilean[0]!=0) or (v_galilean[1]!=0) or (v_galilean[2]!=0)){ + if ( (m_v_galilean[0]!=0) or (m_v_galilean[1]!=0) or (m_v_galilean[2]!=0)){ amrex::Abort("The Esirkepov algorithm cannot be used with the Galilean algorithm."); } } @@ -479,9 +482,15 @@ WarpXParticleContainer::DepositCharge (WarpXParIter& pti, RealVector& wp, Real time_shift_rho_new = (cur_time + dt - time_of_last_gal_shift); amrex::Array<amrex::Real,3> galilean_shift; if (icomp==0){ - galilean_shift = { v_galilean[0]*time_shift_rho_old, v_galilean[1]*time_shift_rho_old, v_galilean[2]*time_shift_rho_old }; + galilean_shift = { + m_v_galilean[0]*time_shift_rho_old, + m_v_galilean[1]*time_shift_rho_old, + m_v_galilean[2]*time_shift_rho_old }; } else{ - galilean_shift = { v_galilean[0]*time_shift_rho_new, v_galilean[1]*time_shift_rho_new, v_galilean[2]*time_shift_rho_new }; + galilean_shift = { + m_v_galilean[0]*time_shift_rho_new, + m_v_galilean[1]*time_shift_rho_new, + m_v_galilean[2]*time_shift_rho_new }; } const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(tilebox, galilean_shift, depos_lev); |