Skip to content

Commit

Permalink
Fix more warnings. (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Sep 27, 2023
1 parent da066c5 commit 8aae0d0
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 63 deletions.
10 changes: 5 additions & 5 deletions Source/PeleLMeX.H
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public:
const amrex::Vector<amrex::MultiFab*>& a_sigma,
const amrex::Vector<amrex::MultiFab*>& rhs_cc,
const amrex::Vector<const amrex::MultiFab*>& rhs_nd,
int increment_gp,
int incremental,
amrex::Real scaling_factor);

/**
Expand Down Expand Up @@ -522,8 +522,8 @@ public:
int beta_comp,
int ncomp,
int doZeroVisc,
amrex::Vector<amrex::BCRec> a_bcrec,
const amrex::MultiFab& a_diff_cc,
amrex::Vector<amrex::BCRec> bcrec,
const amrex::MultiFab& beta_cc,
int addTurbContrib = 0);

/**
Expand Down Expand Up @@ -1025,7 +1025,7 @@ public:
void fillpatch_species(
int lev,
amrex::Real a_time,
amrex::MultiFab& a_rhoY,
amrex::MultiFab& a_species,
int rhoY_comp,
int nGhost);
void fillpatch_temp(
Expand All @@ -1042,7 +1042,7 @@ public:
int lev, amrex::Real a_time, amrex::MultiFab& a_I_R, int nGhost);
void fillpatch_forces(
amrex::Real a_time,
amrex::Vector<amrex::MultiFab*> const& a_velForces,
amrex::Vector<amrex::MultiFab*> const& a_force,
int nGrowForce);
void fillpatch_chemFunctCall(
int lev, amrex::Real a_time, amrex::MultiFab& a_fctC, int nGhost);
Expand Down
8 changes: 5 additions & 3 deletions Source/PeleLMeX_Advection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ PeleLM::computeVelocityAdvTerm(std::unique_ptr<AdvanceAdvData>& advData)

bool fluxes_are_area_weighted = false;
#ifdef AMREX_USE_EB
auto ldata_p = getLevelDataPtr(lev, AmrOldTime);
auto* ldata_p = getLevelDataPtr(lev, AmrOldTime);
//----------------------------------------------------------------
// Use a temporary MF to hold divergence before redistribution
int nGrow_divT = 3;
Expand Down Expand Up @@ -483,6 +483,7 @@ PeleLM::computeScalarAdvTerms(std::unique_ptr<AdvanceAdvData>& advData)
});
} else // Regular boxes
#endif
{
amrex::ParallelFor(
ebx,
[rho_ed, rhoY_ed] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
Expand All @@ -491,6 +492,7 @@ PeleLM::computeScalarAdvTerms(std::unique_ptr<AdvanceAdvData>& advData)
rho_ed(i, j, k) += rhoY_ed(i, j, k, n);
}
});
}
}
}

Expand Down Expand Up @@ -687,7 +689,7 @@ PeleLM::computeScalarAdvTerms(std::unique_ptr<AdvanceAdvData>& advData)

bool fluxes_are_area_weighted = false;
#ifdef AMREX_USE_EB
auto ldata_p = getLevelDataPtr(lev, AmrOldTime);
auto* ldata_p = getLevelDataPtr(lev, AmrOldTime);
//----------------------------------------------------------------
// Use a temporary MF to hold divergence before redistribution
int nGrow_divTmp = 3;
Expand Down Expand Up @@ -889,7 +891,7 @@ PeleLM::computePassiveAdvTerms(

bool fluxes_are_area_weighted = false;
#ifdef AMREX_USE_EB
auto ldata_p = getLevelDataPtr(lev, AmrOldTime);
auto* ldata_p = getLevelDataPtr(lev, AmrOldTime);
//----------------------------------------------------------------
// Use a temporary MF to hold divergence before redistribution
int nGrow_divTmp = 3;
Expand Down
72 changes: 36 additions & 36 deletions Source/PeleLMeX_Derive.H
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@
// Forward declaration of PeleLM
class PeleLM;

typedef void (*PeleLMDeriveFunc)(
PeleLM* a_pelelm,
const amrex::Box& bx,
amrex::FArrayBox& derfab,
int dcomp,
int ncomp,
const amrex::FArrayBox& statefab,
const amrex::FArrayBox& reactfab,
const amrex::FArrayBox& pressfab,
const amrex::Geometry& geomdata,
amrex::Real time,
const amrex::Vector<amrex::BCRec>& bcrec,
int level);

typedef void (*PeleLMMFVecDeriveFunc)(
amrex::Vector<amrex::MultiFab*> derfab,
int dcomp,
int ncomp,
amrex::Vector<const amrex::MultiFab*> statefab,
amrex::Vector<const amrex::MultiFab*> reactfab,
amrex::Vector<const amrex::MultiFab*> pressfab,
const amrex::Geometry& geomdata,
amrex::Real time,
const amrex::Vector<amrex::BCRec>& bcrec);
using PeleLMDeriveFunc = void (*)(
PeleLM*,
const amrex::Box&,
amrex::FArrayBox&,
int,
int,
const amrex::FArrayBox&,
const amrex::FArrayBox&,
const amrex::FArrayBox&,
const amrex::Geometry&,
amrex::Real,
const amrex::Vector<amrex::BCRec>&,
int);

using PeleLMMFVecDeriveFunc = void (*)(
amrex::Vector<amrex::MultiFab*>,
int,
int,
amrex::Vector<const amrex::MultiFab*>,
amrex::Vector<const amrex::MultiFab*>,
amrex::Vector<const amrex::MultiFab*>,
const amrex::Geometry&,
amrex::Real,
const amrex::Vector<amrex::BCRec>&);
class PeleLMDeriveRec
{
friend class PeleLMDeriveList;

public:
typedef amrex::Box (*DeriveBoxMap)(const amrex::Box&);
using DeriveBoxMap = amrex::Box (*)(const amrex::Box&);
static amrex::Box TheSameBox(const amrex::Box& box) noexcept;
static amrex::Box GrowBoxByOne(const amrex::Box& box) noexcept;

Expand All @@ -66,7 +66,7 @@ public:
*
* \param name
*/
int variableComp(const std::string& variableName) const noexcept;
int variableComp(const std::string& a_name) const noexcept;

