Skip to content

Commit

Permalink
Fix some clang-tidy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel committed Dec 21, 2023
1 parent b3d6640 commit 373fc73
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Source/PeleLMeX_Advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions Source/PeleLMeX_Plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ PeleLM::WritePlotFile()
#endif

#ifdef PELE_USE_RADIATION
if (do_rad_solve)
if (do_rad_solve) {
ncomp += 3;
}
#endif

// Derive
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions Source/PeleLMeX_Radiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/PeleLMeX_Setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,15 +584,15 @@ 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();
#endif
#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
Expand Down
4 changes: 2 additions & 2 deletions Source/PeleLMeX_Soot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Source/PeleLMeX_SprayParticles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()");
Expand Down
4 changes: 2 additions & 2 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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
Expand Down
Binary file added Tests/__pycache__/test_masscons.cpython-39.pyc
Binary file not shown.

0 comments on commit 373fc73

Please sign in to comment.