Skip to content

Commit

Permalink
More fixes to headers. (Exawind#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel authored Mar 14, 2022
1 parent 5bb02ba commit f24e5b2
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion amr-wind/core/FieldBCOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion amr-wind/core/FieldFillPatchOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/core/MultiParser.H
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public:
{
amrex::Vector<vs::Vector::value_type> 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];
Expand Down
6 changes: 3 additions & 3 deletions amr-wind/core/vs/vstraits.H
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ struct DTraits<double>
template <>
struct DTraits<float>
{
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<float>::max();
Expand All @@ -55,7 +55,7 @@ struct DTraits<float>
{
return std::numeric_limits<float>::min();
}
static constexpr float eps() noexcept { return 1.0e-7f; }
static constexpr float eps() noexcept { return 1.0e-7F; }
};

} // namespace vs
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/equation_systems/AdvOp_MOL.H
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions amr-wind/equation_systems/DiffusionOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public:
void set_bcoeffs(
L& linop,
typename std::enable_if<
std::is_same<L, amrex::MLTensorOp>::value>::type* = 0)
std::is_same<L, amrex::MLTensorOp>::value>::type* = nullptr)
{
const int nlevels = m_pdefields.repo.num_active_levels();
const auto& viscosity = m_pdefields.mueff;
Expand All @@ -72,7 +72,7 @@ public:
void set_bcoeffs(
L& linop,
typename std::enable_if<
std::is_same<L, amrex::MLABecLaplacian>::value>::type* = 0)
std::is_same<L, amrex::MLABecLaplacian>::value>::type* = nullptr)
{
const int nlevels = m_pdefields.repo.num_active_levels();
const auto& viscosity = m_pdefields.mueff;
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/equation_systems/PDEOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
12 changes: 6 additions & 6 deletions amr-wind/fvm/stencils.H
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ 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());
amrex::IntVect hi(bx.bigEnd());
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
Expand All @@ -94,18 +94,18 @@ 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());
amrex::IntVect hi(bx.bigEnd());
int sm = hi[idir];
low.setVal(idir, sm);
hi.setVal(idir, sm);
return amrex::Box(low, hi);
return {low, hi};
}
} // namespace impl

Expand Down
2 changes: 1 addition & 1 deletion amr-wind/transport_models/TwoPhaseTransport.H
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f24e5b2

Please sign in to comment.