mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
distinguish between the number of non linear iterations and the number of linearizations
while the printed number of "Non linear iterations" was correct in a strict sense, it was very confusing if one was working on the linearization code because the last Newton iteration of each time step was linearized but not solved for (and the solution was thus not updated hence it does not count as a "non linear iteration"). This makes sense for large problems were the total runtime is completely dominated by the performance of the linear solver, but smaller problems exhibit the opposite behavior (i.e., for them, runtime is typically dominated by the linearization proceedure), so one is more interested in the number of linearizations, not the number of linear solves.
This commit is contained in:
@@ -32,6 +32,7 @@ namespace Opm
|
||||
std::unique_ptr<PhysicalModel> model_arg)
|
||||
: param_(param),
|
||||
model_(std::move(model_arg)),
|
||||
linearizations_(0),
|
||||
nonlinearIterations_(0),
|
||||
linearIterations_(0),
|
||||
wellIterations_(0),
|
||||
@@ -44,6 +45,12 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
template <class PhysicalModel>
|
||||
int NonlinearSolver<PhysicalModel>::linearizations() const
|
||||
{
|
||||
return linearizations_;
|
||||
}
|
||||
|
||||
template <class PhysicalModel>
|
||||
int NonlinearSolver<PhysicalModel>::nonlinearIterations() const
|
||||
{
|
||||
@@ -149,6 +156,7 @@ namespace Opm
|
||||
|
||||
linearIterations_ += linIters;
|
||||
nonlinearIterations_ += iteration - 1; // Since the last one will always be trivial.
|
||||
linearizations_ += iteration;
|
||||
wellIterations_ += wellIters;
|
||||
linearIterationsLast_ = linIters;
|
||||
nonlinearIterationsLast_ = iteration;
|
||||
|
||||
Reference in New Issue
Block a user