diff options
Diffstat (limited to 'Source/Particles')
-rw-r--r-- | Source/Particles/Collision/BinaryCollision/BinaryCollision.H | 5 | ||||
-rw-r--r-- | Source/Particles/LaserParticleContainer.cpp | 2 | ||||
-rw-r--r-- | Source/Particles/MultiParticleContainer.H | 6 | ||||
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 6 | ||||
-rw-r--r-- | Source/Particles/Resampling/Resampling.cpp | 2 | ||||
-rw-r--r-- | Source/Particles/WarpXParticleContainer.cpp | 10 |
6 files changed, 15 insertions, 16 deletions
diff --git a/Source/Particles/Collision/BinaryCollision/BinaryCollision.H b/Source/Particles/Collision/BinaryCollision/BinaryCollision.H index 2d6cba8b2..c52182681 100644 --- a/Source/Particles/Collision/BinaryCollision/BinaryCollision.H +++ b/Source/Particles/Collision/BinaryCollision/BinaryCollision.H @@ -90,10 +90,7 @@ public: if(m_species_names.size() != 2) WARPX_ABORT_WITH_MESSAGE("Binary collision " + collision_name + " must have exactly two species."); - if (m_species_names[0] == m_species_names[1]) - m_isSameSpecies = true; - else - m_isSameSpecies = false; + m_isSameSpecies = (m_species_names[0] == m_species_names[1]); m_binary_collision_functor = CollisionFunctorType(collision_name, mypc, m_isSameSpecies); diff --git a/Source/Particles/LaserParticleContainer.cpp b/Source/Particles/LaserParticleContainer.cpp index 73e27b3c5..6fb8aa974 100644 --- a/Source/Particles/LaserParticleContainer.cpp +++ b/Source/Particles/LaserParticleContainer.cpp @@ -655,7 +655,7 @@ LaserParticleContainer::Evolve (int lev, WARPX_PROFILE_VAR_STOP(blp_pp); // Current Deposition - if (skip_deposition == false) + if (!skip_deposition) { // Deposit at t_{n+1/2} const amrex::Real relative_time = -0.5_rt * dt; diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H index 59815d150..3eb4cfba8 100644 --- a/Source/Particles/MultiParticleContainer.H +++ b/Source/Particles/MultiParticleContainer.H @@ -376,8 +376,8 @@ protected: MFItInfoCheckTiling(pc_src, pc_dsts...); - if (pc_src.do_tiling && amrex::Gpu::notInLaunchRegion()) { - info.EnableTiling(pc_src.tile_size); + if (WarpXParticleContainer::do_tiling && amrex::Gpu::notInLaunchRegion()) { + info.EnableTiling(WarpXParticleContainer::tile_size); } #ifdef AMREX_USE_OMP @@ -496,7 +496,7 @@ private: void MFItInfoCheckTiling(const WarpXParticleContainer& pc_src, First const& pc_dst, Args const&... others) const noexcept { - if (pc_src.do_tiling && amrex::Gpu::notInLaunchRegion()) { + if (WarpXParticleContainer::do_tiling && amrex::Gpu::notInLaunchRegion()) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE(pc_dst.do_tiling, "For particle creation processes, either all or none of the " "particle species must use tiling."); diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 143847d4d..56fdbc378 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -2059,10 +2059,12 @@ PhysicalParticleContainer::Evolve (int lev, // Gather and push for particles not in the buffer // WARPX_PROFILE_VAR_START(blp_fg); + const auto np_to_push = np_gather; + const auto gather_lev = lev; PushPX(pti, exfab, eyfab, ezfab, bxfab, byfab, bzfab, Ex.nGrowVect(), e_is_nodal, - 0, np_gather, lev, lev, dt, ScaleFields(false), a_dt_type); + 0, np_to_push, lev, gather_lev, dt, ScaleFields(false), a_dt_type); if (np_gather < np) { @@ -2103,7 +2105,7 @@ PhysicalParticleContainer::Evolve (int lev, WARPX_PROFILE_VAR_STOP(blp_fg); // Current Deposition - if (skip_deposition == false) + if (!skip_deposition) { // Deposit at t_{n+1/2} const amrex::Real relative_time = -0.5_rt * dt; diff --git a/Source/Particles/Resampling/Resampling.cpp b/Source/Particles/Resampling/Resampling.cpp index 40510a05c..63ac44888 100644 --- a/Source/Particles/Resampling/Resampling.cpp +++ b/Source/Particles/Resampling/Resampling.cpp @@ -18,7 +18,7 @@ Resampling::Resampling (const std::string species_name) std::string resampling_algorithm_string = "leveling_thinning"; // default resampling algorithm pp_species_name.query("resampling_algorithm", resampling_algorithm_string); - if (resampling_algorithm_string.compare("leveling_thinning") == 0) + if (resampling_algorithm_string == "leveling_thinning") { m_resampling_algorithm = std::make_unique<LevelingThinning>(species_name); } diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index f0f745f76..ea9a6b3ec 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -1013,7 +1013,7 @@ WarpXParticleContainer::DepositCharge (amrex::Vector<std::unique_ptr<amrex::Mult #endif // Exchange guard cells - if (local == false) { + if (!local) { // Possible performance optimization: // pass less than `rho[lev]->nGrowVect()` in the fifth input variable `dst_ng` ablastr::utils::communication::SumBoundary( @@ -1106,7 +1106,7 @@ WarpXParticleContainer::GetChargeDensity (int lev, bool local) WarpX::GetInstance().ApplyInverseVolumeScalingToChargeDensity(rho.get(), lev); #endif - if (local == false) { + if (!local) { // Possible performance optimization: // pass less than `rho->nGrowVect()` in the fifth input variable `dst_ng` ablastr::utils::communication::SumBoundary( @@ -1146,7 +1146,7 @@ amrex::ParticleReal WarpXParticleContainer::sumParticleCharge(bool local) { total_charge = get<0>(reduce_data.value()); - if (local == false) ParallelDescriptor::ReduceRealSum(total_charge); + if (!local) ParallelDescriptor::ReduceRealSum(total_charge); total_charge *= this->charge; return total_charge; } @@ -1222,7 +1222,7 @@ std::array<ParticleReal, 3> WarpXParticleContainer::meanParticleVelocity(bool lo } } - if (local == false) { + if (!local) { ParallelDescriptor::ReduceRealSum<ParticleReal>({vx_total,vy_total,vz_total}); ParallelDescriptor::ReduceLongSum(np_total); } @@ -1259,7 +1259,7 @@ amrex::ParticleReal WarpXParticleContainer::maxParticleVelocity(bool local) { } } - if (local == false) ParallelAllReduce::Max(max_v, ParallelDescriptor::Communicator()); + if (!local) ParallelAllReduce::Max(max_v, ParallelDescriptor::Communicator()); return max_v; } |