Fix bug in conditional advection for TripolarGrids#5564
Fix bug in conditional advection for TripolarGrids#5564simone-silvestri wants to merge 7 commits into
TripolarGrids#5564Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5564 +/- ##
==========================================
+ Coverage 65.58% 73.19% +7.60%
==========================================
Files 403 403
Lines 22612 23932 +1320
==========================================
+ Hits 14831 17516 +2685
+ Misses 7781 6416 -1365
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
briochemc
left a comment
There was a problem hiding this comment.
I must admit I find these confusing. One thing I thought is could we use better names for the alias where the intent is clear? AFAIU, RC, which sounds like it stands for "RightConnected and friends" really is used here to collect topologies that have a given center/face sizes (grid.N for both) as opposed to LeftConnected which as an extra face (grid.N + 1). Could we apply the same logic as for FaceExtendedTopology and use a name that describes what characteristic of the grid/topology we are dispatching on?
I haven't checked the actual checks/indices/offsets yet. I'll try to do that at some point but I have other pressing things to do first so don't wait for me on that particular part! (Also if the language and the logic are simplified that will help me review that!)
| LeftConnectedRightCenterFolded, LeftConnectedRightFaceFolded, | ||
| LeftConnectedRightCenterConnected, LeftConnectedRightFaceConnected} | ||
| # `RC` topologies are bounded on the left (low index) and open on the right | ||
| const RC = Union{RightConnected, RightFaceFolded, RightCenterFolded} |
There was a problem hiding this comment.
What about the distributed cohort? Should they be added here?
There was a problem hiding this comment.
The distributed topologies are connected on each side (both left and right) so they always use the full stencil for advection computation (they behave as a Periodic topology)
| @inline $outside_biased_haloᶠ(i, ::Type{<:RC}, N, adv) = (i >= $required_halo_size(adv) + 1) & # Left bias | ||
| (i >= $required_halo_size(adv)) # Right bias | ||
| @inline $outside_biased_haloᶜ(i, ::Type{<:RC}, N, adv) = (i >= $required_halo_size(adv)) & # Left bias | ||
| (i >= $required_halo_size(adv) - 1) # Right bias |
There was a problem hiding this comment.
I see there were already a few like this existing before but I don't understand why not collapse the things like
(i >= $required_halo_size(adv)) & (i >= $required_halo_size(adv) - 1)to just
(i >= $required_halo_size(adv))?
There was a problem hiding this comment.
good catch, I will do some cleanup here
No, in this case it is really "Connected on the Right". This is because we only need to check the left side and not the right, it does not have to do with the number of points it has, also the comment points it out. |
Oh OK, got it (I think). But then, why not use |
What about LB? For left bounded |
The new topologies were treated inconsistently with regards to inactive nodes and conditional advection.
This PR fixes it.