Skip to content

Fix reuse of NOX::Nln::Adapter by resetting state#2003

Merged
maxiludwig merged 1 commit into4C-multiphysics:mainfrom
maxiludwig:fix-nln-adapter-transient-reuse
Apr 29, 2026
Merged

Fix reuse of NOX::Nln::Adapter by resetting state#2003
maxiludwig merged 1 commit into4C-multiphysics:mainfrom
maxiludwig:fix-nln-adapter-transient-reuse

Conversation

@maxiludwig
Copy link
Copy Markdown
Contributor

Description and Context

  • Fix NOX::Nln::Adapter transient reuse by resetting solver state with the current initial guess before each solve() call (nox_solver_->reset(*x_nox_)).
  • Previously, consecutive timesteps could be reported as already converged because the solver carried over convergence state from the prior timestep.
  • Add regression test SolverNonlinNoxAdapter.RepeatedSolveReinitializesState to verify two consecutive solve() calls on the same adapter re-run and converge to updated targets.

Related Issues and Pull Requests

#1807

@maxiludwig maxiludwig requested a review from Copilot April 28, 2026 12:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect reuse behavior in NOX::Nln::Adapter where consecutive solve() calls could incorrectly report convergence due to retained solver state, by resetting the NOX solver with the current initial guess before each solve.

Changes:

  • Reset NOX solver state at the start of NOX::Nln::Adapter::solve() via nox_solver_->reset(*x_nox_).
  • Add a regression test to ensure repeated solve() calls on the same adapter re-run iterations and converge to updated targets.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/solver_nonlin_nox/4C_solver_nonlin_nox_adapter.cpp Resets solver state before each solve() to prevent stale convergence status across reuses.
src/solver_nonlin_nox/tests/4C_solver_nonlin_nox_adapter_test.cpp Adds regression coverage for repeated solves updating the target and reinitializing solver state.

@maxiludwig maxiludwig merged commit d043447 into 4C-multiphysics:main Apr 29, 2026
84 of 87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants