Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placement of the iteration counter in the Newton solver #1219

Open
mariusnevland opened this issue Aug 30, 2024 · 3 comments · May be fixed by #1232
Open

Placement of the iteration counter in the Newton solver #1219

mariusnevland opened this issue Aug 30, 2024 · 3 comments · May be fixed by #1232
Assignees
Labels
user group Issue to be worked on in the internal user group.

Comments

@mariusnevland
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Contributor

#1200 may be related.

@jwboth jwboth added the user group Issue to be worked on in the internal user group. label Sep 11, 2024
@jwboth
Copy link
Contributor

jwboth commented Sep 26, 2024

Tasks: Consider essentially the second comment by @mariusnevland. NewtonSolver should not keep track of iteration counts anymore. Instead, the nonlinear solution statistics object should be consulted. Thus, the task is to clean up the NewtonSolver.

Please also have a look at how the iteration counter is forwarded to after_nonlinear_convergence. My intuitive thought is that the explicit forwarding can be removed and again replaced by explicit reference to the nonlinear_solution_strategy .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user group Issue to be worked on in the internal user group.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants