Skip to content

Fix tripolar reductions#5099

Open
simone-silvestri wants to merge 40 commits intomainfrom
ss/correct-tripolar-red
Open

Fix tripolar reductions#5099
simone-silvestri wants to merge 40 commits intomainfrom
ss/correct-tripolar-red

Conversation

@simone-silvestri
Copy link
Copy Markdown
Collaborator

@simone-silvestri simone-silvestri commented Jan 5, 2026

This PR fixes reductions on a tripolar grid to make sure that the extra repeated half-line is excluded from the reduction.

This should also solve the problem with the tripolar conservation test.

closes #4488 #4487

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

I think the whitespace check might be allucinating here (or I might be allucinating). I cannot find the whitespaces that it points to!

@glwagner glwagner changed the title Correct tripolar reductions Fix tripolar reductions Jan 19, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 34.78261% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.84%. Comparing base (0911da6) to head (38f0213).

Files with missing lines Patch % Lines
...nalSphericalShellGrids/tripolar_grid_reductions.jl 32.07% 36 Missing ⚠️
src/ImmersedBoundaries/immersed_reductions.jl 38.46% 24 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5099      +/-   ##
==========================================
- Coverage   73.97%   73.84%   -0.14%     
==========================================
  Files         400      401       +1     
  Lines       22870    22938      +68     
==========================================
+ Hits        16918    16938      +20     
- Misses       5952     6000      +48     
Flag Coverage Δ
buildkite 68.71% <36.36%> (-0.12%) ⬇️
julia 68.71% <36.36%> (-0.12%) ⬇️
reactant_unit 3.76% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +34 to +35
valid_domain = !((i > Nx÷2) & (j == Ny))
return ifelse(ℓy == Face, true, valid_domain)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
valid_domain = !((i > Nx÷2) & (j == Ny))
return ifelse(ℓy == Face, true, valid_domain)
prognostic_cell = !((i > Nx÷2) & (j == Ny))
return ifelse(ℓy == Face, true, prognostic_cell)

this condition has to be matched by something in the zipper boundary condition halo fill. Should we try to encode this information just one place? (not sure how to do that, but it seems fragile the way this is written)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the zipper boundary condition we do substitute the repeated row such that we do not allow precision errors to accumulate (on centers). So in practice this last half row should be identically equal to the other one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right I understand that. I am just commenting on the fact that this critical information --- "the last half row is identically equal to the other one" --- is encapsulated in two places: 1) filling halos and 2) here, in the definition of the prognostic cells. ideally, we only have one place where information is stored and they are not disconnected from one another, far away in different files. but it may not be possible.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be possible if we are not dealing with half-rows (we just change interior for example), but with a half-row it might be very difficult because we lose the matrix representation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we merge this?

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

This is ready to merge @glwagner

@simone-silvestri
Copy link
Copy Markdown
Collaborator Author

Adapted to the new changes merged in #5408. This should be ready to go @briochemc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test velocity exchanges across the tripolar seam more thoroughly

4 participants