[WIP] Set Eold solver vec to zero on nonzero dirichlet boundaries. - #7207
Open
JustinRayAngus wants to merge 5 commits into
Open
[WIP] Set Eold solver vec to zero on nonzero dirichlet boundaries.#7207JustinRayAngus wants to merge 5 commits into
JustinRayAngus wants to merge 5 commits into
Conversation
JustinRayAngus
force-pushed
the
nonzero_dirichlet_curlcurlpc
branch
from
September 1, 2026 15:50
e4058ab to
8867d22
Compare
Contributor
Author
|
Note: I also found that I needed to zero-out |
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.
This PR works around an issue in the ThetaImplicitEM solver when the curl-curl preconditioner is used with nonzero Dirichlet boundary conditions for the electric field. On the development branch, GMRES diverges with this setup.
The solver converges as expected when the components of
m_Eoldthat are nodal in the boundary normal direction are set to zero on the nonzero Dirichlet boundaries before being passed to the nonlinear solver.Recall that the nonlinear solver solves
F(U) = U - b - R(U) = 0, whereb = m_Eoldis a constant.I describe this as a workaround because it addresses the observed divergence, but may not
resolve its underlying cause.
TODO
CodeX has the following to say:
The more general root fix is for the nonlinear-solver interface to expose and apply a constrained-DOF projection. Then Eold can retain its physical nonzero boundary values, while the residual and correction space explicitly excludes those boundary degrees of freedom.
From what I understand, we should make the nonlinear solvers ignore degrees of freedom on any Dirichlet boundaries. This is effectively done without modification for zero-value Dirichlet, but not for nonzero-value Dirichlet.
@debog On a related note, PETSc's SNES nonlinear solver currently only works in WarpX when using periodic boundary conditions.