add wellIterationsLast_.

This commit is contained in:
Liu Ming 2016-07-20 10:44:12 +08:00
parent 52d51e8565
commit 3f4aa65180
2 changed files with 13 additions and 2 deletions

View File

@ -117,6 +117,9 @@ namespace Opm {
/// Number of linear solver iterations used in the last call to step().
int linearIterationsLastStep() const;
/// Number of well iterations used in all calls to step().
int wellIterationsLastStep() const;
/// Reference to physical model.
const PhysicalModel& model() const;
@ -157,6 +160,7 @@ namespace Opm {
int wellIterations_;
int nonlinearIterationsLast_;
int linearIterationsLast_;
int wellIterationsLast_;
};
} // namespace Opm

View File

@ -36,7 +36,8 @@ namespace Opm
linearIterations_(0),
wellIterations_(0),
nonlinearIterationsLast_(0),
linearIterationsLast_(0)
linearIterationsLast_(0),
wellIterationsLast_(0)
{
if (!model_) {
OPM_THROW(std::logic_error, "Must provide a non-null model argument for NonlinearSolver.");
@ -85,6 +86,11 @@ namespace Opm
return linearIterationsLast_;
}
template <class PhysicalModel>
int NonlinearSolver<PhysicalModel>::wellIterationsLastStep() const
{
return wellIterationsLast_;
}
template <class PhysicalModel>
int
@ -143,9 +149,10 @@ namespace Opm
linearIterations_ += linIters;
nonlinearIterations_ += iteration - 1; // Since the last one will always be trivial.
wellIterations_ = wellIters;
wellIterations_ += wellIters;
linearIterationsLast_ = linIters;
nonlinearIterationsLast_ = iteration;
wellIterationsLast_ = wellIters;
// Do model-specific post-step actions.
model_->afterStep(dt, reservoir_state, well_state);