-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing bug with the ES solver and MR: E_aux[lev] = E_fp[lev] in the UpdateAuxilaryData #4922
Open
oshapoval
wants to merge
27
commits into
ECP-WarpX:development
Choose a base branch
from
oshapoval:mr_fix_auxilary_update_es_solver
base: development
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fixing bug with the ES solver and MR: E_aux[lev] = E_fp[lev] in the UpdateAuxilaryData #4922
oshapoval
wants to merge
27
commits into
ECP-WarpX:development
from
oshapoval:mr_fix_auxilary_update_es_solver
Conversation
This file contains 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
…lgorithms with PML BC
for more information, see https://pre-commit.ci
ax3l
added
bug
Something isn't working
component: electrostatic
electrostatic solver
bug: affects latest release
Bug also exists in latest release version
component: mesh refinement
(A)MR
labels
May 12, 2024
…y_update_es_solver
for more information, see https://pre-commit.ci
…y_update_es_solver
…/oshapoval/WarpX into mr_fix_auxilary_update_es_solver
for more information, see https://pre-commit.ci
…lysis script with smaller MR patch.
…y_update_es_solver
…/oshapoval/WarpX into mr_fix_auxilary_update_es_solver
for more information, see https://pre-commit.ci
…/oshapoval/WarpX into mr_fix_auxilary_update_es_solver
for j in np.arange(0,nj,1): | ||
if (matrix[i][j] != 0) and (matrix[i][j] != np.nan): | ||
return (i, j) | ||
stop |
Check notice
Code scanning / CodeQL
Statement has no effect Note
This statement has no effect.
for j in np.arange(nj-1, -1, -1): | ||
if (matrix[i][j] != 0) and (matrix[i][j] != np.nan): | ||
return (i, j) | ||
stop |
Check notice
Code scanning / CodeQL
Statement has no effect Note
This statement has no effect.
for j in np.arange(0,nj,1): | ||
if (matrix[i][j] != 0) and (matrix[i][j] != np.nan): | ||
return (i, j) | ||
stop |
Check warning
Code scanning / CodeQL
Unreachable code Warning
This statement is unreachable.
for j in np.arange(nj-1, -1, -1): | ||
if (matrix[i][j] != 0) and (matrix[i][j] != np.nan): | ||
return (i, j) | ||
stop |
Check warning
Code scanning / CodeQL
Unreachable code Warning
This statement is unreachable.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug: affects latest release
Bug also exists in latest release version
bug
Something isn't working
component: electrostatic
electrostatic solver
component: mesh refinement
(A)MR
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 fixes a bug with the ES solver and MR. This issues was initially observed by @aeriforme. Worked on the issue with @RemiLehe.
Problem: observed doubling of the E field for
lev>0
.Solution: when ES solver is used we have
E_cp[levl] =0
and we should update the auxiliary data asE_aux[lev] = E_fp[lev]
(insideWarpX::UpdateAuxilaryDataStagToNodal()
andWarpX::UpdateAuxilaryDataSameType()
rather thanE_aux[lev] = E_fp[lev] - E_cp[lev] + E_aux[lev-1]
in contrast to the EM solver. Otherwise it would result in doubling of E field we observed.To do:
WarpX::UpdateAuxilaryDataStagToNodal ()
amr.max_level = 1
(reused CI testelectrostatic_sphere_eb_mr
)Results after the fix:
Figure(1): with MR patch occupying the whole simulation box:
Figure(2): with MR patch smaller than the simulation box: