mark methods override

This commit is contained in:
Arne Morten Kvarving
2025-01-21 12:51:26 +01:00
parent 6b53f5b4e8
commit 1c537632fc
30 changed files with 114 additions and 98 deletions

View File

@@ -48,9 +48,9 @@ public:
void init(Something /*A*/){}
void prepareTracerBatches(){};
using NeighborSet = std::set<unsigned>;
void linearize(SparseMatrixAdapter& /*matrix*/, GlobalEqVector& /*residual*/){};
unsigned numDofs() const{return 0;};
void addNeighbors(std::vector<NeighborSet>& /*neighbors*/) const{};
void linearize(SparseMatrixAdapter& /*matrix*/, GlobalEqVector& /*residual*/) override {}
unsigned numDofs() const override { return 0; }
void addNeighbors(std::vector<NeighborSet>& /*neighbors*/) const override {}
//void applyInitial(){};
void initialSolutionApplied(){};
//void initFromRestart(const data::Aquifers& aquiferSoln);
@@ -73,7 +73,7 @@ public:
void endIteration()const{};
void endTimeStep(){};
void endEpisode(){};
void applyInitial(){};
void applyInitial() override {}
template<class RateType>
void computeTotalRatesForDof(RateType& /*rate*/, unsigned /*globalIdx*/) const{};

View File

