Use override on various utility classes

This commit is contained in:
Ray Speth 2023-08-14 16:38:08 -04:00 committed by Ray Speth
parent cef19a9130
commit fc2185369d
28 changed files with 227 additions and 231 deletions

View File

@ -767,7 +767,7 @@ public:
{
}
virtual string getClass() const {
string getClass() const override {
return "InputFileError";
}
protected:

View File

@ -86,7 +86,7 @@ public:
* @param m This is the number of columns in the new matrix
* @param v Default fill value -> defaults to zero.
*/
void resize(size_t n, size_t m, double v=0.0);
virtual void resize(size_t n, size_t m, double v=0.0);
//! Append a column to the existing matrix using a std vector
/*!

View File

@ -24,7 +24,7 @@ public:
}
//! Delete the static instance of this factory
virtual void deleteFactory();
void deleteFactory() override;
//! Static function that returns the static instance of the factory, creating it
//! if necessary.

View File

@ -14,10 +14,8 @@ namespace Cantera {
class NoExitLogger : public Logger {
public:
NoExitLogger() {}
virtual ~NoExitLogger() {}
virtual void error(const string& msg)
{
void error(const string& msg) override {
std::cerr << msg << std::endl;
}
};

View File

@ -94,7 +94,7 @@ public:
virtual ~CanteraError() throw() {};
//! Get a description of the error
const char* what() const throw();
const char* what() const throw() override;
//! Method overridden by derived classes to format the error message
virtual string getMessage() const;
@ -147,8 +147,8 @@ public:
ArraySizeError(const string& procedure, size_t sz, size_t reqd) :
CanteraError(procedure), sz_(sz), reqd_(reqd) {}
virtual string getMessage() const;
virtual string getClass() const {
string getMessage() const override;
string getClass() const override {
return "ArraySizeError";
}
@ -178,9 +178,9 @@ public:
IndexError(const string& func, const string& arrayName, size_t m, size_t mmax) :
CanteraError(func), arrayName_(arrayName), m_(m), mmax_(mmax) {}
virtual ~IndexError() throw() {};
virtual string getMessage() const;
virtual string getClass() const {
~IndexError() throw() override {};
string getMessage() const override;
string getClass() const override {
return "IndexError";
}
@ -204,7 +204,7 @@ public:
NotImplementedError(const string& func, const string& msg, const Args&... args) :
CanteraError(func, msg, args...) {}
virtual string getClass() const {
string getClass() const override {
return "NotImplementedError";
}
};

View File

@ -100,7 +100,7 @@ public:
Py_XDECREF(m_value);
}
std::string getMessage() const {
std::string getMessage() const override {
std::string msg;
PyObject* name = PyObject_GetAttrString(m_type, "__name__");
@ -130,7 +130,7 @@ public:
return msg;
}
virtual std::string getClass() const {
std::string getClass() const override {
return "Exception";
}
@ -148,7 +148,7 @@ public:
m_pyobj(pyobj) {
}
double eval(double t) const {
double eval(double t) const override {
void* err[2] = {0, 0};
double y = m_callback(t, m_pyobj, err);
if (err[0]) {

View File

@ -50,7 +50,7 @@ inline int get_sundials_version()
class PythonLogger : public Cantera::Logger
{
public:
virtual void write(const std::string& s) {
void write(const std::string& s) override {
// 1000 bytes is the maximum size permitted by PySys_WriteStdout
static const size_t N = 999;
for (size_t i = 0; i < s.size(); i+=N) {
@ -59,12 +59,12 @@ public:
std::cout.flush();
}
virtual void writeendl() {
void writeendl() override {
PySys_WriteStdout("%s", "\n");
std::cout.flush();
}
virtual void warn(const std::string& warning, const std::string& msg) {
void warn(const std::string& warning, const std::string& msg) override {
if (mapped_PyWarnings.find(warning) != mapped_PyWarnings.end()) {
PyErr_WarnEx(mapped_PyWarnings[warning], msg.c_str(), 1);
} else {
@ -73,7 +73,7 @@ public:
}
}
virtual void error(const std::string& msg) {
void error(const std::string& msg) override {
PyErr_SetString(PyExc_RuntimeError, msg.c_str());
}
};

View File

@ -25,7 +25,7 @@ namespace Cantera
class PythonExtensionManager : public ExtensionManager
{
public:
virtual void registerRateBuilders(const string& extensionName) override;
void registerRateBuilders(const string& extensionName) override;
void registerRateBuilder(const string& moduleName,
const string& className, const string& rateName) override;

View File

@ -23,12 +23,12 @@ class KineticsFactory : public Factory<Kinetics>
public:
static KineticsFactory* factory();
virtual void deleteFactory();
void deleteFactory() override;
/**
* Return a new, empty kinetics manager.
*/
virtual Kinetics* newKinetics(const string& model);
Kinetics* newKinetics(const string& model);
private:
static KineticsFactory* s_factory;

View File

@ -64,7 +64,7 @@ public:
*/
static ReactionRateFactory* factory();
virtual void deleteFactory();
void deleteFactory() override;
private:
//! Pointer to the single instance of the factory

View File

@ -41,9 +41,9 @@ public:
void setValue(size_t row, size_t col, double value) override;
virtual void stateAdjustment(vector<double>& state) override;
void stateAdjustment(vector<double>& state) override;
virtual void updatePreconditioner() override;
void updatePreconditioner() override;
//! Prune preconditioner elements
void prunePreconditioner();

View File

@ -74,8 +74,8 @@ public:
*/
void bfill(double v = 0.0);
double& operator()(size_t i, size_t j);
double operator()(size_t i, size_t j) const;
double& operator()(size_t i, size_t j) override;
double operator()(size_t i, size_t j) const override;
//! Return a changeable reference to element (i,j).
/*!
@ -117,7 +117,7 @@ public:
*/
double _value(size_t i, size_t j) const;
virtual size_t nRows() const;
size_t nRows() const override;
//! Number of columns
size_t nColumns() const;
@ -132,8 +132,8 @@ public:
size_t ldim() const;
//! Multiply A*b and write result to @c prod.
virtual void mult(const double* b, double* prod) const;
virtual void leftMult(const double* const b, double* const prod) const;
void mult(const double* b, double* prod) const override;
void leftMult(const double* const b, double* const prod) const override;
//! Perform an LU decomposition, the LAPACK routine DGBTRF is used.
/*!
@ -142,7 +142,7 @@ public:
* @returns a success flag. 0 indicates a success; ~0 indicates some
* error occurred, see the LAPACK documentation
*/
int factor();
int factor() override;
//! Solve the matrix problem Ax = b
/*!
@ -162,14 +162,14 @@ public:
* @returns a success flag. 0 indicates a success; ~0 indicates some error
* occurred, see the LAPACK documentation
*/
int solve(double* b, size_t nrhs=1, size_t ldb=0);
int solve(double* b, size_t nrhs=1, size_t ldb=0) override;
//! Returns an iterator for the start of the band storage data
/*!
* Iterator points to the beginning of the data, and it is changeable.
* @deprecated Unused. To be removed after %Cantera 3.0.
*/
virtual vector<double>::iterator begin();
vector<double>::iterator begin() override;
//! Returns an iterator for the end of the band storage data
/*!
@ -183,7 +183,7 @@ public:
* Iterator points to the beginning of the data, and it is not changeable.
* @deprecated Unused. To be removed after %Cantera 3.0.
*/
vector<double>::const_iterator begin() const;
vector<double>::const_iterator begin() const override;
//! Returns a const iterator for the end of the band storage data
/*!
@ -192,7 +192,7 @@ public:
*/
vector<double>::const_iterator end() const;
virtual void zero();
void zero() override;
//! Returns an estimate of the inverse of the condition number for the matrix
/*!
@ -201,14 +201,14 @@ public:
* @param a1norm Norm of the matrix
* @returns the inverse of the condition number
*/
virtual double rcond(double a1norm);
double rcond(double a1norm) override;
//! Returns the factor algorithm used. This method will always return 0
//! (LU) for band matrices.
virtual int factorAlgorithm() const;
int factorAlgorithm() const override;
//! Returns the one norm of the matrix
virtual double oneNorm() const;
double oneNorm() const override;
//! Return a pointer to the top of column j
/*!
@ -232,7 +232,7 @@ public:
* @param j Value of the column
* @returns a pointer to the top of the column
*/
virtual double* ptrColumn(size_t j);
double* ptrColumn(size_t j) override;
//! Return a vector of const pointers to the columns
/*!
@ -241,7 +241,7 @@ public:
*
* @returns a vector of pointers to the top of the columns of the matrices.
*/
virtual double* const* colPts();
double* const* colPts() override;
//! Check to see if we have any zero rows in the Jacobian
/*!
@ -251,7 +251,7 @@ public:
* @param valueSmall OUTPUT value of the largest coefficient in the smallest row
* @return index of the row that is most nearly zero
*/
virtual size_t checkRows(double& valueSmall) const;
size_t checkRows(double& valueSmall) const override;
//! Check to see if we have any zero columns in the Jacobian
/*!
@ -261,7 +261,7 @@ public:
* @param valueSmall OUTPUT value of the largest coefficient in the smallest column
* @return index of the column that is most nearly zero
*/
virtual size_t checkColumns(double& valueSmall) const;
size_t checkColumns(double& valueSmall) const override;
//! LAPACK "info" flag after last factor/solve operation
int info() const { return m_info; };

View File

@ -31,53 +31,53 @@ public:
* Jacobian function, Newton iteration.
*/
CVodesIntegrator();
virtual ~CVodesIntegrator();
virtual void setTolerances(double reltol, size_t n, double* abstol);
virtual void setTolerances(double reltol, double abstol);
virtual void setSensitivityTolerances(double reltol, double abstol);
virtual void initialize(double t0, FuncEval& func);
virtual void reinitialize(double t0, FuncEval& func);
virtual void integrate(double tout);
virtual double step(double tout);
virtual double& solution(size_t k);
virtual double* solution();
virtual double* derivative(double tout, int n);
virtual int lastOrder() const;
virtual int nEquations() const {
~CVodesIntegrator() override;
void setTolerances(double reltol, size_t n, double* abstol) override;
void setTolerances(double reltol, double abstol) override;
void setSensitivityTolerances(double reltol, double abstol) override;
void initialize(double t0, FuncEval& func) override;
void reinitialize(double t0, FuncEval& func) override;
void integrate(double tout) override;
double step(double tout) override;
double& solution(size_t k) override;
double* solution() override;
double* derivative(double tout, int n) override;
int lastOrder() const override;
int nEquations() const override{
return static_cast<int>(m_neq);
}
virtual int nEvals() const;
virtual void setMaxOrder(int n) {
int nEvals() const override;
void setMaxOrder(int n) override {
m_maxord = n;
}
virtual void setMethod(MethodType t);
virtual void setMaxStepSize(double hmax);
virtual void setMinStepSize(double hmin);
virtual void setMaxSteps(int nmax);
virtual int maxSteps();
virtual void setMaxErrTestFails(int n);
virtual AnyMap solverStats() const;
void setLinearSolverType(const string& linSolverType) {
void setMethod(MethodType t) override;
void setMaxStepSize(double hmax) override;
void setMinStepSize(double hmin) override;
void setMaxSteps(int nmax) override;
int maxSteps() override;
void setMaxErrTestFails(int n) override;
AnyMap solverStats() const override;
void setLinearSolverType(const string& linSolverType) override {
m_type = linSolverType;
}
virtual string linearSolverType() const {
string linearSolverType() const override {
return m_type;
}
virtual void setBandwidth(int N_Upper, int N_Lower) {
void setBandwidth(int N_Upper, int N_Lower) override {
m_mupper = N_Upper;
m_mlower = N_Lower;
}
virtual int nSensParams() {
int nSensParams() override {
return static_cast<int>(m_np);
}
virtual double sensitivity(size_t k, size_t p);
virtual void setProblemType(int probtype);
double sensitivity(size_t k, size_t p) override;
void setProblemType(int probtype) override;
//! Returns a string listing the weighted error estimates associated
//! with each solution component.
//! This information can be used to identify which variables are
//! responsible for integrator failures or unexpected small timesteps.
virtual string getErrorInfo(int N);
string getErrorInfo(int N);
//! Error message information provide by CVodes
string m_error_message;

View File

@ -78,7 +78,7 @@ public:
* @param m New number of columns
* @param v Default fill value. defaults to zero.
*/
void resize(size_t n, size_t m, double v = 0.0);
void resize(size_t n, size_t m, double v=0.0) override;
virtual double* const* colPts();

View File

@ -293,23 +293,23 @@ public:
return *this;
}
virtual string write(const string& arg) const;
string write(const string& arg) const override;
virtual int ID() const {
int ID() const override {
return SinFuncType;
}
virtual string type() const {
string type() const override {
return "sin";
}
virtual double eval(double t) const {
double eval(double t) const override{
return sin(m_c*t);
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
virtual shared_ptr<Func1> derivative3() const;
Func1& duplicate() const override;
Func1& derivative() const override;
shared_ptr<Func1> derivative3() const override;
};
@ -342,20 +342,20 @@ public:
return *this;
}
virtual Func1& duplicate() const;
virtual string write(const string& arg) const;
virtual int ID() const {
Func1& duplicate() const override;
string write(const string& arg) const override;
int ID() const override {
return CosFuncType;
}
virtual string type() const {
string type() const override {
return "cos";
}
virtual double eval(double t) const {
double eval(double t) const override {
return cos(m_c * t);
}
virtual Func1& derivative() const;
virtual shared_ptr<Func1> derivative3() const;
Func1& derivative() const override;
shared_ptr<Func1> derivative3() const override;
};
@ -385,21 +385,21 @@ public:
Func1::operator=(right);
return *this;
}
virtual string write(const string& arg) const;
virtual int ID() const {
string write(const string& arg) const override;
int ID() const override {
return ExpFuncType;
}
virtual string type() const {
string type() const override {
return "exp";
}
virtual double eval(double t) const {
double eval(double t) const override {
return exp(m_c*t);
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
virtual shared_ptr<Func1> derivative3() const;
Func1& duplicate() const override;
Func1& derivative() const override;
shared_ptr<Func1> derivative3() const override;
};
@ -420,17 +420,17 @@ public:
//! Constructor uses single parameter (factor)
Log1(const vector<double>& params);
virtual string type() const {
string type() const override {
return "log";
}
virtual double eval(double t) const {
double eval(double t) const override {
return log(m_c * t);
}
virtual shared_ptr<Func1> derivative3() const;
shared_ptr<Func1> derivative3() const override;
virtual string write(const string& arg) const;
string write(const string& arg) const override;
};
//! Implements the @c pow() (power) function.
@ -459,20 +459,20 @@ public:
Func1::operator=(right);
return *this;
}
virtual string write(const string& arg) const;
virtual int ID() const {
string write(const string& arg) const override;
int ID() const override {
return PowFuncType;
}
virtual string type() const {
string type() const override {
return "pow";
}
virtual double eval(double t) const {
double eval(double t) const override {
return pow(t, m_c);
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
virtual shared_ptr<Func1> derivative3() const;
Func1& duplicate() const override;
Func1& derivative() const override;
shared_ptr<Func1> derivative3() const override;
};
//! Implements a tabulated function.
@ -509,21 +509,21 @@ public:
//! @since New in %Cantera 3.0
void setMethod(const string& method);
virtual string write(const string& arg) const;
virtual int ID() const {
string write(const string& arg) const override;
int ID() const override {
return TabulatedFuncType;
}
virtual string type() const {
string type() const override {
if (m_isLinear) {
return "tabulated-linear";
}
return "tabulated-previous";
}
virtual double eval(double t) const;
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
virtual shared_ptr<Func1> derivative3() const;
double eval(double t) const override;
Func1& duplicate() const override;
Func1& derivative() const override;
shared_ptr<Func1> derivative3() const override;
private:
vector<double> m_tvec; //!< Vector of time values
vector<double> m_fvec; //!< Vector of function values
@ -559,20 +559,20 @@ public:
return *this;
}
virtual string write(const string& arg) const;
virtual int ID() const {
string write(const string& arg) const override;
int ID() const override {
return ConstFuncType;
}
virtual string type() const {
string type() const override {
return "constant";
}
virtual double eval(double t) const {
double eval(double t) const override {
return m_c;
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
virtual shared_ptr<Func1> derivative3() const {
Func1& duplicate() const override;
Func1& derivative() const override;
shared_ptr<Func1> derivative3() const override {
return make_shared<Const1>(0.0);
}
};
@ -597,7 +597,7 @@ public:
Sum1(shared_ptr<Func1> f1, shared_ptr<Func1> f2) : Func1(f1, f2) {}
virtual ~Sum1() {
~Sum1() override {
if (!m_f1_shared) {
delete m_f1;
}
@ -624,29 +624,29 @@ public:
return *this;
}
virtual int ID() const {
int ID() const override {
return SumFuncType;
}
virtual string type() const {
string type() const override {
return "sum";
}
virtual double eval(double t) const {
double eval(double t) const override {
return m_f1->eval(t) + m_f2->eval(t);
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
Func1& duplicate() const override;
Func1& derivative() const override;
virtual shared_ptr<Func1> derivative3() const {
shared_ptr<Func1> derivative3() const override {
return newSumFunction(m_f1_shared->derivative3(), m_f2_shared->derivative3());
}
virtual int order() const {
int order() const override {
return 0;
}
virtual string write(const string& arg) const;
string write(const string& arg) const override;
};
/**
@ -668,7 +668,7 @@ public:
Diff1(shared_ptr<Func1> f1, shared_ptr<Func1> f2) : Func1(f1, f2) {}
virtual ~Diff1() {
~Diff1() override {
if (!m_f1_shared) {
delete m_f1;
}
@ -695,30 +695,30 @@ public:
return *this;
}
virtual int ID() const {
int ID() const override {
return DiffFuncType;
}
virtual string type() const {
string type() const override {
return "diff";
}
virtual double eval(double t) const {
double eval(double t) const override {
return m_f1->eval(t) - m_f2->eval(t);
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
Func1& duplicate() const override;
Func1& derivative() const override;
virtual shared_ptr<Func1> derivative3() const {
shared_ptr<Func1> derivative3() const override {
return newDiffFunction(m_f1_shared->derivative3(), m_f2_shared->derivative3());
}
virtual int order() const {
int order() const override {
return 0;
}
virtual string write(const string& arg) const;
string write(const string& arg) const override;
};
@ -741,7 +741,7 @@ public:
Product1(shared_ptr<Func1> f1, shared_ptr<Func1> f2) : Func1(f1, f2) {}
virtual ~Product1() {
~Product1() override {
if (!m_f1_shared) {
delete m_f1;
}
@ -768,26 +768,26 @@ public:
return *this;
}
virtual int ID() const {
int ID() const override {
return ProdFuncType;
}
virtual string type() const {
string type() const override {
return "product";
}
virtual string write(const string& arg) const;
string write(const string& arg) const override;
virtual double eval(double t) const {
double eval(double t) const override {
return m_f1->eval(t) * m_f2->eval(t);
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
Func1& duplicate() const override;
Func1& derivative() const override;
virtual shared_ptr<Func1> derivative3() const;
shared_ptr<Func1> derivative3() const override;
virtual int order() const {
int order() const override {
return 1;
}
};
@ -810,7 +810,7 @@ public:
TimesConstant1(shared_ptr<Func1> f1, double a) : Func1(f1, a) {}
virtual ~TimesConstant1() {
~TimesConstant1() override {
if (!m_f1_shared) {
delete m_f1;
}
@ -831,14 +831,14 @@ public:
m_parent = 0;
return *this;
}
virtual int ID() const {
int ID() const override {
return TimesConstantFuncType;
}
virtual string type() const {
string type() const override {
return "times-constant";
}
virtual double isProportional(TimesConstant1& other) {
double isProportional(TimesConstant1& other) override {
if (func1().isIdentical(other.func1())) {
return (other.c()/c());
} else {
@ -846,7 +846,7 @@ public:
}
}
virtual double isProportional(Func1& other) {
double isProportional(Func1& other) override {
if (func1().isIdentical(other)) {
return 1.0/c();
} else {
@ -854,20 +854,20 @@ public:
}
}
virtual double eval(double t) const {
double eval(double t) const override {
return m_f1->eval(t) * m_c;
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
Func1& duplicate() const override;
Func1& derivative() const override;
virtual shared_ptr<Func1> derivative3() const {
shared_ptr<Func1> derivative3() const override {
return newTimesConstFunction(m_f1_shared->derivative3(), m_c);
}
virtual string write(const string& arg) const;
string write(const string& arg) const override;
virtual int order() const {
int order() const override {
return 0;
}
};
@ -890,7 +890,7 @@ public:
PlusConstant1(shared_ptr<Func1> f1, double a) : Func1(f1, a) {}
virtual ~PlusConstant1() {
~PlusConstant1() override {
if (!m_f1_shared) {
delete m_f1;
}
@ -912,27 +912,27 @@ public:
return *this;
}
virtual int ID() const {
int ID() const override {
return PlusConstantFuncType;
}
virtual string type() const {
string type() const override {
return "plus-constant";
}
virtual double eval(double t) const {
double eval(double t) const override {
return m_f1->eval(t) + m_c;
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
Func1& duplicate() const override;
Func1& derivative() const override;
virtual shared_ptr<Func1> derivative3() const {
shared_ptr<Func1> derivative3() const override {
return m_f1_shared->derivative3();
}
virtual string write(const string& arg) const;
string write(const string& arg) const override;
virtual int order() const {
int order() const override {
return 0;
}
};
@ -957,7 +957,7 @@ public:
Ratio1(shared_ptr<Func1> f1, shared_ptr<Func1> f2) : Func1(f1, f2) {}
virtual ~Ratio1() {
~Ratio1() override {
if (!m_f1_shared) {
delete m_f1;
}
@ -984,25 +984,25 @@ public:
return *this;
}
virtual int ID() const {
int ID() const override {
return RatioFuncType;
}
virtual string type() const {
string type() const override {
return "ratio";
}
virtual double eval(double t) const {
double eval(double t) const override {
return m_f1->eval(t) / m_f2->eval(t);
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
Func1& duplicate() const override;
Func1& derivative() const override;
virtual shared_ptr<Func1> derivative3() const;
shared_ptr<Func1> derivative3() const override;
virtual string write(const string& arg) const;
string write(const string& arg) const override;
virtual int order() const {
int order() const override {
return 1;
}
};
@ -1026,7 +1026,7 @@ public:
Composite1(shared_ptr<Func1> f1, shared_ptr<Func1> f2) : Func1(f1, f2) {}
virtual ~Composite1() {
~Composite1() override {
if (!m_f1_shared) {
delete m_f1;
}
@ -1053,25 +1053,25 @@ public:
return *this;
}
virtual int ID() const {
int ID() const override {
return CompositeFuncType;
}
virtual string type() const {
string type() const override {
return "composite";
}
virtual double eval(double t) const {
double eval(double t) const override {
return m_f1->eval(m_f2->eval(t));
}
virtual Func1& duplicate() const;
virtual Func1& derivative() const;
Func1& duplicate() const override;
Func1& derivative() const override;
virtual shared_ptr<Func1> derivative3() const;
shared_ptr<Func1> derivative3() const override;
virtual string write(const string& arg) const;
string write(const string& arg) const override;
virtual int order() const {
int order() const override {
return 2;
}
};
@ -1122,11 +1122,11 @@ public:
return *this;
}
virtual string type() const {
string type() const override {
return "Gaussian";
}
virtual double eval(double t) const {
double eval(double t) const override {
double x = (t - m_t0)/m_tau;
return m_A * std::exp(-x*x);
}
@ -1154,7 +1154,7 @@ class Gaussian : public Gaussian1
Gaussian(const Gaussian& b);
virtual Func1& duplicate() const;
Func1& duplicate() const override;
};
@ -1193,13 +1193,13 @@ public:
return *this;
}
virtual string type() const {
string type() const override {
return "polynomial";
}
virtual Func1& duplicate() const;
Func1& duplicate() const override;
virtual double eval(double t) const {
double eval(double t) const override {
double r = m_cpoly[m_cpoly.size()-1];
for (size_t n = 1; n < m_cpoly.size(); n++) {
r *= t;
@ -1256,13 +1256,13 @@ public:
return *this;
}
virtual string type() const {
string type() const override {
return "Fourier";
}
virtual Func1& duplicate() const;
Func1& duplicate() const override;
virtual double eval(double t) const {
double eval(double t) const override {
size_t n, nn;
double sum = m_a0_2;
for (n = 0; n < m_ccos.size(); n++) {
@ -1323,13 +1323,13 @@ public:
return *this;
}
virtual string type() const {
string type() const override {
return "Arrhenius";
}
virtual Func1& duplicate() const;
Func1& duplicate() const override;
virtual double eval(double t) const {
double eval(double t) const override {
double sum = 0.0;
for (size_t n = 0; n < m_A.size(); n++) {
sum += m_A[n]*std::pow(t,m_b[n])*std::exp(-m_E[n]/t);
@ -1371,19 +1371,19 @@ public:
return *this;
}
virtual string type() const {
string type() const override {
return "periodic";
}
virtual Func1& duplicate() const;
Func1& duplicate() const override;
virtual ~Periodic1() {
~Periodic1() override {
if (!m_f1_shared) {
delete m_f1;
}
}
virtual double eval(double t) const {
double eval(double t) const override {
int np = int(t/m_c);
double time = t - np*m_c;
return m_f1->eval(time);

View File

@ -30,7 +30,7 @@ public:
*/
static Func1Factory* factory();
virtual void deleteFactory();
void deleteFactory() override;
private:
//! Pointer to the single instance of the factory
@ -64,7 +64,7 @@ public:
*/
static Math1FactoryA* factory();
virtual void deleteFactory();
void deleteFactory() override;
private:
//! Pointer to the single instance of the factory
@ -97,7 +97,7 @@ public:
*/
static Math1FactoryB* factory();
virtual void deleteFactory();
void deleteFactory() override;
private:
//! Pointer to the single instance of the factory

View File

@ -20,7 +20,7 @@ public:
static PreconditionerFactory* factory();
//! Delete preconditioner factory
virtual void deleteFactory();
void deleteFactory() override;
private:
static PreconditionerFactory* s_factory;

View File

@ -69,7 +69,7 @@ public:
ResidJacEval(double atol = 1.0e-13);
//! Return the number of equations in the equation system
virtual int nEquations() const;
int nEquations() const override;
//! Evaluate the residual function
/*!
@ -96,11 +96,10 @@ public:
const int id_x = -1,
const double delta_x = 0.0);
virtual int eval(const double t, const double* const y,
const double* const ydot,
double* const r);
int eval(const double t, const double* const y, const double* const ydot,
double* const r) override;
virtual int getInitialConditions(const double t0, double* const y, double* const ydot);
int getInitialConditions(const double t0, double* const y, double* const ydot) override;
//! Filter the solution predictions
/*!

View File

@ -29,7 +29,7 @@ public:
*/
static DomainFactory* factory();
virtual void deleteFactory();
void deleteFactory() override;
private:
//! Pointer to the single instance of the factory

View File

@ -20,7 +20,7 @@ public:
static PDSSFactory* factory();
//! delete the static instance of this factory
virtual void deleteFactory();
void deleteFactory() override;
//! Create a new thermodynamic property manager.
/*!
@ -29,7 +29,7 @@ public:
* Returns NULL if something went wrong. Throws an exception if the string
* wasn't matched.
*/
virtual PDSS* newPDSS(const string& model);
PDSS* newPDSS(const string& model);
private:
//! static member of a single instance

View File

@ -205,7 +205,7 @@ public:
bool addSpecies(shared_ptr<Species> spec) override;
//! Since interface phases have no volume, this returns 0.0.
virtual double molarVolume() const override {
double molarVolume() const override {
return 0.0;
}

View File

@ -34,7 +34,7 @@ public:
static ThermoFactory* factory();
//! delete the static instance of this factory
virtual void deleteFactory();
void deleteFactory() override;
//! Create a new thermodynamic property manager.
/*!
@ -43,7 +43,7 @@ public:
* CanteraError if the named model isn't registered with ThermoFactory.
* @deprecated To be removed after %Cantera 3.0; superseded by newThermo()
*/
virtual ThermoPhase* newThermoPhase(const string& model);
ThermoPhase* newThermoPhase(const string& model);
private:
//! static member of a single instance

View File

@ -45,7 +45,7 @@ public:
static TransportFactory* factory();
//! Deletes the statically allocated factory instance.
virtual void deleteFactory();
void deleteFactory() override;
//! Build a new transport manager using a transport manager
//! that may not be the same as in the phase description
@ -55,8 +55,7 @@ public:
* @param thermo ThermoPhase object
* @param log_level log level
*/
virtual Transport* newTransport(const string& model, ThermoPhase* thermo,
int log_level=0);
Transport* newTransport(const string& model, ThermoPhase* thermo, int log_level=0);
//! Build a new transport manager using the default transport manager
//! in the phase description and return a base class pointer to it
@ -64,7 +63,7 @@ public:
* @param thermo ThermoPhase object
* @param log_level log level
*/
virtual Transport* newTransport(ThermoPhase* thermo, int log_level=0);
Transport* newTransport(ThermoPhase* thermo, int log_level=0);
private:
//! Static instance of the factor -> This is the only instance of this

View File

@ -24,14 +24,14 @@ class FlowDeviceFactory : public Factory<FlowDevice>
public:
static FlowDeviceFactory* factory();
virtual void deleteFactory();
void deleteFactory() override;
//! Create a new flow device by type name.
/*!
* @param flowDeviceType the type to be created.
* @deprecated To be removed after %Cantera 3.0; replaceable by newFlowDevice3.
*/
virtual FlowDevice* newFlowDevice(const string& flowDeviceType);
FlowDevice* newFlowDevice(const string& flowDeviceType);
private:
static FlowDeviceFactory* s_factory;

View File

@ -24,14 +24,14 @@ class ReactorFactory : public Factory<ReactorBase>
public:
static ReactorFactory* factory();
virtual void deleteFactory();
void deleteFactory() override;
//! Create a new reactor by type name.
/*!
* @param reactorType the type to be created.
* @deprecated To be removed after %Cantera 3.0; replaceable by newReactor3.
*/
virtual ReactorBase* newReactor(const string& reactorType);
ReactorBase* newReactor(const string& reactorType);
private:
static ReactorFactory* s_factory;

View File

@ -24,14 +24,14 @@ class WallFactory : public Factory<WallBase>
public:
static WallFactory* factory();
virtual void deleteFactory();
void deleteFactory() override;
//! Create a new wall by type name.
/*!
* @param wallType the type to be created.
* @deprecated To be removed after %Cantera 3.0; replaceable by newWall3.
*/
virtual WallBase* newWall(const string& wallType);
WallBase* newWall(const string& wallType);
private:
static WallFactory* s_factory;

View File

@ -18,17 +18,17 @@ class ML_Logger : public Logger
{
public:
ML_Logger() {}
virtual ~ML_Logger() {}
~ML_Logger() override {}
virtual void write(const string& s) {
void write(const string& s) override {
mexPrintf("%s", s.c_str());
}
virtual void writeendl() {
void writeendl() override {
mexPrintf("\n");
}
virtual void error(const string& msg) {
void error(const string& msg) override {
mexErrMsgTxt(msg.c_str());
}
};

View File

@ -10,11 +10,11 @@ public:
m_fs.open(fName, std::ios::out);
}
virtual void write(const std::string& msg) {
void write(const std::string& msg) override {
m_fs << msg;
}
virtual void writeendl() {
void writeendl() override {
m_fs << std::endl;
}