Skip to content

Closes #313. Return success flag from GSI solver - #314

Open
mgoodson-cvd wants to merge 3 commits into
masterfrom
313-return-success-flag-from-gsi-solver
Open

Closes #313. Return success flag from GSI solver#314
mgoodson-cvd wants to merge 3 commits into
masterfrom
313-return-success-flag-from-gsi-solver

Conversation

@mgoodson-cvd

Copy link
Copy Markdown
Collaborator
  • Adds a unit test for the Newton solver class
  • Modifies the Newton solver class to return success or failure based on convergence instead of returning a redundant reference to the input
  • Modifies the solveSurfaceBalance routines of the GSI solvers to return success or failure based on convergence

Add a unit test for the Newton solver class.
Uses Rosenbrock function.

See #313
Update the return flag from the NewtonSolver's `solve` function
to return a success/failure flag based on convergence,
rather than returning a reference to `x`, which is redundant
because `x` was already passed in by non-const reference.

See #313.
Return a boolean indicating success/failure from the GSI
`solveSurfaceBalance` routine. Previously was void.

See #313.
@mgoodson-cvd
mgoodson-cvd requested a review from capriatim July 9, 2026 16:42
@mgoodson-cvd mgoodson-cvd linked an issue Jul 9, 2026 that may be closed by this pull request
@capriatim

Copy link
Copy Markdown
Collaborator

I tested it. It works fine.

It is a minor change. The version should be updated to 1.3.0

I would add a function to get the convergence status to be included into the fortran wrapper without breaking backward compatibility.

@mgoodson-cvd

Copy link
Copy Markdown
Collaborator Author

@capriatim glad it works for you.

I didn't bump the version number because this doesn't technically break compatibility. It used to be void.

I see two potential ways to add this to the Fortran wrapper. The success flag isn't stored anywhere; it is returned from the solveSurfaceBalance() function call. The correct way to do this would be to make solveSurfaceBalance a function rather than a subroutine in the Fortran interface, but that would break backward compatibility. Alternately, I think I could add a success variable as an optional argument; not quite sure how that works with the implicit interfaces M++ currently uses for Fortran and maintaining backward compability. I can try it though.

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.

Return success flag from GSI solver

2 participants