-
Notifications
You must be signed in to change notification settings - Fork 199
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
WarpX class: move shiftMF to anonymous namespace in WarpXMovingWindow.cpp #5609
WarpX class: move shiftMF to anonymous namespace in WarpXMovingWindow.cpp #5609
Conversation
…_to_anonymous_namespace
const int nc = mf.nComp(); | ||
const amrex::IntVect& ng = mf.nGrowVect(); | ||
|
||
AMREX_ALWAYS_ASSERT(ng[dir] >= std::abs(num_shift)); |
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.
Previously, this was AMREX_ALWAYS_ASSERT(ng[dir] >= num_shift);
however, it seems to me that, since num_shift
can be negative, we need an absolute value here. What do you think @ax3l ?
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.
Wait, we can shift backwards (or just know it is technically possible because num_shift
is an int
)? :D
Either way, LGTM ;)
} else { | ||
amrex::IntVect ng_mw = amrex::IntVect::TheUnitVector(); | ||
// Enough guard cells in the MW direction | ||
ng_mw[dir] = std::abs(num_shift); |
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.
Same as above. This was ng_mw[dir] = num_shift;
, but I think that the absolute value is necessary here.
This PR moves the static function
shiftMF
from the WarpX class to an anonymous namespace inWarpXMovingWindow.cpp
, where it is actually used.This is done to simplify the Warpx class.