@@ -132,7 +132,7 @@ class FlowExpProblem : public FlowProblemBlackoil<TypeTag> //, public FvBaseProb
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
public:
void writeOutput(bool verbose = true)
void writeOutput(bool verbose = true) override
{
OPM_TIMEBLOCK(problemWriteOutput);
// use the generic code to prepare the output fields and to

View File

@@ -94,7 +94,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if constexpr (enableEnergy) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -120,7 +120,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if constexpr (enableEnergy) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -161,7 +161,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
if constexpr (enableEnergy) {
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);

View File

@@ -90,7 +90,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if constexpr (enableMICP) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -119,7 +119,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if constexpr (enableMICP) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -161,7 +161,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
if constexpr (enableMICP) {
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);

View File

@@ -94,7 +94,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.gasDissolutionFactorOutput_) {
this->resizeScalarBuffer_(gasDissolutionFactor_);
@@ -138,7 +138,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -243,7 +243,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter *vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -98,7 +98,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if constexpr (enablePolymer) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -130,7 +130,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if constexpr (enablePolymer) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -177,7 +177,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
if constexpr (enablePolymer) {
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);

View File

@@ -91,7 +91,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if constexpr (enableSolvent) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -120,7 +120,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if constexpr (enableSolvent) {
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
@@ -163,7 +163,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
if constexpr (enableSolvent) {
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);

View File

@@ -92,7 +92,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.moleFracOutput_) {
this->resizePhaseComponentBuffer_(moleFrac_);
@@ -122,7 +122,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant
* for an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
using Toolbox = MathToolbox<Evaluation>;
@@ -191,7 +191,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -93,7 +93,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.tortuosityOutput_) {
this->resizePhaseBuffer_(tortuosity_);
@@ -110,7 +110,7 @@ public:
* \brief Modify the internal buffers according to the intensive quanties relevant
* for an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -141,7 +141,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -102,7 +102,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.saturationOutput_) {
this->resizePhaseBuffer_(fractureSaturation_);
@@ -141,7 +141,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -228,7 +228,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -92,7 +92,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.enthalpyOutput_) {
this->resizePhaseBuffer_(enthalpy_);
@@ -113,7 +113,7 @@ public:
* \brief Modify the internal buffers according to the intensive quanties relevant
* for an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -145,7 +145,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -110,7 +110,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.extrusionFactorOutput_) {
this->resizeScalarBuffer_(extrusionFactor_);
@@ -174,7 +174,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities seen on
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -294,7 +294,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -139,7 +139,7 @@ public:
commSize_ = gridView.comm().size();
}
~VtkMultiWriter()
~VtkMultiWriter() override
{
taskletRunner_.barrier();
releaseBuffers_();
@@ -176,7 +176,7 @@ public:
/*!
* \brief Called whenever a new time step must be written.
*/
void beginWrite(double t)
void beginWrite(double t) override
{
if (!multiFile_.is_open()) {
startMultiFile_(multiFileName_);

View File

@@ -78,7 +78,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.phasePresenceOutput_) {
this->resizeScalarBuffer_(phasePresence_);
@@ -89,7 +89,7 @@ public:
* \brief Modify the internal buffers according to the intensive quanties relevant
* for an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -109,7 +109,7 @@ public:
/*!
* \brief Add all buffers to the output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -79,7 +79,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.primaryVarsOutput_) {
this->resizeEqBuffer_(primaryVars_);
@@ -97,7 +97,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -128,7 +128,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -88,7 +88,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.LOutput_) {
this->resizeScalarBuffer_(L_);
@@ -102,7 +102,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant
* for an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
using Toolbox = MathToolbox<Evaluation>;
@@ -130,7 +130,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
auto* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -81,7 +81,7 @@ public:
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (params_.temperatureOutput_) {
this->resizeScalarBuffer_(temperature_);
@@ -92,7 +92,7 @@ public:
* \brief Modify the internal buffers according to the intensive quantities relevant
* for an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
using Toolbox = MathToolbox<Evaluation>;
@@ -114,7 +114,7 @@ public:
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter* vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter) {

View File

@@ -94,7 +94,7 @@ class TaskletRunner
public:
explicit BarrierTasklet(unsigned numWorkers);
void run();
void run() override;
void wait();
@@ -111,10 +111,10 @@ class TaskletRunner
class TerminateThreadTasklet : public TaskletInterface
{
public:
void run()
void run() override
{ }
bool isEndMarker() const
bool isEndMarker() const override
{ return true; }
};

View File

@@ -173,7 +173,7 @@ struct EclWriteTasklet : public Opm::TaskletInterface
{}
// callback to eclIO serial writeTimeStep method
void run()
void run() override
{
this->eclIO_.writeTimeStep(this->actionState_,
this->wtestState_,

View File

@@ -166,7 +166,7 @@ public:
}
}
~SimulatorFullyImplicitBlackoil()
~SimulatorFullyImplicitBlackoil() override
{
// Safe to call on all ranks, not just the I/O rank.
convergence_output_.endThread();

View File

@@ -90,7 +90,7 @@ namespace Opm {
* \brief Allocate memory for the scalar fields we would like to
* write to the VTK file.
*/
void allocBuffers()
void allocBuffers() override
{
if (eclTracerConcentrationOutput_()){
const auto& tracerModel = this->simulator_.problem().tracerModel();
@@ -111,7 +111,7 @@ namespace Opm {
* \brief Modify the internal buffers according to the intensive quantities relevant for
* an element
*/
void processElement(const ElementContext& elemCtx)
void processElement(const ElementContext& elemCtx) override
{
if (!Parameters::Get<Parameters::EnableVtkOutput>()) {
return;
@@ -141,7 +141,7 @@ namespace Opm {
/*!
* \brief Add all buffers to the VTK output writer.
*/
void commitBuffers(BaseOutputWriter& baseWriter)
void commitBuffers(BaseOutputWriter& baseWriter) override
{
VtkMultiWriter *vtkWriter = dynamic_cast<VtkMultiWriter*>(&baseWriter);
if (!vtkWriter)

View File

@@ -74,7 +74,7 @@ struct Reorderer
struct NoReorderer : public Reorderer
{
virtual std::size_t operator[](std::size_t i) const
std::size_t operator[](std::size_t i) const override
{
return i;
}
@@ -85,10 +85,12 @@ struct RealReorderer : public Reorderer
explicit RealReorderer(const std::vector<std::size_t>& ordering)
: ordering_(&ordering)
{}
virtual std::size_t operator[](std::size_t i) const
std::size_t operator[](std::size_t i) const override
{
return (*ordering_)[i];
}
const std::vector<std::size_t>* ordering_;
};

View File

@@ -113,6 +113,7 @@ struct PreconditionerMaker : public GeneralPreconditionerMaker<OriginalPrecondit
: args_(args...)
{
}
std::unique_ptr<GenericPreconditioner>
make() override
{
@@ -143,22 +144,22 @@ public:
using X = typename OriginalPreconditioner::domain_type;
using Y = typename OriginalPreconditioner::range_type;
virtual void pre(X& x, Y& b) override
void pre(X& x, Y& b) override
{
orig_precond_->pre(x, b);
}
virtual void apply(X& v, const Y& d) override
void apply(X& v, const Y& d) override
{
orig_precond_->apply(v, d);
}
virtual void post(X& x) override
void post(X& x) override
{
orig_precond_->post(x);
}
virtual SolverCategory::Category category() const override
SolverCategory::Category category() const override
{
return orig_precond_->category();
}
@@ -169,7 +170,8 @@ public:
orig_precond_ = preconditioner_maker_->make();
}
virtual bool hasPerfectUpdate() const override {
bool hasPerfectUpdate() const override
{
return true;
}

View File

@@ -128,7 +128,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::setInitial(const Vector&, const Vector&)
*/
void setInitial(const Vector& curSol, const Vector&)
void setInitial(const Vector& curSol, const Vector&) override
{
lastSol_ = curSol;
delta_ = 1000 * tolerance_;
@@ -139,7 +139,7 @@ public:
*/
void update(const Vector& curSol,
const Vector&,
const Vector&)
const Vector&) override
{
assert(curSol.size() == lastSol_.size());
@@ -158,7 +158,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::converged()
*/
bool converged() const
bool converged() const override
{ return accuracy() < tolerance(); }
/*!

View File

@@ -129,7 +129,7 @@ public:
unsigned int deviceID);
/// Destroy a openclSolver, and free memory
~amgclSolverBackend();
~amgclSolverBackend() override;
/// Solve linear system, A*x = b, matrix A must be in blocked-CSR format
/// \param[in] matrix matrix A

View File

@@ -74,7 +74,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::setInitial(const Vector& , const Vector& )
*/
void setInitial(const Vector&, const Vector& curResid)
void setInitial(const Vector&, const Vector& curResid) override
{
static constexpr Scalar eps = std::numeric_limits<Scalar>::min()*1e10;
@@ -90,7 +90,7 @@ public:
*/
void update(const Vector&,
const Vector&,
const Vector& curResid)
const Vector& curResid) override
{
lastDefect_ = curDefect_;
curDefect_ = scalarProduct_.norm(curResid);
@@ -99,19 +99,19 @@ public:
/*!
* \copydoc ConvergenceCriterion::converged()
*/
bool converged() const
bool converged() const override
{ return accuracy() <= tolerance(); }
/*!
* \copydoc ConvergenceCriterion::accuracy()
*/
Scalar accuracy() const
Scalar accuracy() const override
{ return curDefect_/initialDefect_; }
/*!
* \copydoc ConvergenceCriterion::printInitial()
*/
void printInitial(std::ostream& os=std::cout) const
void printInitial(std::ostream& os = std::cout) const override
{
os << std::setw(20) << "iteration ";
os << std::setw(20) << "residual ";
@@ -123,7 +123,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::print()
*/
void print(Scalar iter, std::ostream& os=std::cout) const
void print(Scalar iter, std::ostream& os = std::cout) const override
{
static constexpr Scalar eps = std::numeric_limits<Scalar>::min()*1e10;

View File

@@ -166,7 +166,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::setInitial(const Vector& , const Vector& )
*/
void setInitial(const Vector& curSol, const Vector& curResid)
void setInitial(const Vector& curSol, const Vector& curResid) override
{
lastResidualError_ = 1e100;
@@ -186,7 +186,7 @@ public:
*/
void update(const Vector& curSol,
const Vector&,
const Vector& curResid)
const Vector& curResid) override
{
lastResidualError_ = residualError_;
updateErrors_(curSol, curResid);
@@ -195,7 +195,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::converged()
*/
bool converged() const
bool converged() const override
{
// we're converged if the solution is better than the tolerance
// fix-point and residual tolerance.
@@ -207,7 +207,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::failed()
*/
bool failed() const
bool failed() const override
{
return
(!converged() && fixPointError_ <= fixPointTolerance_)
@@ -219,13 +219,13 @@ public:
*
* For the accuracy we only take the residual into account,
*/
Scalar accuracy() const
Scalar accuracy() const override
{ return residualError_; }
/*!
* \copydoc ConvergenceCriterion::printInitial()
*/
void printInitial(std::ostream& os = std::cout) const
void printInitial(std::ostream& os = std::cout) const override
{
os << std::setw(20) << " Iter ";
os << std::setw(20) << " Delta ";
@@ -238,7 +238,7 @@ public:
/*!
* \copydoc ConvergenceCriterion::print()
*/
void print(Scalar iter, std::ostream& os = std::cout) const
void print(Scalar iter, std::ostream& os = std::cout) const override
{
static constexpr Scalar eps = std::numeric_limits<Scalar>::min()*1e10;

View File

@@ -55,22 +55,22 @@ namespace Opm
AdaptiveSimulatorTimer& operator++ ();
/// \brief advance time by currentStepLength
void advance() { this->operator++ (); }
void advance() override { this->operator++ (); }
/// \brief provide and estimate for new time step size
void provideTimeStepEstimate( const double dt_estimate );
/// \brief Whether this is the first step
bool initialStep () const;
bool initialStep () const override;
/// \brief \copydoc SimulationTimer::currentStepNum
int currentStepNum () const;
int currentStepNum () const override;
/// \brief return current report step
int reportStepNum() const;
int reportStepNum() const override;
/// \brief \copydoc SimulationTimer::currentStepLength
double currentStepLength () const;
double currentStepLength () const override;
// \brief Set next step length
void setCurrentStepLength(double dt);
@@ -79,10 +79,10 @@ namespace Opm
double totalTime() const;
/// \brief \copydoc SimulationTimer::simulationTimeElapsed
double simulationTimeElapsed() const;
double simulationTimeElapsed() const override;
/// \brief \copydoc SimulationTimer::done
bool done () const;
bool done () const override;
/// \brief return average step length used so far
double averageStepLength() const;
@@ -95,22 +95,22 @@ namespace Opm
/// \brief Previous step length. This is the length of the step that
/// was taken to arrive at this time.
double stepLengthTaken () const;
double stepLengthTaken () const override;
/// \brief report start and end time as well as used steps so far
void report(std::ostream& os) const;
/// \brief start date time of simulation
boost::posix_time::ptime startDateTime() const;
boost::posix_time::ptime startDateTime() const override;
/// \brief Return true if last time step failed
bool lastStepFailed() const {return last_step_failed_;}
bool lastStepFailed() const override { return last_step_failed_; }
/// \brief tell the timestepper whether timestep failed or not
void setLastStepFailed(bool last_step_failed) {last_step_failed_ = last_step_failed;}
void setLastStepFailed(bool last_step_failed) { last_step_failed_ = last_step_failed; }
/// return copy of object
virtual std::unique_ptr< SimulatorTimerInterface > clone() const;
std::unique_ptr<SimulatorTimerInterface> clone() const override;
protected:
std::shared_ptr<boost::posix_time::ptime> start_date_time_;

View File

@@ -59,7 +59,10 @@ namespace Opm
static SimpleIterationCountTimeStepControl serializationTestObject();
/// \brief \copydoc TimeStepControlInterface::computeTimeStepSize
double computeTimeStepSize( const double dt, const int iterations, const RelativeChangeInterface& /* relativeChange */, const double /*simulationTimeElapsed */ ) const;
double computeTimeStepSize(const double dt,
const int iterations,
const RelativeChangeInterface& /* relativeChange */,
const double /*simulationTimeElapsed */ ) const override;
template<class Serializer>
void serializeOp(Serializer& serializer)
@@ -107,7 +110,10 @@ namespace Opm
static PIDTimeStepControl serializationTestObject();
/// \brief \copydoc TimeStepControlInterface::computeTimeStepSize
double computeTimeStepSize( const double dt, const int /* iterations */, const RelativeChangeInterface& relativeChange, const double /*simulationTimeElapsed */ ) const;
double computeTimeStepSize(const double dt,
const int /* iterations */,
const RelativeChangeInterface& relativeChange,
const double /*simulationTimeElapsed */ ) const override;
template<class Serializer>
void serializeOp(Serializer& serializer)
@@ -153,7 +159,10 @@ namespace Opm
static PIDAndIterationCountTimeStepControl serializationTestObject();
/// \brief \copydoc TimeStepControlInterface::computeTimeStepSize
double computeTimeStepSize( const double dt, const int iterations, const RelativeChangeInterface& relativeChange, const double /*simulationTimeElapsed */ ) const;
double computeTimeStepSize(const double dt,
const int iterations,
const RelativeChangeInterface& relativeChange,
const double /*simulationTimeElapsed */ ) const override;
template<class Serializer>
void serializeOp(Serializer& serializer)
@@ -196,7 +205,10 @@ namespace Opm
static HardcodedTimeStepControl serializationTestObject();
/// \brief \copydoc TimeStepControlInterface::computeTimeStepSize
double computeTimeStepSize( const double dt, const int /* iterations */, const RelativeChangeInterface& /*relativeChange */, const double simulationTimeElapsed) const;
double computeTimeStepSize(const double dt,
const int /* iterations */,
const RelativeChangeInterface& /*relativeChange */,
const double simulationTimeElapsed) const override;
template<class Serializer>
void serializeOp(Serializer& serializer)

View File

@@ -49,7 +49,7 @@ public:
++ numInstantiated_;
}
void run()
void run() override
{
assert(0 <= runner->workerThreadIndex() && runner->workerThreadIndex() < runner->numWorkerThreads());
std::this_thread::sleep_for(std::chrono::milliseconds(mseconds_));