Skip to content

Commit

Permalink
Fix clang compiler warnings (#301)
Browse files Browse the repository at this point in the history
* Fix warnings about inconsistent use of override
* Clean up axom includes
  • Loading branch information
adayton1 authored Aug 22, 2024
1 parent 1abb8bc commit a696f9a
Show file tree
Hide file tree
Showing 27 changed files with 126 additions and 121 deletions.
4 changes: 2 additions & 2 deletions src/DEM/LinearSpringDEM.hh
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ public:
//****************************************************************************
// Methods required for restarting.
virtual std::string label() const override { return "LinearSpringDEM" ; }
virtual void dumpState(FileIO& file, const std::string& pathName) const;
virtual void restoreState(const FileIO& file, const std::string& pathName);
virtual void dumpState(FileIO& file, const std::string& pathName) const override;
virtual void restoreState(const FileIO& file, const std::string& pathName) override;
//****************************************************************************
private:
//--------------------------- Private Interface ---------------------------//
Expand Down
2 changes: 1 addition & 1 deletion src/DEM/SolidBoundary/CircularPlaneSolidBoundary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public:
const Vector& velocity() const;
void velocity(const Vector& value);

virtual std::string label() const { return "CircularPlaneSolidBoundary" ; }
virtual std::string label() const override { return "CircularPlaneSolidBoundary" ; }
virtual void dumpState(FileIO& file, const std::string& pathName) const override;
virtual void restoreState(const FileIO& file, const std::string& pathName) override;

Expand Down
2 changes: 1 addition & 1 deletion src/DEM/SolidBoundary/ClippedSphereSolidBoundary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public:

void setClipIntersectionRadius();

virtual std::string label() const { return "ClippedSphereSolidBoundary" ; }
virtual std::string label() const override { return "ClippedSphereSolidBoundary" ; }
virtual void dumpState(FileIO& file, const std::string& pathName) const override;
virtual void restoreState(const FileIO& file, const std::string& pathName) override;
protected:
Expand Down
2 changes: 1 addition & 1 deletion src/DEM/SolidBoundary/CylinderSolidBoundary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public:
const Vector& velocity() const;
void velocity(const Vector& value);

virtual std::string label() const { return "CylinderSolidBoundary" ; }
virtual std::string label() const override { return "CylinderSolidBoundary" ; }
virtual void dumpState(FileIO& file, const std::string& pathName) const override;
virtual void restoreState(const FileIO& file, const std::string& pathName) override;

Expand Down
2 changes: 1 addition & 1 deletion src/DEM/SolidBoundary/InfinitePlaneSolidBoundary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public:
const Vector& velocity() const;
void velocity(const Vector& value);

virtual std::string label() const { return "InfinitePlaneSolidBoundary" ; }
virtual std::string label() const override { return "InfinitePlaneSolidBoundary" ; }
virtual void dumpState(FileIO& file, const std::string& pathName) const override;
virtual void restoreState(const FileIO& file, const std::string& pathName) override;

Expand Down
2 changes: 1 addition & 1 deletion src/DEM/SolidBoundary/RectangularPlaneSolidBoundary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public:
const Vector& velocity() const;
void velocity(const Vector& value);

virtual std::string label() const { return "RectangularPlaneSolidBoundary" ; }
virtual std::string label() const override { return "RectangularPlaneSolidBoundary" ; }
virtual void dumpState(FileIO& file, const std::string& pathName) const override;
virtual void restoreState(const FileIO& file, const std::string& pathName) override;

Expand Down
2 changes: 1 addition & 1 deletion src/DEM/SolidBoundary/SphereSolidBoundary.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public:
const RotationType& angularVelocity() const;
void angularVelocity(const RotationType& value);

virtual std::string label() const { return "SphereSolidBoundary" ; }
virtual std::string label() const override { return "SphereSolidBoundary" ; }
virtual void dumpState(FileIO& file, const std::string& pathName) const override;
virtual void restoreState(const FileIO& file, const std::string& pathName) override;

Expand Down
2 changes: 1 addition & 1 deletion src/ExternalForce/PointPotential.hh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public:

//****************************************************************************
// Methods required for restarting.
virtual std::string label() const { return "PointPotential"; }
virtual std::string label() const override { return "PointPotential"; }
virtual void dumpState(FileIO& file, const std::string& pathName) const;
virtual void restoreState(const FileIO& file, const std::string& pathName);
//****************************************************************************
Expand Down
3 changes: 2 additions & 1 deletion src/FileIO/SidreFileIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
// Created by Mikhail Zakharchanka, 11/4/2021
//----------------------------------------------------------------------------//
#include "SidreFileIO.hh"
#include "axom/core/Path.hpp"

#include "axom/sidre.hpp"

namespace Spheral
{
Expand Down
8 changes: 8 additions & 0 deletions src/FileIO/SidreFileIO.hh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@

#include <vector>

// Forward declarations
namespace axom {
namespace sidre {
class DataStore;
class Group;
}
}

namespace Spheral
{

Expand Down
15 changes: 7 additions & 8 deletions src/Geometry/GeomPolyhedron.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@
#include "Utilities/pointInPolyhedron.hh"
#include "Utilities/safeInv.hh"

#include <vector>
#include <map>
#include "axom/mint.hpp"

#include <algorithm>
#include <iterator>
#include <limits>
#include <map>
#include <vector>

using std::vector;
using std::map;
using std::pair;
Expand All @@ -35,12 +40,6 @@ extern "C" {

#include "Utilities/Timer.hh"

#include <algorithm>
#include <numeric>
#include <map>
#include <limits>
#include <iterator>

namespace Spheral {

//------------------------------------------------------------------------------
Expand Down
7 changes: 2 additions & 5 deletions src/Geometry/GeomPolyhedron.hh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@
#include "GeomTensor.hh"
#include "GeomFacet3d.hh"

#include "axom/config.hpp" // compile time definitions
#include "axom/core.hpp" // for execution_space traits
#include "axom/mint.hpp" // for mint classes and functions
#include "axom/quest.hpp" // axom surface queries (containment)
#include "axom/quest.hpp"

#include <vector>
#include <memory>
#include <utility>

namespace Spheral {

Expand Down
12 changes: 6 additions & 6 deletions src/Gravity/PolyGravity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ public:

//! We augment the generic body force state.
virtual void registerState(DataBase<Dimension>& dataBase,
State<Dimension>& state);
State<Dimension>& state) override;

//! This is the derivative method that all BodyForce classes must provide.
virtual
void evaluateDerivatives(const Scalar /*time*/,
const Scalar /*dt*/,
const DataBase<Dimension>& dataBase,
const State<Dimension>& state,
StateDerivatives<Dimension>& derivs) const;
StateDerivatives<Dimension>& derivs) const override;

//! Vote on the timestep. This uses a velocity-limiting rule.
virtual TimeStepType dt(const DataBase<Dimension>& /*dataBase*/,
const State<Dimension>& state,
const StateDerivatives<Dimension>& /*derivs*/,
const Scalar /*currentTime*/) const;
const Scalar /*currentTime*/) const override;

// An optional hook to initialize once when the problem is starting up.
// Typically this is used to size arrays once all the materials and NodeLists have
Expand All @@ -84,10 +84,10 @@ public:
StateDerivatives<Dimension>& derivs) override;

//! This package opts out of building connectivity.
virtual bool requireConnectivity() const { return false; }
virtual bool requireConnectivity() const override { return false; }

//! Return the total energy contribution due to the gravitational potential.
virtual Scalar extraEnergy() const;
virtual Scalar extraEnergy() const override;

//! Return the gravitational potential created by the particle distribution.
const FieldList<Dimension, Scalar>& potential() const;
Expand Down Expand Up @@ -117,7 +117,7 @@ public:

//****************************************************************************
// Methods required for restarting.
virtual std::string label() const { return "PolyGravity"; }
virtual std::string label() const override { return "PolyGravity"; }
virtual void dumpState(FileIO& file, const std::string& pathName) const;
virtual void restoreState(const FileIO& file, const std::string& pathName);
//****************************************************************************
Expand Down
14 changes: 7 additions & 7 deletions src/Gravity/TreeGravity.hh
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ public:

//! We augment the generic body force state.
virtual void registerState(DataBase<Dimension>& dataBase,
State<Dimension>& state);
State<Dimension>& state) override;

//! This is the derivative method that all BodyForce classes must provide.
virtual
void evaluateDerivatives(const Scalar /*time*/,
const Scalar /*dt*/,
const DataBase<Dimension>& dataBase,
const State<Dimension>& state,
StateDerivatives<Dimension>& derivs) const;
StateDerivatives<Dimension>& derivs) const override;

