diff --git a/Source/Diagnostics/SliceDiagnostic.cpp b/Source/Diagnostics/SliceDiagnostic.cpp index 14a2d633a0c..97af967f2be 100644 --- a/Source/Diagnostics/SliceDiagnostic.cpp +++ b/Source/Diagnostics/SliceDiagnostic.cpp @@ -153,7 +153,7 @@ CreateSlice( const MultiFab& mf, const Vector &dom_geom, ablastr::utils::communication::ParallelCopy(*smf, mf, 0, 0, ncomp, nghost_vect, nghost_vect, WarpX::do_single_precision_comms); // interpolate if required on refined slice // - if (interpolate == 1 ) { + if (interpolate) { InterpolateSliceValues( *smf, interp_lo, slice_cc_nd_box, dom_geom, ncomp, nghost, slice_lo, slice_hi, SliceType, real_box); } diff --git a/Source/Evolve/WarpXEvolve.cpp b/Source/Evolve/WarpXEvolve.cpp index 8b2cc2c33f1..7bdba64dc4e 100644 --- a/Source/Evolve/WarpXEvolve.cpp +++ b/Source/Evolve/WarpXEvolve.cpp @@ -142,7 +142,7 @@ WarpX::Evolve (int numsteps) OneStep_multiJ(cur_time); } // Electromagnetic case: no subcycling or no mesh refinement - else if (do_subcycling == 0 || finest_level == 0) + else if ( !do_subcycling || (finest_level == 0)) { OneStep_nosub(cur_time); // E: guard cells are up-to-date @@ -150,7 +150,7 @@ WarpX::Evolve (int numsteps) // F: guard cells are NOT up-to-date } // Electromagnetic case: subcycling with one level of mesh refinement - else if (do_subcycling == 1 && finest_level == 1) + else if (do_subcycling && (finest_level == 1)) { OneStep_sub1(cur_time); } diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 9a4c46b1c10..8af0ce23ce8 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -294,19 +294,19 @@ WarpX::PrintMainPICparameters () " | - v_comoving = (" << m_v_comoving[0] << "," << m_v_comoving[1] << "," << m_v_comoving[2] << ")\n"; } - if (WarpX::update_with_rho==1) { + if (WarpX::update_with_rho) { amrex::Print() << " | - update with rho is ON \n"; } - if (current_correction==1) { + if (current_correction) { amrex::Print() << " | - current correction is ON \n"; } - if (WarpX::do_dive_cleaning==1) { + if (WarpX::do_dive_cleaning) { amrex::Print() << " | - div(E) cleaning is ON \n"; } - if (WarpX::do_divb_cleaning==1) { + if (WarpX::do_divb_cleaning) { amrex::Print() << " | - div(B) cleaning is ON \n"; } - if (do_multi_J == 1){ + if (do_multi_J){ amrex::Print() << " | - multi-J deposition is ON \n"; amrex::Print() << " | - do_multi_J_n_depositions = " << WarpX::do_multi_J_n_depositions << "\n"; @@ -323,7 +323,7 @@ WarpX::PrintMainPICparameters () amrex::Print() << " | - rho_in_time = constant \n"; } } - if (fft_do_time_averaging == 1){ + if (fft_do_time_averaging){ amrex::Print()<<" | - time-averaged is ON \n"; } #endif // WARPX_USE_FFT diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp index 321be15df7e..bf010736853 100644 --- a/Source/Parallelization/GuardCellManager.cpp +++ b/Source/Parallelization/GuardCellManager.cpp @@ -59,9 +59,9 @@ guardCellManager::Init ( // When using subcycling, the particles on the fine level perform two pushes // before being redistributed ; therefore, we need one extra guard cell // (the particles may move by 2*c*dt) - int ngx_tmp = (max_level > 0 && do_subcycling == 1) ? nox+1 : nox; - int ngy_tmp = (max_level > 0 && do_subcycling == 1) ? nox+1 : nox; - int ngz_tmp = (max_level > 0 && do_subcycling == 1) ? nox+1 : nox; + int ngx_tmp = (max_level > 0 && do_subcycling) ? nox+1 : nox; + int ngy_tmp = (max_level > 0 && do_subcycling) ? nox+1 : nox; + int ngz_tmp = (max_level > 0 && do_subcycling) ? nox+1 : nox; const bool galilean = (v_galilean[0] != 0. || v_galilean[1] != 0. || v_galilean[2] != 0.); const bool comoving = (v_comoving[0] != 0. || v_comoving[1] != 0. || v_comoving[2] != 0.); diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index 89ae435882b..3a30467c20d 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -1065,7 +1065,7 @@ PhysicalParticleContainer::AddPlasma (PlasmaInjector const& plasma_injector, int static_cast(std::round((overlap_realbox.lo(dir)-problo[dir])/dx[dir])); // shifted is exact in non-moving-window direction. That's all we care. } - if (no_overlap == 1) { + if (no_overlap) { continue; // Go to the next tile } @@ -1640,7 +1640,7 @@ PhysicalParticleContainer::AddPlasmaFlux (PlasmaInjector const& plasma_injector, // shifted is exact in non-moving-window direction. That's all we care. } } - if (no_overlap == 1) { + if (no_overlap) { continue; // Go to the next tile } diff --git a/Source/Utils/WarpXTagging.cpp b/Source/Utils/WarpXTagging.cpp index f88380e2589..b6eb2fda5d2 100644 --- a/Source/Utils/WarpXTagging.cpp +++ b/Source/Utils/WarpXTagging.cpp @@ -61,7 +61,7 @@ WarpX::ErrorEst (int lev, TagBoxArray& tags, Real /*time*/, int /*ngrow*/) } else { tag_val = (pos > ftlo && pos < fthi); } - if ( tag_val == 1) { + if (tag_val) { fab(i,j,k) = TagBox::SET; } }); diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 87fc5f2633d..fcd10418b23 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -2457,7 +2457,7 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm AllocInitMultiFab(phi_fp[lev], amrex::convert(ba, phi_nodal_flag), dm, ncomps, ngPhi, lev, "phi_fp", 0.0_rt); } - if (do_subcycling == 1 && lev == 0) + if (do_subcycling && lev == 0) { AllocInitMultiFab(current_store[lev][0], amrex::convert(ba,jx_nodal_flag),dm,ncomps,ngJ,lev, "current_store[x]"); AllocInitMultiFab(current_store[lev][1], amrex::convert(ba,jy_nodal_flag),dm,ncomps,ngJ,lev, "current_store[y]");