Use complex-aware preconditioner in BoundaryMode solver - #921
Merged
Merged
Conversation
simlapointe
force-pushed
the
simlapointe/waveport-precond
branch
from
September 2, 2026 23:05
c228197 to
2e86ec6
Compare
simlapointe
marked this pull request as ready for review
September 3, 2026 00:15
This was referenced Sep 3, 2026
Open
hughcars
approved these changes
Sep 15, 2026
Comment on lines
+536
to
+539
| // the FE space communicator. Wave-port sparse-direct solvers run on a subcommunicator, | ||
| // so assemble the complex-aware preconditioner on all ranks before non-port ranks | ||
| // return. The resulting real operator is already in the form expected by the wrapped | ||
| // sparse solver, avoiding another collective assembly in MfemWrapperSolver. |
Collaborator
There was a problem hiding this comment.
Suggested change
| // the FE space communicator. Wave-port sparse-direct solvers run on a subcommunicator, | |
| // so assemble the complex-aware preconditioner on all ranks before non-port ranks | |
| // return. The resulting real operator is already in the form expected by the wrapped | |
| // sparse solver, avoiding another collective assembly in MfemWrapperSolver. | |
| // the FE space communicator. Wave-port sparse-direct solvers run on a subcommunicator, | |
| // so assemble the complex-aware preconditioner on all ranks before non-port ranks | |
| // return. direct_pc_op only carries the assembled real matrix (2N x 2N in the | |
| // doubled-real case) into MfemWrapperSolver::SetOperator; its Mult is not meaningful. |
| port_linear.tol = data.ksp_tol; | ||
| if (data.complex_coarse_solve) | ||
| { | ||
| port_linear.complex_coarse_solve = *data.complex_coarse_solve; |
Collaborator
There was a problem hiding this comment.
With global "PCMatReal": true, port_linear.pc_mat_real is inherited and the !linear.pc_mat_real guard in ModeEigenSolver::Solve skips this entirely, so an explicit per-port "ComplexCoarseSolve": true is silently ignored. Give the explicit override precedence:
Suggested change
| port_linear.complex_coarse_solve = *data.complex_coarse_solve; | |
| port_linear.complex_coarse_solve = *data.complex_coarse_solve; | |
| port_linear.pc_mat_real = false; |
Note this also means an explicit per-port false gives Ar + Ai rather than Ar. I think that is the right reading of a per-port choice, but if you would rather preserve PCMatReal for that case, only clear it when the override is true.
| 1-based index of the most recently completed adaptive mesh refinement (AMR) iteration | ||
| (`1` for the initial solve, matching the `iterationXX` archive subdirectory). | ||
| [PR 902](https://github.com/awslabs/palace/pull/902) | ||
| - Improve BoundaryMode linear solver convergence when lossy boundary conditions are present |
Collaborator
There was a problem hiding this comment.
The MaxIts/KSPTol fix is a separate bug, give it its own bullet. This will also need to move to In progress when you rebase.
simlapointe
force-pushed
the
simlapointe/waveport-precond
branch
from
September 15, 2026 21:19
f1e1a66 to
b389303
Compare
simlapointe
enabled auto-merge
September 15, 2026 21:24
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.
Improve BoundaryMode linear solver convergence when lossy boundary conditions are present by including complex terms in the real-valued preconditioner ($P = A_r + A_i$ , like in the 3D case) or using an exact complex-valued preconditioner when
"WavePorts.ComplexCoarseSolve"is true. Closes #920.