mark overridden methods as override

quells sca warnings
This commit is contained in:
Arne Morten Kvarving 2024-08-16 14:07:57 +02:00
parent e383184598
commit 3c468c6112
4 changed files with 41 additions and 44 deletions

View File

@ -51,7 +51,7 @@ namespace Opm
typedef typename Super::GridInterface GI;
typedef typename Super::Vector Vector;
virtual void initSources(const Opm::ParameterGroup& param)
void initSources(const Opm::ParameterGroup& param) override
{
// Zero-initializing first.
int nc = this->ginterf_.numberOfCells();
@ -99,7 +99,7 @@ namespace Opm
}
}
virtual void initBoundaryConditions(const Opm::ParameterGroup& param)
void initBoundaryConditions(const Opm::ParameterGroup& param) override
{
setupBoundaryConditions(param, this->ginterf_, this->bcond_);
}

View File

@ -19,8 +19,7 @@
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
namespace Opm {
namespace Elasticity {
namespace Opm::Elasticity {
/*!
@ -43,6 +42,7 @@ protected:
{
return os;
}
public:
//! \brief Empty virtual destructor.
virtual ~Material() {}
@ -95,12 +95,12 @@ public:
//! \param[in] ID ID of the material
//! \param[in] file The URL to the rocklist
static Material* create(int ID, const std::string& file);
private:
int id; //!< External material number
double rho; //!< Mass density
};
}
}
} // namespace Opm::Elasticity
#endif

View File

@ -14,9 +14,7 @@
#include "material.hh"
namespace Opm {
namespace Elasticity {
namespace Opm::Elasticity {
/*!
\brief Isotropic linear elastic material.
@ -38,16 +36,16 @@ public:
}
//! \brief Empty virtual destructor.
virtual ~Isotropic() {}
~Isotropic() override {}
//! \brief Returns the number of parameters describing this material.
virtual int numPar() const
int numPar() const override
{
return 2;
}
//! \brief Returns the \a ipar'th parameter describing this material.
virtual double getPar(int ipar = 1) const
double getPar(int ipar = 1) const override
{
return ipar == 1 ? E : nu;
}
@ -68,17 +66,18 @@ public:
//! \brief Establishes the full constitutive matrix for this material.
//! \param[out] C The constitutive matrix
//! \param[in] invers If \e true, set up the inverse matrix instead
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
bool invers = false) const;
bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
bool invers = false) const override;
//! \brief Establishes the full constitutive matrix for this material.
//! \param[out] C The constitutive matrix
//! \param[in] invers If \e true, set up the inverse matrix instead
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
bool invers = false) const;
bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
bool invers = false) const override;
protected:
//! \brief Prints the material properties to a stream.
virtual std::ostream& write(std::ostream& os) const;
std::ostream& write(std::ostream& os) const override;
private:
double E; //!< Young's modulus
@ -101,32 +100,32 @@ public:
double Gxy, double Gxz = double(-1), double Gyz = double(-1));
//! \brief Empty virtual destructor.
virtual ~OrthotropicD() {}
~OrthotropicD() override {}
//! \brief Returns the number of parameters describing this material.
virtual int numPar() const
int numPar() const override
{
return 6;
}
//! \brief Returns the \a ipar'th parameter describing this material.
virtual double getPar(int ipar = 1) const;
double getPar(int ipar = 1) const override;
//! \brief Establishes the full constitutive matrix for this material.
//! \param[out] C The constitutive matrix
//! \param[in] invers If \e true, set up the inverse matrix instead
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
bool invers = false) const;
bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
bool invers = false) const override;
//! \brief Establishes the full constitutive matrix for this material.
//! \param[out] C The constitutive matrix
//! \param[in] invers If \e true, set up the inverse matrix instead
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
bool invers = false) const;
bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
bool invers = false) const override;
protected:
//! \brief Prints the material properties to a stream.
virtual std::ostream& write(std::ostream& os) const;
std::ostream& write(std::ostream& os) const override;
private:
double E[6]; //!< The diagonal of the constitutive matrix
@ -142,37 +141,37 @@ public:
OrthotropicSym(int ID, const Dune::DynamicVector<double>& Cu);
//! \brief Empty virtual destructor.
virtual ~OrthotropicSym() {}
~OrthotropicSym() override {}
//! \brief Returns the number of parameters describing this material.
virtual int numPar() const
int numPar() const override
{
return 21;
}
//! \brief Returns the \a ipar'th parameter describing this material.
virtual double getPar(int ipar = 1) const;
double getPar(int ipar = 1) const override;
//! \brief Establishes the full constitutive matrix for this material.
//! \param[out] C The constitutive matrix
//! \param[in] invers If \e true, set up the inverse matrix instead
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
bool invers = false) const;
bool getConstitutiveMatrix(Dune::FieldMatrix<double,6,6>& C,
bool invers = false) const override;
//! \brief Establishes the full constitutive matrix for this material.
//! \param[out] C The constitutive matrix
//! \param[in] invers If \e true, set up the inverse matrix instead
virtual bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
bool invers = false) const;
bool getConstitutiveMatrix(Dune::FieldMatrix<double,3,3>& C,
bool invers = false) const override;
protected:
//! \brief Prints the material properties to a stream.
virtual std::ostream& write(std::ostream& os) const;
std::ostream& write(std::ostream& os) const override;
private:
double Cupper[21]; //!< Upper triangle of the symmetric constitutive matrix
};
}
}
} // namespace Opm::Elasticity
#endif

View File

@ -40,7 +40,6 @@
#include <opm/porsol/euler/EulerUpstream.hpp>
#include <opm/porsol/euler/ImplicitCapillarity.hpp>
#include <opm/grid/common/GridAdapter.hpp>
#include <array>
namespace Opm
{
@ -109,8 +108,7 @@ namespace Opm
const FlowSol& flow_solution,
const std::vector<double>& saturations) const;
/// Override from superclass.
virtual void initImpl(const Opm::ParameterGroup& param);
void initImpl(const Opm::ParameterGroup& param) override;
// ------- Data members -------
std::vector<double> last_saturation_state_;