-
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
Minor refactoring of refined injection for AddPlasmaFlux #5274
Minor refactoring of refined injection for AddPlasmaFlux #5274
Conversation
const auto index = overlap_box.index(iv); | ||
|
||
Real scale_fac = compute_scale_fac_area(dx, num_ppc_real, flux_normal_axis); | ||
|
||
auto lo = getCellCoords(overlap_corner, dx, {0._rt, 0._rt, 0._rt}, iv); | ||
auto hi = getCellCoords(overlap_corner, dx, {1._rt, 1._rt, 1._rt}, iv); | ||
|
||
if (flux_pos->overlapsWith(lo, hi)) |
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.
This if
condition is not key here, since the pcounts[index]
is 0
anyway for cells that do not overlap.
auto lo = getCellCoords(overlap_corner, dx, {0._rt, 0._rt, 0._rt}, iv); | ||
auto hi = getCellCoords(overlap_corner, dx, {1._rt, 1._rt, 1._rt}, iv); | ||
|
||
if (flux_pos->overlapsWith(lo, hi)) | ||
{ | ||
auto index = overlap_box.index(iv); | ||
int r; | ||
int r = 1; | ||
if (fine_overlap_box.ok() && fine_overlap_box.contains(iv)) { | ||
r = compute_area_weights(lrrfac, flux_normal_axis); |
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.
There is another small clean up that can be done. The lrrfac
is not necessary since rrfac
is already locally declared within the routine. Similarly for AddPlasma
.
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.
Sounds good, thanks. I added this in my latest commit.
In
AddPlasmaFlux
, the code associated with the refined injection can be simplified a bit in a few places.