Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more warnings #272

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Exec/RegTests/EnclosedInjection/pelelmex_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AMReX_ParmParse.H>

void
PeleLM::readProbParm()
PeleLM::readProbParm() // NOLINT(readability-make-member-function-const)
{
amrex::ParmParse pp("prob");

Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/HotBubble/pelelmex_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AMReX_ParmParse.H>

void
PeleLM::readProbParm()
PeleLM::readProbParm() // NOLINT(readability-make-member-function-const)
{
amrex::ParmParse pp("prob");

Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/TaylorGreen/pelelmex_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AMReX_ParmParse.H>

void
PeleLM::readProbParm()
PeleLM::readProbParm() // NOLINT(readability-make-member-function-const)
{
amrex::ParmParse pp("prob");

Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/TurbInflow/pelelmex_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AMReX_ParmParse.H>

void
PeleLM::readProbParm()
PeleLM::readProbParm() // NOLINT(readability-make-member-function-const)
{
amrex::ParmParse pp("prob");

Expand Down
18 changes: 9 additions & 9 deletions Source/PeleLMeX.H
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public:
* using the data from a pltfile
* \param a_pltFile path to PeleLMeX plot file
*/
void initLevelDataFromPlt(int a_lev, const std::string& a_datPltFile);
void initLevelDataFromPlt(int a_lev, const std::string& a_dataPltFile);

/**
* \brief Project the initial solution velocity field,
Expand Down Expand Up @@ -570,9 +570,9 @@ public:
*/
void addWbarTerm(
const amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>>&
a_fluxes,
a_spfluxes,
const amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>>&
a_wbarfluxes,
a_spwbarfluxes,
amrex::Vector<amrex::MultiFab const*> const& a_spec,
amrex::Vector<amrex::MultiFab const*> const& a_rho,
amrex::Vector<amrex::MultiFab const*> const& a_beta);
Expand Down Expand Up @@ -602,7 +602,7 @@ public:
*/
void adjustSpeciesFluxes(
const amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>>&
a_fluxes,
a_spfluxes,
amrex::Vector<amrex::MultiFab const*> const& a_spec);

/**
Expand Down Expand Up @@ -1203,7 +1203,7 @@ public:
int const* l_conserv_d,
const amrex::Geometry& a_geom,
amrex::Real scale,
bool fluxes_are_area_weighted);
bool fluxes_are_area_weighted) const;

void extFluxDivergenceLevel(
int lev,
Expand Down Expand Up @@ -1312,7 +1312,7 @@ public:

void makeEBGeometry();

int getRestartEBMaxLevel();
int getRestartEBMaxLevel() const;

void initialRedistribution();

Expand All @@ -1331,7 +1331,7 @@ public:
int state_comp,
int ncomp,
const amrex::BCRec* d_bc,
const amrex::Geometry& a_geom);
const amrex::Geometry& a_geom) const;

void redistributeDiff(
int a_lev,
Expand All @@ -1344,9 +1344,9 @@ public:
int state_comp,
int ncomp,
const amrex::BCRec* d_bc,
const amrex::Geometry& a_geom);
const amrex::Geometry& a_geom) const;

void getCoveredIMask(int a_lev, amrex::iMultiFab& a_imask);
void getCoveredIMask(int a_lev, amrex::iMultiFab& a_imask) const;

void getEBDistance(int a_lev, amrex::MultiFab& a_signDistLev);

Expand Down
5 changes: 3 additions & 2 deletions Source/PeleLMeX_BC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@
#endif

InterpBase*
PeleLM::getInterpolator(int a_method)
PeleLM::
getInterpolator( // NOLINT(readability-convert-member-functions-to-static)

Check warning on line 53 in Source/PeleLMeX_BC.cpp

View workflow job for this annotation

GitHub Actions / Lint-clang-tidy (EB-ON)

method 'getInterpolator' can be made const [readability-make-member-function-const]
int a_method)
{

InterpBase* mapper = nullptr;

if (a_method == 0) {
Expand Down
3 changes: 2 additions & 1 deletion Source/PeleLMeX_DeriveFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ pelelmex_dercoord(
const FArrayBox&
#ifdef AMREX_USE_EB
statefab
#else
/*unused*/
#endif
,
const FArrayBox& /*reactfab*/,
Expand All @@ -613,7 +615,6 @@ pelelmex_dercoord(
Real /*time*/,
const Vector<BCRec>& /*bcrec*/,
int /*level*/)

{
amrex::ignore_unused(ncomp);
AMREX_ASSERT(derfab.box().contains(bx));
Expand Down
3 changes: 2 additions & 1 deletion Source/PeleLMeX_Diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ PeleLM::computeDifferentialDiffusionTerms(
if (a_time == AmrOldTime) {
AMREX_ASSERT(diffData->Dn.size() == finest_level + 1);
AMREX_ASSERT(diffData->Dn[0].nComp() >= NUM_SPECIES + 2);
} else {
}
if (a_time != AmrOldTime) {
AMREX_ASSERT(diffData->Dnp1.size() == finest_level + 1);
AMREX_ASSERT(diffData->Dnp1[0].nComp() >= NUM_SPECIES + 2);
}
Expand Down
23 changes: 9 additions & 14 deletions Source/PeleLMeX_EB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ PeleLM::redistributeAofS(
int state_comp,
int ncomp,
const BCRec* d_bc,
const Geometry& a_geom)
const Geometry& a_geom) const
{
BL_PROFILE("PeleLMeX::redistributeAofS()");
AMREX_ASSERT(a_tmpDiv.nComp() >= div_comp + ncomp);
Expand Down Expand Up @@ -137,7 +137,7 @@ PeleLM::redistributeAofS(
}

void
PeleLM::getCoveredIMask(int a_lev, iMultiFab& a_imask)
PeleLM::getCoveredIMask(int a_lev, iMultiFab& a_imask) const
{
const auto& ebfact = EBFactory(a_lev);
const auto& flags = ebfact.getMultiEBCellFlagFab();
Expand Down Expand Up @@ -196,7 +196,7 @@ PeleLM::redistributeDiff(
int state_comp,
int ncomp,
const BCRec* d_bc,
const Geometry& a_geom)
const Geometry& a_geom) const
{
BL_PROFILE("PeleLMeX::redistributeDiff()");
AMREX_ASSERT(a_tmpDiv.nComp() >= div_comp + ncomp);
Expand Down Expand Up @@ -425,7 +425,7 @@ PeleLM::getEBDistance(int a_lev, MultiFab& a_signDistLev)

// Get signDist on coarsen fineBA
BoxArray coarsenBA(grids[lev].size());
for (int j = 0, N = coarsenBA.size(); j < N; ++j) {
for (int j = 0, N = static_cast<int>(coarsenBA.size()); j < N; ++j) {
coarsenBA.set(
j, interpolater.CoarseBox(grids[lev][j], refRatio(lev - 1)));
}
Expand Down Expand Up @@ -609,17 +609,12 @@ PeleLM::correct_vel_small_cells(
,
const auto& wmac_fab = (a_umac[lev][2])->const_array(mfi););

if (flags.getType(amrex::grow(bx, 0)) == FabType::covered) {
// do nothing
}

// No cut cells in this FAB
else if (flags.getType(amrex::grow(bx, 1)) == FabType::regular) {
if (
(flags.getType(amrex::grow(bx, 0)) == FabType::covered) ||
(flags.getType(amrex::grow(bx, 1)) == FabType::regular)) {
// do nothing
}

// Cut cells in this FAB
else {
} else { // Cut cells in this FAB
// Face-centered areas
AMREX_D_TERM(const auto& apx_fab =
EBFactory(lev).getAreaFrac()[0]->const_array(mfi);
Expand Down Expand Up @@ -662,7 +657,7 @@ PeleLM::correct_vel_small_cells(
}

int
PeleLM::getRestartEBMaxLevel()
PeleLM::getRestartEBMaxLevel() const
{
if (m_restart_chkfile.empty()) {
return -1;
Expand Down
4 changes: 2 additions & 2 deletions Source/PeleLMeX_Evolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ PeleLM::checkMessage(const std::string& a_action) const
if (m_nstep % m_message_int == 0) {
int action_flag = 0;
if (ParallelDescriptor::IOProcessor()) {
FILE* fp;
if ((fp = fopen(action_file.c_str(), "r")) != nullptr) {
FILE* fp = fopen(action_file.c_str(), "r");
if (fp != nullptr) {
remove(action_file.c_str());
action_flag = 1;
fclose(fp);
Expand Down
9 changes: 7 additions & 2 deletions Source/PeleLMeX_Projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,9 @@ PeleLM::doNodalProject(
}

void
PeleLM::scaleProj_RZ(int a_lev, MultiFab& a_mf)
PeleLM::scaleProj_RZ( // NOLINT(readability-convert-member-functions-to-static)
int a_lev,
MultiFab& a_mf)
{
#if AMREX_SPACEDIM == 2
// Scale nodal projection cell-centered mfs by radius
Expand Down Expand Up @@ -540,7 +542,10 @@ PeleLM::scaleProj_RZ(int a_lev, MultiFab& a_mf)
}

void
PeleLM::unscaleProj_RZ(int a_lev, MultiFab& a_mf)
PeleLM::
unscaleProj_RZ( // NOLINT(readability-convert-member-functions-to-static)
int a_lev,
MultiFab& a_mf)
{
#if AMREX_SPACEDIM == 2
// Unscale nodal projection cell-centered mfs by radius
Expand Down
29 changes: 15 additions & 14 deletions Source/PeleLMeX_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,20 +500,21 @@ PeleLM::intFluxDivergenceLevelEB(
}

void
PeleLM::advFluxDivergence(
int a_lev,
MultiFab& a_divergence,
int div_comp,
MultiFab& a_divu,
const Array<const MultiFab*, AMREX_SPACEDIM>& a_fluxes,
int flux_comp,
const Array<const MultiFab*, AMREX_SPACEDIM>& a_faceState,
int face_comp,
int ncomp,
int const* l_conserv_d,
const Geometry& a_geom,
amrex::Real scale,
bool fluxes_are_area_weighted)
PeleLM::
advFluxDivergence( // NOLINT(readability-convert-member-functions-to-static)
int a_lev,
MultiFab& a_divergence,
int div_comp,
MultiFab& a_divu,
const Array<const MultiFab*, AMREX_SPACEDIM>& a_fluxes,
int flux_comp,
const Array<const MultiFab*, AMREX_SPACEDIM>& a_faceState,
int face_comp,
int ncomp,
int const* l_conserv_d,
const Geometry& a_geom,
amrex::Real scale,
bool fluxes_are_area_weighted) const
{
BL_PROFILE("PeleLMeX::advFluxDivergence()");

Expand Down
Loading