-
Notifications
You must be signed in to change notification settings - Fork 85
missing overlap for face data #293
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
base: develop
Are you sure you want to change the base?
Conversation
9b5516a
to
6a414c9
Compare
I need to evaluate this some more and see if this breaks any of our tests. Your analysis of what happens on the nodes highlighted in the last figure looks correct to me. I thought there was something implemented years ago to address just this type of thing in a different way, but I can't find it in the code right now. A workaround that is probably unsatisfactory would be to subsequently execute a RefineSchedule from the new level to itself with no coarser level, and with that any nodes that are colocated between one patch's interior and another patch's ghosts would be overwritten with the interior value and become consistent. But that adds a new communication step just to clean up some error that the previous schedule created. |
Thanks for this answer. For the moment we indeed do the workaround with the single level schedule indeed. |
Adding a single level Schedule on the new level is currently what we do and that indeed helps. |
We are likely to accept a version of this change, but please be patient as we verify that it will not cause a problem for other users. To answer a question about why this is there, I believe it stems from the original SAMRAI design assuming that regridding would only move data to the interiors of the new level's patches, and then ghosts would be filled using a full boundary-filling RefineSchedule. As you have demonstrated, this doesn't have to be the case. |
This PR removes a condition that when is met wrongly prevents the calculation of an overlap.
In RefineSchedule, the code loops over level source box which box may overlap the fill box, creating a
test_mask
to pass to the usercalculateOverlap()
method.If the destination fill box and the transformed source box do not overlap, test mask is empty, but data could live on border in which case the code tries to grow by one cell the destination fill box to see if border data may overlap the source.
However, in the current code, this growth is only happening if:
1- the ghost width is 0
OR
2- the fill box is the same as the destination box.
I guess that if using a default
PatchLevelFillPattern
the fill box is the destination ghost box (at least that's what we see) and so in these case conditions 1 and 2 are the same.We have ghost width of 2 cells, the condition is therefore not met.
This happens to be a problem in some (rare?) cases. In regridding, we see sometimes the destination ghost box border aligned with one of the old level box border and for face data the overlap is not calculated.
See the following situation
On the left are old level patches (11,12,13,14,15) in red. On the right some new level patches 16 and 18.
patch 16 has its ghost box (ghost width = 2) represented on both panels.
As you can see, most of 16's ghost box overlaps old level patches, except from some part at its bottom.
The right face of the ghost box aligns with the right face of old patches 13 and 14, and on the right face of patch 15.
Where it intersects 13 and 14, the right border of 16 is well copied from 13 and 14 face values, respectively.
However, when it intersects only the right face of 15, the overlap is not calculated.
The reason is that for 13 and 14 overlaps, the first
test_mask
is not empty, since a lot of 16 overlaps 13 and 14.However, when intersecting 16 and 15, the test mask is empty. And while data lives on border, the destination fill box is not grown since we have a non-zero ghost cell width and our ghost destination fill box is not equal to the destination box.
Below is a zoom-in view on the nodes of interest :
test mask thus remains empty and calculateOverlap() is not called.
As a result, these nodes remain in unfilled boxes, and will get their values from refinement.
However, on the new level neighbor patch 18, these nodes will be copied from old patch 15, resulting in shared border nodes having different values on new level patches 16 and 18.
Removing the inner condition as proposed in this PR allows the growth of the destination box, making a non empty source mask and calling calculateOverlap.