-
Notifications
You must be signed in to change notification settings - Fork 178
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
base: development
Are you sure you want to change the base?
Fixing bug with the ES solver and MR: E_aux[lev] = E_fp[lev] in the UpdateAuxilaryData #4922
Conversation
…lgorithms with PML BC
for more information, see https://pre-commit.ci
…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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found three small issues, detailed below, that were causing the failure of two CI tests. I will push a commit to fix those and see if this is enough to make all CI tests pass successfully.
Update: bug fixes pushed in e5f0de6.
Source/Parallelization/WarpXComm.cpp
Outdated
if (do_pml && pml[lev]->ok()) | ||
{ | ||
WARPX_ABORT_WITH_MESSAGE("Averaged Galilean PSATD with PML is not yet implemented"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double checking, are this and the following similar changes (I counted four of them) related to this PR? The PR is a bug fix for the electrostatic solver with mesh refinement, while these changes are removing abort statements related to averaged Galilean PSATD with PMLs. Were they maybe left over from a different branch and/or should they be implemented in a dedicated PR?
amrex::IntVect(0), | ||
amrex::IntVect(1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that resetting the first argument (corresponding to src_nghost
in the definition of ParallelCopy
) to amrex::IntVect(1)
, as it was before, fixes the "erroneous arithmetic operation" error that was occurring in the tests ElectrostaticSphereLabFrame_MR_emass_10
and ElectrostaticSphereEB_RZ_MR
.
What was the reason for deciding to change the code here and pass 0 ghost cells for the source MultiFab, as opposed to 1 ghost cell for the destination MultiFab?
amrex::IntVect(0), | |
amrex::IntVect(1), | |
amrex::IntVect(1), | |
amrex::IntVect(1), |
I'm investigating the failure of the scraping CI tests (which appears as "erroneous arithmetic operation") and what I can report so far is that it probably due to uninitialized values in the MultiFabs It's not clear to me yet why we are leaving some of those values untouched, hence uninitialized, with the code changes here. Regardless of this, we might want to think whether we would like to initialize those MultiFabs to 0.0 as we do for the corresponding MultiFabs on level 0. Merged the code changes in #5049 to verify that they are sufficient to fix the issue. Will rebase once more after #5049 is merged. |
5c7f7dc
to
9407bf9
Compare
@oshapoval @RemiLehe |
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: