-
Notifications
You must be signed in to change notification settings - Fork 201
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
Do Not Fill Guard Cells with Inverse FFTs, Unless for Field Damping #2045
Conversation
3a14f40
to
a9799c5
Compare
0b014e8
to
2719831
Compare
@RemiLehe I suggest to have a look here before I update the benchmarks, because the failing tests on Azure will print out the relative errors of each failing benchmark. This will help us get an idea of which tests fail and how much they fail. So I will commit the update of the benchmarks after all CI checks have finished, following the last commit I just pushed (b85faab). |
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.
Following our discussions and looking at the code, the current solutions looks good to me.
I'll let @RemiLehe take the final look.
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.
That looks good to me, thanks!
If we wanted to be more general, we could consider having a fill_guards_lo
and a fill_guards_hi
but I don't know if there are situations where that would be useful. (e.g., if there's a scenario where field_boundary_lo[dir]
is Damped
and field_boundary_hi[dir]
isn't)
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.
Looks good, thanks!
Fixes #2035.
Description
I added a new static member to the WarpX class, the IntVect
fill_guards
. It is anAMREX_SPACEDIM
-dimensional vector of integers (0 or 1 should be the only allowed values), to control whether to fill the guard cells when performing inverse FFTs, independently along each direction. Whenfill_guards = 0
in some direction, the full box used for the loop in the inverse FFT is shrinked by the number of guard cells in that direction.WarpX::fill_guards
is currently set to0
in each direction, unless the direction is non-periodic and field damping is applied (e.g. with a moving window).