-
Notifications
You must be signed in to change notification settings - Fork 189
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
Set guard cells in corners with mixed boundary conditions #3842
base: development
Are you sure you want to change the base?
Set guard cells in corners with mixed boundary conditions #3842
Conversation
There are amrex functions for filling ghost cells at the corner of periodic/non-periodic boundaries. https://github.com/AMReX-Codes/amrex/blob/68aa69a11750b3f6ac36ec13b26249f0be80d527/Src/Base/AMReX_FabArray.H#LL1098C35-L1098C43 Not sure if that could be an easier fix than the changes in this PR. There is also a known issue with PEC boundaried. #3900. Fixing that by passing the correct number of ghost cells to SumGuargCells should also fix the corners. (Admittedly, I have not read the changes in this PR in detail.) |
@WeiqunZhang The fix for #3900 may be the same as is done here. |
In the evolve loop, whenever fields are updated, the WarpX specific boundary conditions are applied first (e.g. PEC) and then the periodic (in a call to the appropriate
FillBoundary
routine). However, theFillBoundary
routines will only fill guard cells using valid cells. For mixed BCs then, the guard cells in the corners don't get set to the periodic repeat of the side guard cells along the periodic direction. So, since WarpX applies its BCs first, the changes that are made in the side guard cells are not copied to the corners along the periodic direction, leaving them either zero or with incorrect values.The fix is to call the PEC boundary routines after the
FillBoundary
routines, moving them out of theEvolveE
andEvolveB
routines and making direct calls to them.Fix #3900
Tasks:
ApplyEfieldBoundary
for FDTDApplyBfieldBoundary
for FDTD