From 373fc73176832b29adc6e4a27e38125625bc96d3 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Wed, 20 Dec 2023 19:07:54 -0700 Subject: [PATCH] Fix some clang-tidy warnings. --- Source/PeleLMeX_Advance.cpp | 2 +- Source/PeleLMeX_Plot.cpp | 6 ++++-- Source/PeleLMeX_Radiation.cpp | 5 +++-- Source/PeleLMeX_Setup.cpp | 4 ++-- Source/PeleLMeX_Soot.cpp | 4 ++-- Source/PeleLMeX_SprayParticles.cpp | 2 +- Submodules/PelePhysics | 2 +- Tests/CMakeLists.txt | 4 ++-- Tests/__pycache__/test_masscons.cpython-39.pyc | Bin 0 -> 977 bytes 9 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 Tests/__pycache__/test_masscons.cpython-39.pyc diff --git a/Source/PeleLMeX_Advance.cpp b/Source/PeleLMeX_Advance.cpp index 5dbd513a..ab75e159 100644 --- a/Source/PeleLMeX_Advance.cpp +++ b/Source/PeleLMeX_Advance.cpp @@ -111,7 +111,7 @@ PeleLM::Advance(int is_initIter) //---------------------------------------------------------------- #ifdef PELE_USE_SPRAY - if (!is_initIter) { + if (is_initIter == 0) { SprayMKD(m_cur_time, m_dt); } #endif diff --git a/Source/PeleLMeX_Plot.cpp b/Source/PeleLMeX_Plot.cpp index 606f587e..a5cbedce 100644 --- a/Source/PeleLMeX_Plot.cpp +++ b/Source/PeleLMeX_Plot.cpp @@ -121,8 +121,9 @@ PeleLM::WritePlotFile() #endif #ifdef PELE_USE_RADIATION - if (do_rad_solve) + if (do_rad_solve) { ncomp += 3; + } #endif // Derive @@ -837,8 +838,9 @@ PeleLM::initLevelDataFromPlt(int a_lev, const std::string& a_dataPltFile) iPhiV = i; #endif #ifdef PELE_USE_SOOT - if (plt_vars[i] == "soot_N") + if (plt_vars[i] == "soot_N") { inSoot = i; + } #endif } if (idY < 0) { diff --git a/Source/PeleLMeX_Radiation.cpp b/Source/PeleLMeX_Radiation.cpp index a0dee821..50f449da 100644 --- a/Source/PeleLMeX_Radiation.cpp +++ b/Source/PeleLMeX_Radiation.cpp @@ -18,8 +18,9 @@ PeleLM::RadInit() rc.h2oIndx = i; continue; } - if (names[i] == "CO") + if (names[i] == "CO") { rc.coIndx = i; + } } amrex::ParmParse mlmgpp("pelerad"); @@ -42,7 +43,7 @@ PeleLM::computeRadSource(const PeleLM::TimeStamp& a_timestamp) BL_PROFILE_VAR("PeleLM::advance::rad::spec", PLM_RAD_SPEC); for (int lev = 0; lev <= finest_level; lev++) { - auto ldata_p = PeleLM::getLevelDataPtr(lev, a_timestamp); + auto* ldata_p = PeleLM::getLevelDataPtr(lev, a_timestamp); #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif diff --git a/Source/PeleLMeX_Setup.cpp b/Source/PeleLMeX_Setup.cpp index fe9ed466..fd82afd3 100644 --- a/Source/PeleLMeX_Setup.cpp +++ b/Source/PeleLMeX_Setup.cpp @@ -584,7 +584,7 @@ PeleLM::readParameters() #ifdef PELE_USE_SOOT do_soot_solve = true; pp.query("do_soot_solve", do_soot_solve); - if (m_verbose && do_soot_solve) { + if ((m_verbose != 0) && do_soot_solve) { Print() << "Simulation performed with soot modeling \n"; } soot_model->readSootParams(); @@ -592,7 +592,7 @@ PeleLM::readParameters() #ifdef PELE_USE_RADIATION do_rad_solve = false; pp.query("do_rad_solve", do_rad_solve); - if (m_verbose && do_rad_solve) { + if ((m_verbose != 0) && do_rad_solve) { Print() << "Simulation performed with radiation modeling \n"; } #endif diff --git a/Source/PeleLMeX_Soot.cpp b/Source/PeleLMeX_Soot.cpp index 4a1ce5c5..8bd3eef4 100644 --- a/Source/PeleLMeX_Soot.cpp +++ b/Source/PeleLMeX_Soot.cpp @@ -35,7 +35,7 @@ PeleLM::computeSootSource(const PeleLM::TimeStamp& a_timestamp, const Real a_dt) { bool pres_term = false; // Do not include change in pressure in energy for (int lev = 0; lev <= finest_level; lev++) { - auto ldata_p = getLevelDataPtr(lev, a_timestamp); + auto* ldata_p = getLevelDataPtr(lev, a_timestamp); Real time = getTime(lev, a_timestamp); #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) @@ -56,7 +56,7 @@ void PeleLM::clipSootMoments() { for (int lev = 0; lev <= finest_level; lev++) { - auto ldata_p = getLevelDataPtr(lev, AmrNewTime); + auto* ldata_p = getLevelDataPtr(lev, AmrNewTime); #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif diff --git a/Source/PeleLMeX_SprayParticles.cpp b/Source/PeleLMeX_SprayParticles.cpp index ae5fc243..2ab14b40 100644 --- a/Source/PeleLMeX_SprayParticles.cpp +++ b/Source/PeleLMeX_SprayParticles.cpp @@ -269,7 +269,7 @@ PeleLM::SprayMKD(const Real time, const Real dt) if (!do_spray_particles) { return; } - if (spray_verbose) { + if (spray_verbose != 0) { Print() << "moveKickDrift ... updating particle positions and velocity\n"; } BL_PROFILE("PeleLMeX::SprayMKD()"); diff --git a/Submodules/PelePhysics b/Submodules/PelePhysics index d0f282c2..dfec29a6 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit d0f282c26cbbccd076ed5d6e7527fa83107d4b7f +Subproject commit dfec29a67633843cf9df45ac369585a9bae32c31 diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e40b820b..415fa353 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -45,7 +45,7 @@ macro(setup_test) set(PLOT_TEST ${CURRENT_TEST_BINARY_DIR}/plt00010) # Find fcompare if(PELE_ENABLE_FCOMPARE_FOR_TESTS) - set(FCOMPARE ${CMAKE_BINARY_DIR}/Submodules/PelePhysics/Submodules/amrex/Tools/Plotfile/fcompare) + set(FCOMPARE ${CMAKE_BINARY_DIR}/Submodules/PelePhysics/Submodules/amrex/Tools/Plotfile/amrex_fcompare) endif() # Make working directory for test file(MAKE_DIRECTORY ${CURRENT_TEST_BINARY_DIR}) @@ -196,7 +196,7 @@ function(add_test_spray TEST_EXE_DIR) set(PELE_NP 1) unset(MPI_COMMANDS) endif() - set(FCOMPARE ${CMAKE_BINARY_DIR}/Submodules/PelePhysics/Submodules/amrex/Tools/Plotfile/amrex.fcompare) + set(FCOMPARE ${CMAKE_BINARY_DIR}/Submodules/PelePhysics/Submodules/amrex/Tools/Plotfile/amrex_fcompare) set(MULTIRUN_FLAGS "--test_dir ${CURRENT_TEST_BINARY_DIR} --run_cmd '${MPI_COMMANDS}' --pele_exec ${PROJECT_NAME}-${TEST_EXE_DIR} --fcomp_exec ${FCOMPARE} --input_file ${TEST_NAME}.inp") file(GLOB TEST_FILES "${CURRENT_TEST_SOURCE_DIR}/*.dat" "${CURRENT_TEST_SOURCE_DIR}/*.py") # Copy files to test working directory diff --git a/Tests/__pycache__/test_masscons.cpython-39.pyc b/Tests/__pycache__/test_masscons.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6f204272b4c736a1a4dfa552e26dfe65b6eaab1 GIT binary patch literal 977 zcmZWo&2AGh5Vm){8z)Vm4L!gGa^a9mbL3K>qEb;2tq>FmSqRHrJMD)3!`>7cB^S!I z7oMQy#%u5xzH;IfI5D#UDH4`E`+3GQ{^n;@uh${4zP`OM?-(IJ@vyo;M|NPlXCO4u zG$Ug9rFkGiy2MOGjV%`OQ=$VMejz$E@uYPT3U1n(y$|f3iLW}>1U%>~GK_vfJaU+z zTwMVic3`{PAPf;y6A@@C!evy!G(&IS-7O1uWL&+goSEH2MfRpv&B4&cTx z_RQ6$@~lpC;~9EEp1H2Y8sfcd`sskEdyET%{6Y zG0~IHXZxo=?r%RFQo(FpW{1PJ4@&1*rRr1PQpa!?0GpI);e$#GZjI71ac35bN1hi-h%iI^%c=a9nK}DaNghK^bbs729*E+ literal 0 HcmV?d00001