pmgbergen / porepy

Python Simulation Tool for Fractured and Deformable Porous Media
GNU General Public License v3.0
246 stars 88 forks source link

Placement of the iteration counter in the Newton solver #1219

Open mariusnevland opened 2 weeks ago

mariusnevland commented 2 weeks ago

At the moment, when performing Newton iterations, the iteration counter is updated after the convergence check. This leads to the final iteration not being counted, as you exit the Newton loop before the counter is updated.

Is there a specific reason for the iteration counter being after the convergence check? If not, I would suggest to have the counter before the check.

mariusnevland commented 2 weeks ago

On second thought, I suppose the iteration_counter variable is now redundant, since this is now handled by SolverStatistics (which updates the iteration counter before the convergence check). Hence, we should probably remove iteration_counter and replace its usage everywhere by the num_iteration attribute of SolverStatistics.

Yuriyzabegaev commented 2 weeks ago

1200 may be related.