Skip to content

Commit

Permalink
Fix clang-tidy (AMReX-Combustion#535)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored and baperry2 committed Oct 18, 2024
1 parent b6f204b commit 6e22757
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 42 deletions.
6 changes: 0 additions & 6 deletions Mechanisms/Null/mechanism.H
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
#include <AMReX_Gpu.H>
#include <AMReX_REAL.H>

#if 0
/* Elements
0 X
*/
#endif

/* Species */
#define XO_ID 0

Expand Down
6 changes: 3 additions & 3 deletions Source/PelePhysics.H
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ namespace pele::physics {
template <typename T>
struct is_eos_type
{
static constexpr bool value = std::is_base_of<typename T::eos_type, T>::value;
static constexpr bool value = std::is_base_of_v<typename T::eos_type, T>;
};

template <typename T>
struct is_transport_type
{
static constexpr bool value =
std::is_base_of<typename T::transport_type, T>::value;
std::is_base_of_v<typename T::transport_type, T>;
};

template <typename EosModel, typename TransportModel>
Expand All @@ -41,7 +41,7 @@ struct PelePhysics

static std::string identifier()
{
if (std::is_same<EosModel, TransportModel>::value) {
if (std::is_same_v<EosModel, TransportModel>) {
return EosModel::identifier();
}
return EosModel::identifier() + "-" + TransportModel::identifier();
Expand Down
1 change: 1 addition & 0 deletions Source/Reactions/ReactorCvode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ ReactorCvode::react(
initCvode(y, A, udata, NLS, LS, cvode_mem, time_start, ncells);

// Update TypicalValues
// NOLINTNEXTLINE(clang-analyzer-core.CallAndMessage)
utils::set_sundials_solver_tols<Ordering>(
*amrex::sundials::The_Sundials_Context(), cvode_mem, udata->ncells, relTol,
absTol, m_typ_vals, "cvode", verbose);
Expand Down
3 changes: 1 addition & 2 deletions Source/Reactions/ReactorUtils.H
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ struct CYOrder
template <typename T>
struct is_ordering_type
{
static constexpr bool value =
std::is_base_of<typename T::ordering_type, T>::value;
static constexpr bool value = std::is_base_of_v<typename T::ordering_type, T>;
};

template <typename OrderType>
Expand Down
10 changes: 6 additions & 4 deletions Source/Soot/SootData.H
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#ifndef SOOTDATA_H
#define SOOTDATA_H

Expand Down Expand Up @@ -312,9 +311,7 @@ struct SootData
}
weightDelta = sc.smallWeight;
}
if (weightDelta > moments[0]) {
weightDelta = moments[0];
}
weightDelta = amrex::min(weightDelta, moments[0]);
moments[NUM_SOOT_MOMENTS] = weightDelta;
}

Expand Down Expand Up @@ -642,6 +639,7 @@ struct SootData
default:
amrex::Abort(
"SootModel::FMCoagSL: Moment not contained in number of moments!");
break;
}
return 0.;
}
Expand Down Expand Up @@ -754,6 +752,8 @@ struct SootData
}
return 2. * weightDelta * (p1 + p2 + p3);
}
default:
return 0.;
}
return 0.;
}
Expand Down Expand Up @@ -793,6 +793,8 @@ struct SootData
return CNCoagLLFunc(1., 0., 0., 1., lambda, momFV);
case 5: // M02
return CNCoagLLFunc(0., 1., lambda, momFV);
default:
return 0.;
}
return 0.;
}
Expand Down
8 changes: 4 additions & 4 deletions Source/Soot/SootModel.H
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ public:
//
// Set the indices for primitive and conservative variables
//
inline void setIndices(const SootComps& sootIndx) { m_sootIndx = sootIndx; }
void setIndices(const SootComps& sootIndx) { m_sootIndx = sootIndx; }

