From f24e5b25bf44f1ea7d76722ed863f835e0bcb726 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Sun, 13 Mar 2022 21:12:02 -0600 Subject: [PATCH] More fixes to headers. (#590) --- amr-wind/core/FieldBCOps.H | 2 +- amr-wind/core/FieldFillPatchOps.H | 2 +- amr-wind/core/MultiParser.H | 2 +- amr-wind/core/vs/vstraits.H | 6 +++--- amr-wind/equation_systems/AdvOp_MOL.H | 2 +- amr-wind/equation_systems/DiffusionOps.H | 4 ++-- amr-wind/equation_systems/PDEOps.H | 2 +- amr-wind/fvm/stencils.H | 12 ++++++------ amr-wind/transport_models/TwoPhaseTransport.H | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/amr-wind/core/FieldBCOps.H b/amr-wind/core/FieldBCOps.H index 063dc9a63b..5065cb2cf4 100644 --- a/amr-wind/core/FieldBCOps.H +++ b/amr-wind/core/FieldBCOps.H @@ -154,7 +154,7 @@ struct DirichletOp for (int n = 0; n < m_ncomp; ++n) { const amrex::BCRec& bc = bcr[bcomp + n]; - for (amrex::OrientationIter oit; oit; ++oit) { + for (amrex::OrientationIter oit; oit != nullptr; ++oit) { auto ori = oit(); const int idir = ori.coordDir(); diff --git a/amr-wind/core/FieldFillPatchOps.H b/amr-wind/core/FieldFillPatchOps.H index 86adf4583c..123409b9b9 100644 --- a/amr-wind/core/FieldFillPatchOps.H +++ b/amr-wind/core/FieldFillPatchOps.H @@ -313,7 +313,7 @@ public: const auto& bcfunc = bc_functor(); const auto& ncomp = m_field.num_comp(); - for (amrex::OrientationIter oit; oit; ++oit) { + for (amrex::OrientationIter oit; oit != nullptr; ++oit) { auto ori = oit(); if (bctype[ori] != BC::mass_inflow) { continue; diff --git a/amr-wind/core/MultiParser.H b/amr-wind/core/MultiParser.H index e7052154cb..075c0f66f6 100644 --- a/amr-wind/core/MultiParser.H +++ b/amr-wind/core/MultiParser.H @@ -58,7 +58,7 @@ public: { amrex::Vector val; queryarr(name, val); - if (val.size() > 0) { + if (!val.empty()) { AMREX_ALWAYS_ASSERT(val.size() == AMREX_SPACEDIM); value.x() = val[0]; value.y() = val[1]; diff --git a/amr-wind/core/vs/vstraits.H b/amr-wind/core/vs/vstraits.H index d096177e5d..80a6f26133 100644 --- a/amr-wind/core/vs/vstraits.H +++ b/amr-wind/core/vs/vstraits.H @@ -45,8 +45,8 @@ struct DTraits template <> struct DTraits { - static constexpr float zero() noexcept { return 0.0f; } - static constexpr float one() noexcept { return 1.0f; } + static constexpr float zero() noexcept { return 0.0F; } + static constexpr float one() noexcept { return 1.0F; } static constexpr float max() noexcept { return std::numeric_limits::max(); @@ -55,7 +55,7 @@ struct DTraits { return std::numeric_limits::min(); } - static constexpr float eps() noexcept { return 1.0e-7f; } + static constexpr float eps() noexcept { return 1.0e-7F; } }; } // namespace vs diff --git a/amr-wind/equation_systems/AdvOp_MOL.H b/amr-wind/equation_systems/AdvOp_MOL.H index 6460d2732b..3d5efa017c 100644 --- a/amr-wind/equation_systems/AdvOp_MOL.H +++ b/amr-wind/equation_systems/AdvOp_MOL.H @@ -44,7 +44,7 @@ struct AdvectionOp< PDE::ndim == 1, "Invalid number of components for scalar"); auto& repo = fields.repo; - auto& geom = repo.mesh().Geom(); + const auto& geom = repo.mesh().Geom(); // cppcheck-suppress constVariable auto& conv_term = fields.conv_term.state(fstate); diff --git a/amr-wind/equation_systems/DiffusionOps.H b/amr-wind/equation_systems/DiffusionOps.H index fd29bce1f8..b4b98d7fa7 100644 --- a/amr-wind/equation_systems/DiffusionOps.H +++ b/amr-wind/equation_systems/DiffusionOps.H @@ -52,7 +52,7 @@ public: void set_bcoeffs( L& linop, typename std::enable_if< - std::is_same::value>::type* = 0) + std::is_same::value>::type* = nullptr) { const int nlevels = m_pdefields.repo.num_active_levels(); const auto& viscosity = m_pdefields.mueff; @@ -72,7 +72,7 @@ public: void set_bcoeffs( L& linop, typename std::enable_if< - std::is_same::value>::type* = 0) + std::is_same::value>::type* = nullptr) { const int nlevels = m_pdefields.repo.num_active_levels(); const auto& viscosity = m_pdefields.mueff; diff --git a/amr-wind/equation_systems/PDEOps.H b/amr-wind/equation_systems/PDEOps.H index 5964c4e6e8..365be8cd2e 100644 --- a/amr-wind/equation_systems/PDEOps.H +++ b/amr-wind/equation_systems/PDEOps.H @@ -125,7 +125,7 @@ struct SrcTermOpBase this->fields.src_term.setVal(0.0); // Return early if there are no source terms to process - if (this->sources.size() == 0) { + if (this->sources.empty()) { return; } diff --git a/amr-wind/fvm/stencils.H b/amr-wind/fvm/stencils.H index f746fb16b5..4df8f5179c 100644 --- a/amr-wind/fvm/stencils.H +++ b/amr-wind/fvm/stencils.H @@ -63,10 +63,10 @@ inline amrex::Box box_lo(const amrex::Box& bx, const amrex::Geometry& geom, const int idir) { if (geom.isPeriodic(idir)) { - return amrex::Box(); + return {}; } if (bx.smallEnd(idir) != geom.Domain().smallEnd(idir)) { - return amrex::Box(); + return {}; } amrex::IntVect low(bx.smallEnd()); @@ -74,7 +74,7 @@ box_lo(const amrex::Box& bx, const amrex::Geometry& geom, const int idir) int sm = low[idir]; low.setVal(idir, sm); hi.setVal(idir, sm); - return amrex::Box(low, hi); + return {low, hi}; } /** Return a layer of cells adjacent to a non-periodic upper boundary @@ -94,10 +94,10 @@ inline amrex::Box box_hi(const amrex::Box& bx, const amrex::Geometry& geom, const int idir) { if (geom.isPeriodic(idir)) { - return amrex::Box(); + return {}; } if (bx.bigEnd(idir) != geom.Domain().bigEnd(idir)) { - return amrex::Box(); + return {}; } amrex::IntVect low(bx.smallEnd()); @@ -105,7 +105,7 @@ box_hi(const amrex::Box& bx, const amrex::Geometry& geom, const int idir) int sm = hi[idir]; low.setVal(idir, sm); hi.setVal(idir, sm); - return amrex::Box(low, hi); + return {low, hi}; } } // namespace impl diff --git a/amr-wind/transport_models/TwoPhaseTransport.H b/amr-wind/transport_models/TwoPhaseTransport.H index eb56ac7994..6d555324f6 100644 --- a/amr-wind/transport_models/TwoPhaseTransport.H +++ b/amr-wind/transport_models/TwoPhaseTransport.H @@ -89,7 +89,7 @@ public: } else if (m_ifacetype == InterfaceCapturingMethod::LS) { auto& levelset = m_repo.get_field("levelset"); - auto& geom = m_repo.mesh().Geom(); + const auto& geom = m_repo.mesh().Geom(); for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { for (amrex::MFIter mfi((*mu)(lev)); mfi.isValid(); ++mfi) {