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

Tidy and fixes #205

Merged
merged 2 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
-**/Submodules/sundials/**
-**/Submodules/amrex/**
-**/Submodules/AMReX-Hydro/**
-**/pelelmex/**
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload CodeQL sarif
Expand Down
3 changes: 3 additions & 0 deletions Source/PeleLMBCfill.H
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef PELE_BCFILL
#define PELE_BCFILL
#include <PeleLM_Index.H>
#include <pelelm_prob.H>
#include <PMFData.H>
Expand Down Expand Up @@ -530,3 +532,4 @@ struct umacFill
}
}
};
#endif
2 changes: 0 additions & 2 deletions Source/PeleLMDerive.H
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ protected:
DeriveBoxMap box_map,
amrex::Interpolater* interp = &amrex::pc_interp);

//void buildBC (const DescriptorList& d_list);

private:

//! Name of derived quantity.
Expand Down
5 changes: 5 additions & 0 deletions Source/PeleLMDiffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ void PeleLM::computeDifferentialDiffusionFluxes(const TimeStamp &a_time,

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

//----------------------------------------------------------------
Expand Down Expand Up @@ -1215,6 +1217,9 @@ void PeleLM::deltaTIter_update(int a_dtiter,
std::unique_ptr<AdvanceDiffData> &diffData,
Real &a_deltaT_norm)
{
#ifndef AMREX_USE_EB
amrex::ignore_unused(a_ebfluxes);
#endif

//------------------------------------------------------------------------
// Evaluate deltaT norm and add Tsave back into the new LevelData
Expand Down
3 changes: 0 additions & 3 deletions Source/PeleLMPlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,6 @@ void PeleLM::ReadCheckPointFile()
is >> m_prev_dt;
GotoNextLine(is);

//is >> m_prev_prev_dt;
//GotoNextLine(is);

// Low coordinates of domain bounding box
std::getline(is, line);
{
Expand Down
4 changes: 4 additions & 0 deletions Source/PeleLMProjection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ PeleLM::scaleProj_RZ(int a_lev,
});
Gpu::streamSynchronize();
}
#else
amrex::ignore_unused(a_lev,a_mf);
#endif
}

Expand Down Expand Up @@ -528,5 +530,7 @@ PeleLM::unscaleProj_RZ(int a_lev,
}
});
}
#else
amrex::ignore_unused(a_lev,a_mf);
#endif
}
1 change: 0 additions & 1 deletion Source/PeleLMSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using namespace amrex;

static Box the_same_box (const Box& b) { return b; }
static Box grow_box_by_one (const Box& b) { return amrex::grow(b,1); }
static Box grow_box_by_two (const Box& b) { return amrex::grow(b,2); }

void PeleLM::Setup() {
Expand Down
2 changes: 0 additions & 2 deletions Source/PeleLMTagging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@ PeleLM::ErrorEst( int lev,
// Get distance function at current level
MultiFab signDist(grids[lev],dmap[lev],1,0,MFInfo(),EBFactory(lev));
getEBDistance(lev, signDist);
//VisMF::Write(signDist,"signDistLev"+std::to_string(lev));

// Estimate how far I need to derefine
Real diagFac = std::sqrt(2.0) * m_derefineEBBuffer;
Real clearTagDist = Geom(m_EB_refine_LevMax).CellSize(0) * static_cast<Real>(nErrorBuf(m_EB_refine_LevMax)) * diagFac;
for (int ilev = m_EB_refine_LevMax+1; ilev <= finest_level; ++ilev) {
clearTagDist += static_cast<Real>(nErrorBuf(ilev)) * Geom(m_EB_refine_LevMax).CellSize(0) * diagFac;
}
//Print() << " clearTagDist " << clearTagDist << "\n";

// Untag cells too close to EB
#ifdef AMREX_USE_OMP
Expand Down
1 change: 0 additions & 1 deletion Source/PeleLMTimestep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ PeleLM::checkDt(const TimeStamp &a_time,
auto ldata_p = getLevelDataPtr(lev, a_time);

const auto dxinv = geom[lev].InvCellSizeArray();
const auto dx = geom[lev].CellSize();

#ifdef AMREX_USE_OMP
#pragma omp parallel if (Gpu::notInLaunchRegion())
Expand Down
7 changes: 7 additions & 0 deletions Source/PeleLMUserKeys.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* \brief struct holding PeleLMeX physical BC options
*/
struct BoundaryCondition {
BoundaryCondition() = default;
enum {
BCInterior = 0,
BCInflow,
Expand Down Expand Up @@ -38,6 +39,7 @@ const BoundaryCondition boundarycondition;
default is LowMachNumber
*/
struct NSSolver {
NSSolver() = default;
enum {
LowMachNumber = 0,
Incompressible
Expand All @@ -56,6 +58,7 @@ const NSSolver nssolver;
default is PiecewiseLinearConserv
*/
struct Interpolator {
Interpolator() = default;
enum {
PiecewiseLinearConserv = 0,
PiecewiseLinearConservMinMax,
Expand All @@ -76,6 +79,7 @@ const Interpolator interpolator;
default is None
*/
struct LESModel {
LESModel() = default;
enum {
None = 0,
Smagorinsky,
Expand All @@ -98,6 +102,7 @@ const LESModel lesmodel;
default is Godunov_PLM
*/
struct AdvectionScheme {
AdvectionScheme() = default;
enum {
Godunov_PLM = 0,
Godunov_PPM,
Expand All @@ -122,6 +127,7 @@ const AdvectionScheme advscheme;
default is Ncell
*/
struct LoadBalanceCost {
LoadBalanceCost() = default;
enum {
Ncell = 0,
ChemFunctCallAvg,
Expand Down Expand Up @@ -150,6 +156,7 @@ const LoadBalanceCost lbcost;
default is SFC
*/
struct LoadBalanceMethod {
LoadBalanceMethod() = default;
enum {
SFC = 0,
Knapsack,
Expand Down
6 changes: 6 additions & 0 deletions Source/PeleLMUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ void PeleLM::fluxDivergenceRD(const Vector<const MultiFab*> &a_state,
amrex::ignore_unused(state_comp);
amrex::ignore_unused(state_bc_d);
amrex::ignore_unused(a_dt);
amrex::ignore_unused(a_EBfluxes);
amrex::ignore_unused(ebflux_comp);
fluxDivergence(a_divergence, div_comp, a_fluxes, flux_comp, ncomp, intensiveFluxes, scale);
#endif
}
Expand Down Expand Up @@ -348,6 +350,8 @@ void PeleLM::intFluxDivergenceLevelEB(int lev,
Array< const MultiCutFab*,AMREX_SPACEDIM> areafrac;
areafrac = ebfact.getAreaFrac();
const auto* eb_area = &(ebfact.getBndryArea());
#else
amrex::ignore_unused(a_EBfluxes,ebflux_comp);
#endif

#ifdef AMREX_USE_OMP
Expand Down Expand Up @@ -445,6 +449,8 @@ void PeleLM::advFluxDivergence(int a_lev,
geom[a_lev].GetFaceArea(mf_ax, grids[a_lev], dmap[a_lev], 0, 0);
geom[a_lev].GetFaceArea(mf_ay, grids[a_lev], dmap[a_lev], 1, 0);
}
#else
amrex::ignore_unused(a_lev);
#endif

#ifdef AMREX_USE_EB
Expand Down
2 changes: 2 additions & 0 deletions Source/PeleLM_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ intFluxDivergence_K(int i, int j, int k,
}
}

#if (AMREX_SPACEDIM == 2)
AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
Expand All @@ -444,6 +445,7 @@ intFluxDivergence_rz_K(int i, int j, int k,
div(i,j,k,n) *= factor;
}
}
#endif

AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
Expand Down
1 change: 0 additions & 1 deletion Source/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ using namespace amrex;

void writeBuildInfo ()
{
std::string PrettyLine = std::string(78, '=') + "\n";
std::string OtherLine = std::string(78, '-') + "\n";
std::string SkipSpace = std::string(8, ' ');

Expand Down