Skip to content

SystemSolver: use Preconditioner::Side enum for preconditioning side - #470

Open
stark256-spec wants to merge 1 commit into
ORNL:developfrom
stark256-spec:feat/systemsolver-precond-side-enum
Open

SystemSolver: use Preconditioner::Side enum for preconditioning side#470
stark256-spec wants to merge 1 commit into
ORNL:developfrom
stark256-spec:feat/systemsolver-precond-side-enum

Conversation

@stark256-spec

Copy link
Copy Markdown

Closes #439.

Summary

SystemSolver::preconditionerSetup() accepted a std::string and manually mapped "left"/"right" to Preconditioner::Side. Left preconditioning was introduced in #417, and the other solvers already select the side through the Preconditioner::Side enum. SystemSolver was the last place still doing string-based selection, so this brings it in line.

Changes

  • preconditionerSetup() now takes Preconditioner::Side directly; the internal "left"/"right" string parsing (and the associated error branch) is removed.
  • The string-to-enum conversion now happens once at the CLI boundary in examples/sysGmres.cpp and tests/functionality/testSysGmres.cpp, where the -p option is already validated by processInputs.

Testing

Configured and built the cpu preset (-DCMAKE_BUILD_TYPE=Release); library, sysGmres example, and sys_rand_gmres_test all compile cleanly.

  • sys_rand_gmres_test.exe (default, right preconditioning): PASSED
  • sys_rand_gmres_test.exe -p right: PASSED
  • unrecognized -p sideways: falls back to the default (right) as before, PASSED

Behavior is unchanged: the same Preconditioner::Side value is passed as before — only where the string is interpreted has moved. (-p left does not converge for the randomized FGMRES test problem, but that reproduces identically on main and is unrelated to this change.)

SystemSolver::preconditionerSetup() took a std::string and manually
mapped "left"/"right" to Preconditioner::Side. Left preconditioning
was added in ORNL#417 and the other solvers already select the side via the
enum, so this brought SystemSolver in line with them.

Change preconditionerSetup() to accept Preconditioner::Side directly and
drop the internal string parsing. The string-to-enum conversion now
happens once at the CLI boundary in the sysGmres example and the
functionality test, where the option is already validated.

Closes ORNL#439
@stark256-spec
stark256-spec changed the base branch from main to develop August 12, 2026 04:16
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.

SystemSolver still uses string to select preconditioning side

1 participant