//! Vote on the timestep. This uses a velocity-limiting rule.
virtual TimeStepType dt(const DataBase<Dimension>& /*dataBase*/,
const State<Dimension>& state,
const StateDerivatives<Dimension>& /*derivs*/,
const Scalar /*currentTime*/) const;
const Scalar /*currentTime*/) const override;

// An optional hook to initialize once when the problem is starting up.
// Typically this is used to size arrays once all the materials and NodeLists have
Expand All @@ -89,13 +89,13 @@ public:
const Scalar /*dt*/,
const DataBase<Dimension>& dataBase,
State<Dimension>& state,
StateDerivatives<Dimension>& /*derivs*/);
StateDerivatives<Dimension>& /*derivs*/) override;

//! This package opts out of building connectivity.
virtual bool requireConnectivity() const { return false; }
virtual bool requireConnectivity() const override { return false; }

//! Return the total energy contribution due to the gravitational potential.
virtual Scalar extraEnergy() const;
virtual Scalar extraEnergy() const override;

//! Return the gravitational potential created by the particle distribution.
const FieldList<Dimension, Scalar>& potential() const;
Expand Down Expand Up @@ -133,7 +133,7 @@ public:

//****************************************************************************
// Methods required for restarting.
virtual std::string label() const { return "TreeGravity"; }
virtual std::string label() const override { return "TreeGravity"; }
virtual void dumpState(FileIO& file, const std::string& pathName) const;
virtual void restoreState(const FileIO& file, const std::string& pathName);
//****************************************************************************
Expand Down
18 changes: 9 additions & 9 deletions src/Material/HelmholtzEquationOfState.hh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public:
// We require any equation of state to define the following properties.
virtual void setPressure(Field<Dimension, Scalar>& Pressure,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setPressureAndDerivs(Field<Dimension, Scalar>& Pressure, // set pressure
Field<Dimension, Scalar>& dPdu, // set (\partial P)/(\partial u) (specific thermal energy)
Expand All @@ -49,31 +49,31 @@ public:

virtual void setTemperature(Field<Dimension, Scalar>& temperature,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setSpecificThermalEnergy(Field<Dimension, Scalar>& specificThermalEnergy,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& temperature) const;
const Field<Dimension, Scalar>& temperature) const override;

virtual void setSpecificHeat(Field<Dimension, Scalar>& specificHeat,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& temperature) const;
const Field<Dimension, Scalar>& temperature) const override;

virtual void setSoundSpeed(Field<Dimension, Scalar>& soundSpeed,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setGammaField(Field<Dimension, Scalar>& gamma,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setBulkModulus(Field<Dimension, Scalar>& bulkModulus,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setEntropy(Field<Dimension, Scalar>& entropy,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

// Some of the following methods are disabled
virtual Scalar pressure(const Scalar /*massDensity*/,
Expand Down Expand Up @@ -109,7 +109,7 @@ public:
bool getUpdateStatus() const;
void setUpdateStatus(bool bSet);

virtual bool valid() const;
virtual bool valid() const override;

private:
//--------------------------- Private Interface ---------------------------//
Expand Down
20 changes: 10 additions & 10 deletions src/Material/IsothermalEquationOfState.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public:
// We require any equation of state to define the following properties.
virtual void setPressure(Field<Dimension, Scalar>& Pressure,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setPressureAndDerivs(Field<Dimension, Scalar>& Pressure, // set pressure
Field<Dimension, Scalar>& dPdu, // set (\partial P)/(\partial u) (specific thermal energy)
Expand All @@ -43,31 +43,31 @@ public:

virtual void setTemperature(Field<Dimension, Scalar>& temperature,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setSpecificThermalEnergy(Field<Dimension, Scalar>& specificThermalEnergy,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& temperature) const;
const Field<Dimension, Scalar>& temperature) const override;

virtual void setSpecificHeat(Field<Dimension, Scalar>& specificHeat,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& temperature) const;
const Field<Dimension, Scalar>& temperature) const override;

virtual void setSoundSpeed(Field<Dimension, Scalar>& soundSpeed,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setGammaField(Field<Dimension, Scalar>& gamma,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setBulkModulus(Field<Dimension, Scalar>& bulkModulus,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

virtual void setEntropy(Field<Dimension, Scalar>& entropy,
const Field<Dimension, Scalar>& massDensity,
const Field<Dimension, Scalar>& specificThermalEnergy) const;
const Field<Dimension, Scalar>& specificThermalEnergy) const override;

// We also want the equivalent functions for individual calculations.
Scalar pressure(const Scalar massDensity,
Expand Down Expand Up @@ -96,9 +96,9 @@ public:

// Access the member data.
Scalar K() const;
virtual Scalar molecularWeight() const;
virtual Scalar molecularWeight() const override;

virtual bool valid() const;
virtual bool valid() const override;

private:
//--------------------------- Private Interface ---------------------------//
Expand Down
Loading

0 comments on commit a696f9a

Please sign in to comment.