diff options
author | 2023-08-01 13:38:19 +0200 | |
---|---|---|
committer | 2023-08-01 13:38:19 +0200 | |
commit | 0aa12461bd956e9e9a08e0ac3b8e2c2263aa7661 (patch) | |
tree | 3a96aabdc6ad518c2d1300800aaa8ee2cafebba3 /Source/WarpX.cpp | |
parent | 63dc76ff15c1c8660f30e1ff1cfcb9c2f04db814 (diff) | |
download | WarpX-0aa12461bd956e9e9a08e0ac3b8e2c2263aa7661.tar.gz WarpX-0aa12461bd956e9e9a08e0ac3b8e2c2263aa7661.tar.zst WarpX-0aa12461bd956e9e9a08e0ac3b8e2c2263aa7661.zip |
Clang tidy CI test: add several readability checks to clang tidy CI test (#4124)
* add few readability checks to clang-tidy CI test
* address all the issues found with clang-tidy
* fix bug
* fixed bug
* fix residual issue
* fix issue found with clang-tidy
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index f5826fd93..24e3ceb30 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -1144,7 +1144,7 @@ WarpX::ReadParameters () // - field_gathering_algo set to "default" above // (default defined in Utils/WarpXAlgorithmSelection.cpp) // - reset default value here for hybrid grids - if (pp_algo.query("field_gathering", tmp_algo) == false) + if (!pp_algo.query("field_gathering", tmp_algo)) { if (grid_type == GridType::Hybrid) { @@ -1371,7 +1371,7 @@ WarpX::ReadParameters () J_in_time = GetAlgorithmInteger(pp_psatd, "J_in_time"); rho_in_time = GetAlgorithmInteger(pp_psatd, "rho_in_time"); - if (psatd_solution_type != PSATDSolutionType::FirstOrder || do_multi_J == false) + if (psatd_solution_type != PSATDSolutionType::FirstOrder || !do_multi_J) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE( rho_in_time == RhoInTime::Linear, @@ -1396,7 +1396,7 @@ WarpX::ReadParameters () pp_psatd.query("current_correction", current_correction); - if (current_correction == false && + if (!current_correction && current_deposition_algo != CurrentDepositionAlgo::Esirkepov && current_deposition_algo != CurrentDepositionAlgo::Vay) { @@ -1415,18 +1415,18 @@ WarpX::ReadParameters () if (WarpX::current_deposition_algo == CurrentDepositionAlgo::Vay) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE( - fft_periodic_single_box == false, + !fft_periodic_single_box, "Option algo.current_deposition=vay must be used with psatd.periodic_single_box_fft=0."); } if (current_deposition_algo == CurrentDepositionAlgo::Vay) { WARPX_ALWAYS_ASSERT_WITH_MESSAGE( - current_correction == false, + !current_correction, "Options algo.current_deposition=vay and psatd.current_correction=1 cannot be combined together."); } - // Auxiliary: boosted_frame = true if warpx.gamma_boost is set in the inputs + // Auxiliary: boosted_frame = true if WarpX::gamma_boost is set in the inputs const amrex::ParmParse pp_warpx("warpx"); const bool boosted_frame = pp_warpx.query("gamma_boost", gamma_boost); @@ -1436,10 +1436,10 @@ WarpX::ReadParameters () WARPX_ALWAYS_ASSERT_WITH_MESSAGE( !use_default_v_galilean || boosted_frame, - "psatd.use_default_v_galilean = 1 can be used only if warpx.gamma_boost is also set" + "psatd.use_default_v_galilean = 1 can be used only if WarpX::gamma_boost is also set" ); - if (use_default_v_galilean == true && boosted_frame == true) + if (use_default_v_galilean && boosted_frame) { m_v_galilean[2] = -std::sqrt(1._rt - 1._rt / (gamma_boost * gamma_boost)); } @@ -1455,10 +1455,10 @@ WarpX::ReadParameters () WARPX_ALWAYS_ASSERT_WITH_MESSAGE( !use_default_v_comoving || boosted_frame, - "psatd.use_default_v_comoving = 1 can be used only if warpx.gamma_boost is also set" + "psatd.use_default_v_comoving = 1 can be used only if WarpX::gamma_boost is also set" ); - if (use_default_v_comoving == true && boosted_frame == true) + if (use_default_v_comoving && boosted_frame) { m_v_comoving[2] = -std::sqrt(1._rt - 1._rt / (gamma_boost * gamma_boost)); } @@ -1509,7 +1509,7 @@ WarpX::ReadParameters () # else if (m_v_galilean[0] == 0. && m_v_galilean[1] == 0. && m_v_galilean[2] == 0. && m_v_comoving[0] == 0. && m_v_comoving[1] == 0. && m_v_comoving[2] == 0.) { - update_with_rho = (do_dive_cleaning) ? true : false; // standard PSATD + update_with_rho = do_dive_cleaning; // standard PSATD } else { update_with_rho = true; // Galilean PSATD or comoving PSATD @@ -1583,7 +1583,7 @@ WarpX::ReadParameters () // Without periodic single box, fill guard cells with backward FFTs, // with current correction or Vay deposition - if (fft_periodic_single_box == false) + if (!fft_periodic_single_box) { if (current_correction || current_deposition_algo == CurrentDepositionAlgo::Vay) @@ -2346,7 +2346,7 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm realspace_ba.enclosedCells(); // Make it cell-centered // Define spectral solver # ifdef WARPX_DIM_RZ - if ( fft_periodic_single_box == false ) { + if ( !fft_periodic_single_box ) { realspace_ba.grow(1, ngEB[1]); // add guard cells only in z } if (field_boundary_hi[0] == FieldBoundaryType::PML && !do_pml_in_domain) { @@ -2360,7 +2360,7 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm dm, dx); # else - if ( fft_periodic_single_box == false ) { + if ( !fft_periodic_single_box ) { realspace_ba.grow(ngEB); // add guard cells } bool const pml_flag_false = false; |