diff --git a/samples/cxx/bvp/BoundaryValueProblem.h b/samples/cxx/bvp/BoundaryValueProblem.h index 0b49e973af2..df9a0990fed 100644 --- a/samples/cxx/bvp/BoundaryValueProblem.h +++ b/samples/cxx/bvp/BoundaryValueProblem.h @@ -190,7 +190,7 @@ class BoundaryValueProblem : public Cantera::Domain1D * grid points. Overload in derived classes to specify other * choices for initial values. */ - virtual double initialValue(size_t n, size_t j) { + double initialValue(size_t n, size_t j) override { return 0.0; } diff --git a/samples/cxx/bvp/blasius.cpp b/samples/cxx/bvp/blasius.cpp index 4e3970673ae..9bb5a8084a5 100644 --- a/samples/cxx/bvp/blasius.cpp +++ b/samples/cxx/bvp/blasius.cpp @@ -58,12 +58,9 @@ class Blasius : public BVP::BoundaryValueProblem setComponent(1, B); // u will be component 1 } - // destructor - virtual ~Blasius() {} - // specify guesses for the initial values. These can be anything // that leads to a converged solution. - virtual double initialValue(size_t n, size_t j) { + double initialValue(size_t n, size_t j) override { switch (n) { case 0: return 0.1*z(j); @@ -77,7 +74,7 @@ class Blasius : public BVP::BoundaryValueProblem // Specify the residual function. This is where the ODE system and boundary // conditions are specified. The solver will attempt to find a solution // x so that rsd is zero. - void eval(size_t jg, double* x, double* rsd, int* diag, double rdt) { + void eval(size_t jg, double* x, double* rsd, int* diag, double rdt) override { size_t jpt = jg - firstPoint(); size_t jmin, jmax; if (jg == npos) { // evaluate all points diff --git a/samples/cxx/custom/custom.cpp b/samples/cxx/custom/custom.cpp index e9d5f5d521a..e60c4e5fdb5 100644 --- a/samples/cxx/custom/custom.cpp +++ b/samples/cxx/custom/custom.cpp @@ -62,7 +62,7 @@ class ReactorODEs : public FuncEval { * @param[in] p sensitivity parameter vector, length nparams() * - note: sensitivity analysis isn't implemented in this example */ - void eval(double t, double* y, double* ydot, double* p) { + void eval(double t, double* y, double* ydot, double* p) override { // the solution vector *y* is [T, Y_1, Y_2, ... Y_K], where T is the // system temperature, and Y_k is the mass fraction of species k. // similarly, the time derivative of the solution vector, *ydot*, is @@ -113,7 +113,7 @@ class ReactorODEs : public FuncEval { * Number of equations in the ODE system. * - overridden from FuncEval, called by the integrator during initialization. */ - size_t neq() const { + size_t neq() const override { return m_nEqs; } @@ -122,7 +122,7 @@ class ReactorODEs : public FuncEval { * - overridden from FuncEval, called by the integrator during initialization. * @param[out] y solution vector, length neq() */ - void getState(double* y) { + void getState(double* y) override { // the solution vector *y* is [T, Y_1, Y_2, ... Y_K], where T is the // system temperature, and Y_k is the mass fraction of species k. y[0] = m_gas->temperature();