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 warnings #267

Merged
merged 10 commits into from
Sep 27, 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/EnclosedFlame/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void
bcnormal(
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const int /*m_nAux*/,
amrex::Real[NVAR] /*s_ext[NVAR]*/,
amrex::Real* /*s_ext[NVAR]*/,
const int /*idir*/,
const int /*sgn*/,
const amrex::Real /*time*/,
Expand Down
12 changes: 6 additions & 6 deletions Exec/RegTests/EnclosedInjection/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ bcnormal(
amrex::Real eta = 0.0;
amrex::Real p_int;

const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
const amrex::Real* dx = geomdata.CellSize();
// const amrex::Real* prob_lo = geomdata.ProbLo();
// const amrex::Real* prob_hi = geomdata.ProbHi();
// const amrex::Real* dx = geomdata.CellSize();
Comment on lines +92 to +94

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.

// Simple, air into air injection
X_air[O2_ID] = 0.21;
Expand Down Expand Up @@ -162,9 +162,9 @@ zero_visc(
// velocity, ...)
if (beta_comp == 0 && nComp == NUM_SPECIES) {
if (dir == 2 && k <= domainBox.smallEnd(dir)) {
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
const amrex::Real* dx = geomdata.CellSize();
// const amrex::Real* prob_lo = geomdata.ProbLo();
// const amrex::Real* prob_hi = geomdata.ProbHi();
// const amrex::Real* dx = geomdata.CellSize();
Comment on lines +163 to +165

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.

// Just over whole inlet
for (int n = 0; n < nComp; n++) {
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/HITDecay/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void
bcnormal(
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const int /*m_nAux*/,
amrex::Real[NVAR] /*s_ext[NVAR]*/,
amrex::Real* /*s_ext[NVAR]*/,
const int /*idir*/,
const int /*sgn*/,
const amrex::Real /*time*/,
Expand Down
6 changes: 3 additions & 3 deletions Exec/RegTests/HotBubble/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ pelelmex_initdata(
int k,
int is_incompressible,
amrex::Array4<amrex::Real> const& state,
amrex::Array4<amrex::Real> const& aux,
amrex::Array4<amrex::Real> const& /*aux*/,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* pmf_data)
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
Expand All @@ -47,7 +47,7 @@ pelelmex_initdata(
state(i, j, k, TEMP) = prob_parm.T_mean;
amrex::Real x_c = prob_parm.is_sym != 0 ? prob_lo[0] : prob_lo[0] + 0.5 * Lx;
#if AMREX_SPACEDIM == 3
amrex::Real z_c = prob_parm.is_sym ? prob_lo[2] : prob_lo[2] + 0.5 * Lz;
amrex::Real z_c = prob_parm.is_sym != 0 ? prob_lo[2] : prob_lo[2] + 0.5 * Lz;
#endif
amrex::Real rad = std::sqrt(AMREX_D_TERM(
(y - prob_parm.bubble_y0) * (y - prob_parm.bubble_y0),
Expand Down
14 changes: 9 additions & 5 deletions Exec/RegTests/PeriodicCases/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ pelelmex_initdata(
break;
}

if (is_incompressible != 0)
if (is_incompressible != 0) {
return;
}

state(i, j, k, TEMP) = prob_parm.T_mean;
} else if (prob_parm.probType == 1) { // CoGau
Expand Down Expand Up @@ -136,8 +137,9 @@ pelelmex_initdata(
break;
}

if (is_incompressible != 0)
if (is_incompressible != 0) {
return;
}

state(i, j, k, TEMP) = prob_parm.T_mean;
const amrex::Real deltax = x - prob_parm.xgauss;
Expand Down Expand Up @@ -187,8 +189,9 @@ pelelmex_initdata(
break;
}

if (is_incompressible != 0)
if (is_incompressible != 0) {
return;
}

state(i, j, k, TEMP) = prob_parm.T_mean;
const amrex::Real deltax = x - prob_parm.xgauss;
Expand All @@ -212,16 +215,17 @@ pelelmex_initdata(
AMREX_D_TERM(state(i, j, k, VELX) = 0.0;, state(i, j, k, VELY) = 0.0;
, state(i, j, k, VELZ) = 0.0);

if (is_incompressible != 0)
if (is_incompressible != 0) {
return;
}

state(i, j, k, TEMP) = prob_parm.T_mean;
// Set up the Gaussian as the solution of the diffusion of a delta dirac
// initial distribution after time gaussTime of a diffusion process with
// constant diffusion coeff. gaussDiff. Use ampgauss to avoid
// undershoot/overshoot of the 2-species mixture.
const amrex::Real deltax = x - prob_parm.xgauss;
const amrex::Real deltay = y - prob_parm.ygauss;
// const amrex::Real deltay = y - prob_parm.ygauss;

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
amrex::Real denom_inv =
prob_parm.ampgauss /
std::sqrt(4 * Pi * prob_parm.gaussTime * prob_parm.gaussDiff);
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/TaylorGreen/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pelelmex_initdata(
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
// const amrex::Real* prob_hi = geomdata.ProbHi();

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
const amrex::Real* dx = geomdata.CellSize();

AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0];
Expand Down
5 changes: 3 additions & 2 deletions Exec/RegTests/TurbInflow/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ pelelmex_initdata(
, state(i, j, k, VELZ) = 0.0);
state(i, j, k, VELX + prob_parm.meanFlowDir) = prob_parm.meanFlowMag;

if (is_incompressible)
if (is_incompressible != 0) {
return;
}

state(i, j, k, TEMP) = prob_parm.T_mean;

Expand Down Expand Up @@ -104,7 +105,7 @@ bcnormal(

// When using PELE_USE_TURBINFLOW, s_ext comes in with
// turbulence data. Only add the mean flow here.
if (prob_parm.bothSides) {
if (prob_parm.bothSides != 0) {
if (sgn == 1) {
s_ext[prob_parm.meanFlowDir] += std::abs(prob_parm.meanFlowMag);
} else {
Expand Down
14 changes: 7 additions & 7 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_pltFile);
void initLevelDataFromPlt(int a_lev, const std::string& a_datPltFile);

/**
* \brief Project the initial solution velocity field,
Expand Down Expand Up @@ -588,9 +588,9 @@ public:
*/
void addSoretTerm(
const amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>>&
a_fluxes,
a_spfluxes,
const amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>>&
a_soretfluxes,
a_spsoretfluxes,
amrex::Vector<amrex::MultiFab const*> const& a_spec,
amrex::Vector<amrex::MultiFab const*> const& a_temp,
amrex::Vector<amrex::MultiFab const*> const& a_beta);
Expand Down Expand Up @@ -1019,7 +1019,7 @@ public:
void fillpatch_density(
int lev,
amrex::Real a_time,
amrex::MultiFab& a_rhoY,
amrex::MultiFab& a_density,
int rho_comp,
int nGhost);
void fillpatch_species(
Expand Down Expand Up @@ -1300,7 +1300,7 @@ public:
std::string compositionType,
amrex::Real* massFrac);
static void parseVars(
const amrex::Vector<std::string>& a_varNames,
const amrex::Vector<std::string>& a_varsNames,
const amrex::Vector<std::string>& a_stringIn,
amrex::Vector<amrex::Real>& a_rVars);
void initProgressVariable();
Expand Down Expand Up @@ -1338,8 +1338,8 @@ public:
const amrex::Real& a_dt,
amrex::MultiFab& a_tmpDiv,
int div_comp,
amrex::MultiFab& a_AofS,
int aofs_comp,
amrex::MultiFab& a_diff,
int diff_comp,
const amrex::MultiFab& a_state,
int state_comp,
int ncomp,
Expand Down
27 changes: 13 additions & 14 deletions Source/PeleLMeX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,20 @@ PeleLM::getLevelDataPtr(
}
if (a_time == AmrNewTime) {
return m_leveldata_new[lev].get();
} else {
m_leveldata_floating = std::make_unique<LevelData>(
grids[lev], dmap[lev], *m_factory[lev], m_incompressible, m_has_divu,
m_nAux, m_nGrowState, m_use_soret, static_cast<int>(m_do_les));
Real time = getTime(lev, a_time);
fillpatch_state(lev, time, m_leveldata_floating->state, m_nGrowState);
// if (useUMac) {
// // TODO: find a way to get U^{n+1/2} from Umac
// // For now get old time
// Real oldtime = getTime(lev,AmrOldTime);
// fillpatch_velocity(lev, oldtime, m_leveldata_floating->state, VELX,
// m_nGrowState);
// }
return m_leveldata_floating.get();
}
m_leveldata_floating = std::make_unique<LevelData>(
grids[lev], dmap[lev], *m_factory[lev], m_incompressible, m_has_divu,
m_nAux, m_nGrowState, m_use_soret, static_cast<int>(m_do_les));
Real time = getTime(lev, a_time);
fillpatch_state(lev, time, m_leveldata_floating->state, m_nGrowState);
// if (useUMac) {
// // TODO: find a way to get U^{n+1/2} from Umac
// // For now get old time
// Real oldtime = getTime(lev,AmrOldTime);
// fillpatch_velocity(lev, oldtime, m_leveldata_floating->state, VELX,
// m_nGrowState);
// }
Comment on lines +55 to +61

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
return m_leveldata_floating.get();
}

PeleLM::LevelDataReact*
Expand Down
9 changes: 8 additions & 1 deletion Source/PeleLMeX_DeriveFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,11 @@ pelelmex_dercoord(
void
pelelmex_derQcrit(
PeleLM* /*a_pelelm*/,
const Box& bx,
const Box&
#ifdef AMREX_USE_EB
bx
#endif
,
FArrayBox& derfab,
int dcomp,
int /*ncomp*/,
Expand Down Expand Up @@ -1291,6 +1295,7 @@ pelelmex_dervisc(
const Vector<BCRec>& /*bcrec*/,
int /*level*/)
{
amrex::ignore_unused(ncomp);
AMREX_ASSERT(derfab.box().contains(bx));
AMREX_ASSERT(statefab.box().contains(bx));
AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp);
Expand Down Expand Up @@ -1328,6 +1333,7 @@ pelelmex_derdiffc(
const Vector<BCRec>& /*bcrec*/,
int /*level*/)
{
amrex::ignore_unused(ncomp);
AMREX_ASSERT(derfab.box().contains(bx));
AMREX_ASSERT(statefab.box().contains(bx));
AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp);
Expand Down Expand Up @@ -1389,6 +1395,7 @@ pelelmex_derlambda(
const Vector<BCRec>& /*bcrec*/,
int /*level*/)
{
amrex::ignore_unused(ncomp);
AMREX_ASSERT(derfab.box().contains(bx));
AMREX_ASSERT(statefab.box().contains(bx));
AMREX_ASSERT(derfab.nComp() >= dcomp + ncomp);
Expand Down
8 changes: 1 addition & 7 deletions Source/PeleLMeX_Diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,6 @@ PeleLM::computeDifferentialDiffusionFluxes(
{
BL_PROFILE("PeleLMeX::computeDifferentialDiffusionFluxes()");

#ifdef AMREX_USE_EB
int have_EBfluxes = (a_EBfluxes.empty()) ? 0 : 1;
#else
amrex::ignore_unused(a_EBfluxes);
#endif

//----------------------------------------------------------------
// Species fluxes
// Get the species BCRec
Expand Down Expand Up @@ -301,7 +295,7 @@ PeleLM::computeDifferentialDiffusionFluxes(
do_avgDown = 0;
#ifdef AMREX_USE_EB
if (m_isothermalEB != 0) {
AMREX_ASSERT(have_EBfluxes);
AMREX_ASSERT(!a_EBfluxes.empty());
// Set up EB dirichlet value and diffusivity
Vector<MultiFab> EBvalue(finest_level + 1);
Vector<MultiFab> EBdiff(finest_level + 1);
Expand Down
4 changes: 2 additions & 2 deletions Source/PeleLMeX_DiffusionOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ DiffusionOp::diffuse_scalar(
Vector<MultiFab*> const& a_phi,
int phi_comp,
Vector<MultiFab const*> const& a_phiEB,
int phiEB_comp,
int /*phiEB_comp*/,
Vector<MultiFab const*> const& a_rhs,
int rhs_comp,
Vector<Array<MultiFab*, AMREX_SPACEDIM>> const& a_flux,
Expand All @@ -312,7 +312,7 @@ DiffusionOp::diffuse_scalar(
Vector<MultiFab const*> const& a_bcoeff,
int bcoeff_comp,
Vector<MultiFab const*> const& a_bcoeffEB,
int bcoeffEB_comp,
int /*bcoeffEB_comp*/,
Vector<BCRec> a_bcrec,
int ncomp,
int isPoissonSolve,
Expand Down