//
// Return string of the names of each variable
//
inline std::string sootVariableName(const int indx) const
std::string sootVariableName(const int indx) const
{
AMREX_ASSERT(indx >= 0 && indx < NUM_SOOT_MOMENTS + 1);
return m_sootVarName[indx];
Expand All @@ -114,8 +114,8 @@ public:
//
// Return pointer to soot data
//
inline SootData* getSootData() const { return m_sootData; }
inline SootData* getSootData_d() const { return d_sootData; }
SootData* getSootData() const { return m_sootData; }
SootData* getSootData_d() const { return d_sootData; }

/***********************************************************************
Member data
Expand Down
36 changes: 18 additions & 18 deletions Source/Spray/SprayJet.H
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,32 @@ public:

virtual ~SprayJet() = default;

inline const amrex::RealVect& jet_norm() const { return m_norm; }
inline const amrex::RealVect& jet_cent() const { return m_cent; }
inline amrex::Real jet_vel(const amrex::Real time) const
const amrex::RealVect& jet_norm() const { return m_norm; }
const amrex::RealVect& jet_cent() const { return m_cent; }
amrex::Real jet_vel(const amrex::Real time) const
{
if (m_useROI) {
return interpolateVel(time);
}
return m_jetVel;
}
inline const amrex::Real& max_jet_vel() const { return m_maxJetVel; }
inline const amrex::Real& jet_dia() const { return m_jetDia; }
inline const amrex::Real& spread_angle() const { return m_spreadAngle; }
inline amrex::Real mass_flow_rate(const amrex::Real time) const
const amrex::Real& max_jet_vel() const { return m_maxJetVel; }
const amrex::Real& jet_dia() const { return m_jetDia; }
const amrex::Real& spread_angle() const { return m_spreadAngle; }
amrex::Real mass_flow_rate(const amrex::Real time) const
{
if (m_useROI) {
return interpolateMdot(time);
}
return m_massFlow;
}
inline const amrex::Real& Y(const int spf) const { return m_jetY[spf]; }
inline const amrex::Real& T() const { return m_jetT; }
inline const amrex::Real& start_time() const { return m_startTime; }
inline const amrex::Real& end_time() const { return m_endTime; }
inline const amrex::Real& num_ppp() const { return m_numPPP; }
inline const std::string& jet_name() const { return m_jetName; }
inline int Proc() const { return m_proc; }
const amrex::Real& Y(const int spf) const { return m_jetY[spf]; }
const amrex::Real& T() const { return m_jetT; }
const amrex::Real& start_time() const { return m_startTime; }
const amrex::Real& end_time() const { return m_endTime; }
const amrex::Real& num_ppp() const { return m_numPPP; }
const std::string& jet_name() const { return m_jetName; }
int Proc() const { return m_proc; }

// Call this before using spray jet
bool jet_active(const amrex::Real time) const
Expand All @@ -84,7 +84,7 @@ public:
return check;
}

inline bool hollow_spray() const { return m_hollowSpray; }
bool hollow_spray() const { return m_hollowSpray; }

/// Returns the average values given for the jet
amrex::Real get_avg_dia() const { return m_avgDia; }
Expand Down Expand Up @@ -230,7 +230,7 @@ public:
part_vel *= umag;
}

inline amrex::Real
amrex::Real
interpolateROI(const amrex::Real& time, const amrex::Real* vals) const
{
int i = 0;
Expand All @@ -246,12 +246,12 @@ public:
return val1 + (val2 - val1) * invt;
}

inline amrex::Real interpolateMdot(const amrex::Real time) const
amrex::Real interpolateMdot(const amrex::Real time) const
{
return interpolateROI(time, inject_mass.dataPtr());
}

inline amrex::Real interpolateVel(const amrex::Real time) const
amrex::Real interpolateVel(const amrex::Real time) const
{
return interpolateROI(time, inject_vel.dataPtr());
}
Expand Down
10 changes: 5 additions & 5 deletions Source/Spray/SprayParticles.H
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public:
amrex::Real estTimestep(int level) const;

/// \brief Reset the particle ID in case we need to reinitialize the particles
static inline void resetID(const int id) { ParticleType::NextID(id); }
static void resetID(const int id) { ParticleType::NextID(id); }

/// \brief Returns the number of ghost cells for making ghost particles. This
/// is called on level N-1 to make ghost particles on level N from valid
Expand All @@ -115,7 +115,7 @@ public:
/// @param cfl Particle CFL number on level N
/// @param depos_width Number of cells adjacent to the cell containing the
/// particle needed to interpolate the particle source term to the mesh
static inline int getGhostPartCells(
static int getGhostPartCells(
const int level,
const int finest_level,
const int amr_ncycle,
Expand All @@ -141,7 +141,7 @@ public:
/// is 1 for trilinear interpolation
/// @param depos_width Number of cells adjacent to the cell containing the
/// particle needed to interpolate the particle source term to the mesh
static inline int getStateGhostCells(
static int getStateGhostCells(
const int level,
const int finest_level,
const int amr_ncycle,
Expand All @@ -168,7 +168,7 @@ public:
/// @param cfl Particle CFL number on level N
/// @param depos_width Number of cells adjacent to the cell containing the
/// particle needed to interpolate the particle source term to the mesh
static inline int getSourceGhostCells(
static int getSourceGhostCells(
const int level,
const int finest_level,
const int amr_ncycle,
Expand Down Expand Up @@ -241,7 +241,7 @@ public:
/// @param level Current AMR level
/// @param tmpSource MultiFab containing the temporary spray source data
/// @param actSource MultiFab where final source data should end up
inline void transferSource(
void transferSource(
const int& source_ghosts,
const int& level,
amrex::MultiFab& tmpSource,
Expand Down

0 comments on commit 6e22757

Please sign in to comment.