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 7 commits
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > warnings.txt
cat warnings.txt
export return=$(tail -n 1 warnings.txt | awk '{print $2}')
#exit ${return}
exit ${return}
#- name: EB debug build
# working-directory: ./Exec/RegTests/EB-C10
# run: |
Expand Down Expand Up @@ -298,7 +298,7 @@ jobs:
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-output-warnings.txt
cat ${{runner.workspace}}/build-output-warnings.txt
export return=$(tail -n 1 ${{runner.workspace}}/build-output-warnings.txt | awk '{print $2}')
#exit ${return}
exit ${return}
- name: Test
run: |
(for DIM in 2 3; do \
Expand Down Expand Up @@ -542,7 +542,7 @@ jobs:
awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' < cppcheck-report.txt > cppcheck-warnings.txt
cat cppcheck-warnings.txt
export return=$(tail -n 1 cppcheck-warnings.txt | awk '{print $2}')
#exit ${return}
exit ${return}
Lint-clang-tidy:
needs: Formatting
runs-on: ubuntu-latest
Expand Down
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
20 changes: 9 additions & 11 deletions Exec/RegTests/EnclosedInjection/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,26 @@
void
bcnormal(
const amrex::Real x[AMREX_SPACEDIM],
const int m_nAux,
const int /*m_nAux*/,
amrex::Real s_ext[NVAR],
const int idir,
const int sgn,
const amrex::Real time,
amrex::GeometryData const& geomdata,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
auto eos = pele::physics::PhysicsType::eos();
amrex::Real massfrac[NUM_SPECIES] = {0.0};
amrex::Real molefrac[NUM_SPECIES] = {0.0};
amrex::Real X_air[NUM_SPECIES] = {0.0};
amrex::Real Y_air[NUM_SPECIES] = {0.0};
amrex::Real X_jet[NUM_SPECIES] = {0.0};
amrex::Real Y_jet[NUM_SPECIES] = {0.0};
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 Note

This comment appears to contain commented-out code.

// Simple, air into air injection
X_air[O2_ID] = 0.21;
Expand Down Expand Up @@ -150,7 +148,7 @@
int j,
int k,
amrex::Array4<amrex::Real> const& beta,
amrex::GeometryData const& geomdata,
amrex::GeometryData const& /*geomdata*/,
amrex::Box const& domainBox,
const int dir,
const int beta_comp,
Expand All @@ -162,9 +160,9 @@
// 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 Note

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
12 changes: 5 additions & 7 deletions Exec/RegTests/HotBubble/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
int i,
int j,
int k,
int is_incompressible,
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 @@ -33,11 +33,9 @@
, const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];);

AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];
, const amrex::Real Ly = prob_hi[1] - prob_lo[1];
, /*const amrex::Real Ly = prob_hi[1] - prob_lo[1];*/

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
, const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

constexpr amrex::Real Pi = 3.14159265358979323846264338327950288;

auto eos = pele::physics::PhysicsType::eos();
amrex::Real massfrac[NUM_SPECIES] = {0.0};

Expand All @@ -47,7 +45,7 @@
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
19 changes: 11 additions & 8 deletions Exec/RegTests/PeriodicCases/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
// const amrex::Real* prob_hi = geomdata.ProbHi();
const amrex::Real* dx = geomdata.CellSize();
AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0];
, const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];
, const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];);
, const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];,
/*const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];*/);

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
/*
AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];
, const amrex::Real Ly = prob_hi[1] - prob_lo[1];
Expand Down Expand Up @@ -64,7 +64,6 @@
-prob_parm.forcevort * deltay / r_sq * exp(-d_sq / r_sq / 2.);
const amrex::Real v_vort =
prob_parm.forcevort * deltax / r_sq * exp(-d_sq / r_sq / 2.);
const amrex::Real w_vort = 0.;

switch (prob_parm.meanFlowDir) {
case 1:
Expand Down Expand Up @@ -99,8 +98,9 @@
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 +136,9 @@
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 +188,9 @@
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 +214,17 @@
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 Note

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 @@
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 Note

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
15 changes: 8 additions & 7 deletions Exec/RegTests/TurbInflow/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pelelmex_initdata(
int k,
int is_incompressible,
amrex::Array4<amrex::Real> const& state,
amrex::Array4<amrex::Real> const& aux,
amrex::GeometryData const& geomdata,
amrex::Array4<amrex::Real> const& /*aux*/,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
Expand Down 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 All @@ -78,11 +79,11 @@ AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real x[AMREX_SPACEDIM],
const int m_nAux,
const int /*m_nAux*/,
amrex::Real s_ext[NVAR],
const int idir,
const int /*idir*/,
const int sgn,
const amrex::Real time,
const amrex::Real /*time*/,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
Expand All @@ -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 @@
}
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 Note

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

PeleLM::LevelDataReact*
Expand Down
Loading
Loading