/**
* \brief The IndexType of the derived type.
Expand Down Expand Up @@ -232,9 +232,9 @@ public:
void add(
const std::string& name,
amrex::IndexType result_type,
int nvar_derive,
int nvar_der,
PeleLMDeriveFunc der_func,
PeleLMDeriveRec::DeriveBoxMap box_map,
PeleLMDeriveRec::DeriveBoxMap bx_map,
amrex::Interpolater* interp = &amrex::pc_interp);

/**
Expand All @@ -251,10 +251,10 @@ public:
void add(
const std::string& name,
amrex::IndexType result_type,
int nvar_derive,
amrex::Vector<std::string>& var_names,
int nvar_der,
amrex::Vector<std::string>& vars,
PeleLMDeriveFunc der_func,
PeleLMDeriveRec::DeriveBoxMap box_map,
PeleLMDeriveRec::DeriveBoxMap bx_map,
amrex::Interpolater* interp = &amrex::pc_interp);

/**
Expand All @@ -270,8 +270,8 @@ public:
void add(
const std::string& name,
amrex::IndexType result_type,
int nvar_derive,
PeleLMDeriveRec::DeriveBoxMap box_map,
int nvar_der,
PeleLMDeriveRec::DeriveBoxMap bx_map,
amrex::Interpolater* interp = &amrex::pc_interp);

/**
Expand All @@ -288,9 +288,9 @@ public:
void add(
const std::string& name,
amrex::IndexType result_type,
int nvar_derive,
amrex::Vector<std::string>& var_names,
PeleLMDeriveRec::DeriveBoxMap box_map,
int nvar_der,
amrex::Vector<std::string>& vars,
PeleLMDeriveRec::DeriveBoxMap bx_map,
amrex::Interpolater* interp = &amrex::pc_interp);

std::list<PeleLMDeriveRec>& dlist();
Expand Down
13 changes: 7 additions & 6 deletions Source/PeleLMeX_DeriveFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pelelmex_dermgvort(
auto const& vort_arr = derfab.array(dcomp);

#ifdef AMREX_USE_EB
const EBFArrayBox& ebfab = static_cast<EBFArrayBox const&>(statefab);
const auto& ebfab = static_cast<EBFArrayBox const&>(statefab);
const EBCellFlagFab& flags = ebfab.getEBCellFlagFab();

auto typ = flags.getType(bx);
Expand Down Expand Up @@ -453,7 +453,7 @@ pelelmex_dervort(
auto const& vort_arr = derfab.array(dcomp);

#ifdef AMREX_USE_EB
const EBFArrayBox& ebfab = static_cast<EBFArrayBox const&>(statefab);
const auto& ebfab = static_cast<EBFArrayBox const&>(statefab);
const EBCellFlagFab& flags = ebfab.getEBCellFlagFab();

auto typ = flags.getType(bx);
Expand Down Expand Up @@ -627,7 +627,7 @@ pelelmex_dercoord(

#ifdef AMREX_USE_EB
AMREX_ASSERT(statefab.box().contains(bx));
const EBFArrayBox& ebfab = static_cast<EBFArrayBox const&>(statefab);
const auto& ebfab = static_cast<EBFArrayBox const&>(statefab);
const EBCellFlagFab& flags = ebfab.getEBCellFlagFab();

auto typ = flags.getType(bx);
Expand Down Expand Up @@ -712,7 +712,7 @@ pelelmex_derQcrit(
auto const& qcrit_arr = derfab.array(dcomp);

#ifdef AMREX_USE_EB
const EBFArrayBox& ebfab = static_cast<EBFArrayBox const&>(statefab);
const auto& ebfab = static_cast<EBFArrayBox const&>(statefab);
const EBCellFlagFab& flags = ebfab.getEBCellFlagFab();

auto typ = flags.getType(bx);
Expand Down Expand Up @@ -984,7 +984,7 @@ pelelmex_derenstrophy(
auto const& ens_arr = derfab.array(dcomp);

#ifdef AMREX_USE_EB
const EBFArrayBox& ebfab = static_cast<EBFArrayBox const&>(statefab);
const auto& ebfab = static_cast<EBFArrayBox const&>(statefab);
const EBCellFlagFab& flags = ebfab.getEBCellFlagFab();

auto typ = flags.getType(bx);
Expand Down Expand Up @@ -1356,7 +1356,8 @@ pelelmex_derdiffc(
AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp);
if (a_pelelm->m_use_soret != 0) {
AMREX_ASSERT(ncomp == 2 * NUM_SPECIES);
} else {
}
if (a_pelelm->m_use_soret == 0) {
AMREX_ASSERT(ncomp == NUM_SPECIES);
}
FArrayBox dummies(bx, 2, The_Async_Arena());
Expand Down
8 changes: 0 additions & 8 deletions Source/PeleLMeX_DiffusionOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,12 +425,8 @@ DiffusionOp::diffuse_scalar(
Array<MultiFab, AMREX_SPACEDIM> bcoeff_ec = m_pelelm->getDiffusivity(
lev, bcoeff_comp + comp, m_ncomp, doZeroVisc, subBCRec,
*a_bcoeff[lev]);
#ifdef AMREX_USE_EB
m_scal_solve_op->setBCoeffs(
lev, GetArrOfConstPtrs(bcoeff_ec), MLMG::Location::FaceCentroid);
#else
m_scal_solve_op->setBCoeffs(lev, GetArrOfConstPtrs(bcoeff_ec));
#endif
} else {
m_scal_solve_op->setBCoeffs(lev, 1.0);
}
Expand Down Expand Up @@ -463,11 +459,7 @@ DiffusionOp::diffuse_scalar(

// Need to get the fluxes
if (have_fluxes != 0) {
#ifdef AMREX_USE_EB
mlmg.getFluxes(fluxes, MLMG::Location::FaceCentroid);
#else
mlmg.getFluxes(fluxes, MLMG::Location::FaceCenter);
#endif

for (int lev = 0; lev <= finest_level; ++lev) {
for (int idim = 0; idim < AMREX_SPACEDIM; idim++) {
Expand Down
8 changes: 4 additions & 4 deletions Source/PeleLMeX_EB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ PeleLM::setCoveredState(int lev, const TimeStamp& a_time)
{
AMREX_ASSERT(a_time == AmrOldTime || a_time == AmrNewTime);

auto ldata_p = getLevelDataPtr(lev, a_time);
auto* ldata_p = getLevelDataPtr(lev, a_time);

if (m_incompressible != 0) {
EB_set_covered(ldata_p->state, 0, AMREX_SPACEDIM, coveredState_h);
Expand All @@ -333,8 +333,8 @@ PeleLM::initialRedistribution()

// Jungle with Old/New states: fillPatch old and redistribute
// from Old->New to end up with proper New state
auto ldataOld_p = getLevelDataPtr(lev, AmrOldTime);
auto ldataNew_p = getLevelDataPtr(lev, AmrNewTime);
auto* ldataOld_p = getLevelDataPtr(lev, AmrOldTime);
auto* ldataNew_p = getLevelDataPtr(lev, AmrNewTime);

auto const& fact = EBFactory(lev);

Expand Down Expand Up @@ -536,7 +536,7 @@ PeleLM::getEBDiff(
Array<const MultiCutFab*, AMREX_SPACEDIM> faceCentroid = ebfact.getFaceCent();

// Get diffusivity cell-centered
auto ldata_p = getLevelDataPtr(a_lev, a_time);
auto* ldata_p = getLevelDataPtr(a_lev, a_time);

MFItInfo mfi_info;
if (Gpu::notInLaunchRegion()) {
Expand Down
3 changes: 2 additions & 1 deletion Source/PeleLMeX_Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1928,8 +1928,9 @@ PeleLM::extendSignedDistance(MultiFab* a_signDist, Real a_extendFactor)
+((j - jj) * dx[1] * (j - jj) * dx[1]),
+((k - kk) * dx[2] * (k - kk) * dx[2])));
Real distToEB = distToCell + sd_cc(ii, jj, kk);
if (distToEB < closestEBDist)
if (distToEB < closestEBDist) {
closestEBDist = distToEB;
}
}
}
}
Expand Down

0 comments on commit 8aae0d0

Please sign in to comment.