Skip to content

Fix TreeMesh average_cell_to_face for cells spanning the whole mesh - #421

Merged
jcapriot merged 1 commit into
simpeg:mainfrom
jcapriot:fix_tree_boundary_face_averaging
Oct 1, 2026
Merged

jcapriot merged 1 commit into
simpeg:mainfrom
jcapriot:fix_tree_boundary_face_averaging

Conversation

@jcapriot

Copy link
Copy Markdown
Member

In average_cell_to_face_x, _y and _z, the branch for a cell with no neighbor on the high side ends with continue, so for a cell with no neighbor on either side (one that spans the whole mesh in that direction) the low-side boundary face was never filled. Those rows of the operator were empty, so the low-side boundary faces of such cells got no value.

This fixes it by handling the low-side boundary face first, so the high-side branch can no longer skip it.

@jcapriot
jcapriot requested a review from santisoler September 29, 2026 20:19
@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.86%. Comparing base (2ba3b92) to head (4caf405).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   86.84%   86.86%   +0.02%     
==========================================
  Files          93       93              
  Lines       19208    19239      +31     
  Branches     2152     2154       +2     
==========================================
+ Hits        16681    16712      +31     
  Misses       1840     1840              
  Partials      687      687              

☔ View full report in Codecov by Harness.
📢 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.

In average_cell_to_face_x, _y and _z, the branch for a cell with no neighbor
on the high side ends with `continue`, so for a cell with no neighbor on
either side (one that spans the whole mesh in that direction) the low-side
boundary face was never filled. Those rows of the operator were empty, so
the low-side boundary faces of such cells got no value.

Handle the low-side boundary face first, so the high-side branch can no
longer skip it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jcapriot
jcapriot force-pushed the fix_tree_boundary_face_averaging branch from fb0efe2 to 4caf405 Compare September 30, 2026 14:52

@santisoler santisoler left a comment

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.

Nice catch!!

@jcapriot
jcapriot merged commit f6e7d8a into simpeg:main Oct 1, 2026
30 checks passed
@jcapriot
jcapriot deleted the fix_tree_boundary_face_averaging branch October 1, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants