SystemSolver: use Preconditioner::Side enum for preconditioning side - #470
Open
stark256-spec wants to merge 1 commit into
Open
SystemSolver: use Preconditioner::Side enum for preconditioning side#470stark256-spec wants to merge 1 commit into
stark256-spec wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #439.
Summary
SystemSolver::preconditionerSetup()accepted astd::stringand manually mapped"left"/"right"toPreconditioner::Side. Left preconditioning was introduced in #417, and the other solvers already select the side through thePreconditioner::Sideenum.SystemSolverwas the last place still doing string-based selection, so this brings it in line.Changes
preconditionerSetup()now takesPreconditioner::Sidedirectly; the internal"left"/"right"string parsing (and the associated error branch) is removed.examples/sysGmres.cppandtests/functionality/testSysGmres.cpp, where the-poption is already validated byprocessInputs.Testing
Configured and built the
cpupreset (-DCMAKE_BUILD_TYPE=Release); library,sysGmresexample, andsys_rand_gmres_testall compile cleanly.sys_rand_gmres_test.exe(default, right preconditioning): PASSEDsys_rand_gmres_test.exe -p right: PASSED-p sideways: falls back to the default (right) as before, PASSEDBehavior is unchanged: the same
Preconditioner::Sidevalue is passed as before — only where the string is interpreted has moved. (-p leftdoes not converge for the randomized FGMRES test problem, but that reproduces identically onmainand is unrelated to this change.)