diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d3f79343..50a5a58c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -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 diff --git a/Source/PeleLMBCfill.H b/Source/PeleLMBCfill.H index ecf48ae7..d0594d49 100644 --- a/Source/PeleLMBCfill.H +++ b/Source/PeleLMBCfill.H @@ -1,3 +1,5 @@ +#ifndef PELE_BCFILL +#define PELE_BCFILL #include #include #include @@ -530,3 +532,4 @@ struct umacFill } } }; +#endif diff --git a/Source/PeleLMDerive.H b/Source/PeleLMDerive.H index e3a77e75..079737a8 100644 --- a/Source/PeleLMDerive.H +++ b/Source/PeleLMDerive.H @@ -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. diff --git a/Source/PeleLMDiffusion.cpp b/Source/PeleLMDiffusion.cpp index 450e505a..0ba212bd 100644 --- a/Source/PeleLMDiffusion.cpp +++ b/Source/PeleLMDiffusion.cpp @@ -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 //---------------------------------------------------------------- @@ -1215,6 +1217,9 @@ void PeleLM::deltaTIter_update(int a_dtiter, std::unique_ptr &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 diff --git a/Source/PeleLMPlot.cpp b/Source/PeleLMPlot.cpp index 6ddb8e13..9eb5dede 100644 --- a/Source/PeleLMPlot.cpp +++ b/Source/PeleLMPlot.cpp @@ -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); { diff --git a/Source/PeleLMProjection.cpp b/Source/PeleLMProjection.cpp index c7f1aaf3..58c3db8d 100644 --- a/Source/PeleLMProjection.cpp +++ b/Source/PeleLMProjection.cpp @@ -500,6 +500,8 @@ PeleLM::scaleProj_RZ(int a_lev, }); Gpu::streamSynchronize(); } +#else + amrex::ignore_unused(a_lev,a_mf); #endif } @@ -528,5 +530,7 @@ PeleLM::unscaleProj_RZ(int a_lev, } }); } +#else + amrex::ignore_unused(a_lev,a_mf); #endif } diff --git a/Source/PeleLMSetup.cpp b/Source/PeleLMSetup.cpp index 09ed5501..a86ed7a0 100644 --- a/Source/PeleLMSetup.cpp +++ b/Source/PeleLMSetup.cpp @@ -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() { diff --git a/Source/PeleLMTagging.cpp b/Source/PeleLMTagging.cpp index 7479f73c..9cd3f6e3 100644 --- a/Source/PeleLMTagging.cpp +++ b/Source/PeleLMTagging.cpp @@ -56,7 +56,6 @@ 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; @@ -64,7 +63,6 @@ PeleLM::ErrorEst( int lev, for (int ilev = m_EB_refine_LevMax+1; ilev <= finest_level; ++ilev) { clearTagDist += static_cast(nErrorBuf(ilev)) * Geom(m_EB_refine_LevMax).CellSize(0) * diagFac; } - //Print() << " clearTagDist " << clearTagDist << "\n"; // Untag cells too close to EB #ifdef AMREX_USE_OMP diff --git a/Source/PeleLMTimestep.cpp b/Source/PeleLMTimestep.cpp index 3268d1c8..3fed3b23 100644 --- a/Source/PeleLMTimestep.cpp +++ b/Source/PeleLMTimestep.cpp @@ -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()) diff --git a/Source/PeleLMUserKeys.H b/Source/PeleLMUserKeys.H index 53df4ef3..ac9a5b21 100644 --- a/Source/PeleLMUserKeys.H +++ b/Source/PeleLMUserKeys.H @@ -9,6 +9,7 @@ * \brief struct holding PeleLMeX physical BC options */ struct BoundaryCondition { + BoundaryCondition() = default; enum { BCInterior = 0, BCInflow, @@ -38,6 +39,7 @@ const BoundaryCondition boundarycondition; default is LowMachNumber */ struct NSSolver { + NSSolver() = default; enum { LowMachNumber = 0, Incompressible @@ -56,6 +58,7 @@ const NSSolver nssolver; default is PiecewiseLinearConserv */ struct Interpolator { + Interpolator() = default; enum { PiecewiseLinearConserv = 0, PiecewiseLinearConservMinMax, @@ -76,6 +79,7 @@ const Interpolator interpolator; default is None */ struct LESModel { + LESModel() = default; enum { None = 0, Smagorinsky, @@ -98,6 +102,7 @@ const LESModel lesmodel; default is Godunov_PLM */ struct AdvectionScheme { + AdvectionScheme() = default; enum { Godunov_PLM = 0, Godunov_PPM, @@ -122,6 +127,7 @@ const AdvectionScheme advscheme; default is Ncell */ struct LoadBalanceCost { + LoadBalanceCost() = default; enum { Ncell = 0, ChemFunctCallAvg, @@ -150,6 +156,7 @@ const LoadBalanceCost lbcost; default is SFC */ struct LoadBalanceMethod { + LoadBalanceMethod() = default; enum { SFC = 0, Knapsack, diff --git a/Source/PeleLMUtils.cpp b/Source/PeleLMUtils.cpp index dfd97a1e..c1896591 100644 --- a/Source/PeleLMUtils.cpp +++ b/Source/PeleLMUtils.cpp @@ -103,6 +103,8 @@ void PeleLM::fluxDivergenceRD(const Vector &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 } @@ -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 @@ -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 diff --git a/Source/PeleLM_K.H b/Source/PeleLM_K.H index c267a48b..8acaf417 100644 --- a/Source/PeleLM_K.H +++ b/Source/PeleLM_K.H @@ -418,6 +418,7 @@ intFluxDivergence_K(int i, int j, int k, } } +#if (AMREX_SPACEDIM == 2) AMREX_GPU_DEVICE AMREX_FORCE_INLINE void @@ -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 diff --git a/Source/Utils.cpp b/Source/Utils.cpp index 5e77a86a..381cd1e1 100644 --- a/Source/Utils.cpp +++ b/Source/Utils.cpp @@ -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, ' ');