Repository navigation
Conversation
In tw_part_mesh::subdivide_leaf the split along the chosen axis is the median vertex coordinate, nudged upward off any vertex lying on it. When more than half of a block's vertices share the largest coordinate along that axis (eg. the flange plane of the junction ring mesh), the nudge moves the split past every vertex, one child gets all of them, and the same split repeats until "Maximum recursion" aborts. The split is now checked to leave vertices on both sides. If it does not, it is placed halfway between the median value and the nearest distinct value below it (or above it), and if all vertices lie on one plane normal to the axis the next axis (by spread) is tried. Splits that already separated the vertices are unchanged, so existing partitions are identical. A block of coincident vertices is left as a leaf with a warning instead of recursing. Adds a regression test building HODLR on the junction ring with target_size 30 and 60 (previously aborted for target_size <= 60). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NKQvs8bWWKcfS7nRhwabX5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Primary changes
Fixes
tw_part_mesh→subdivide_leaf(src/physics/thin_wall_hodlr.F90) recursing until it aborts with "Maximum recursion".Cause: the split along the chosen axis is the median vertex coordinate, nudged upward by
1e-4*(bounds width)if any vertex lies on it. Child 1 takesx >= splitand child 2 takesx < split. When more than half of a block's vertices share the largest coordinate along that axis, the nudge moves the split past every vertex. One child then gets all of the vertices, and the same split repeats forever. Example: the flange planez = 0of the junctionring()mesh, which aborted fortarget_size <= 60.Fix:
The split is still a single plane strictly between two vertex values inside the parent's region. So the leaf cells from the unmerged HODLR leaf-adjacency work (
claude/thincurr-adjacent-leaves-1lc3dw) will still tile the root box. When the two branches are combined, the cells should be split atsplit(in place oflocs(j)). I checked this on that branch:test_hodlr_leavespasses, and its tiling and adjacency checks also pass on the junction ring at target sizes 10, 30 and 60.Test: the new
test_hodlr_small_leaves[30, 60]insrc/tests/physics/test_ThinCurr_junctions.pybuilds HODLR on the junction ring. It compares the HODLR L to the dense L on random vectors, with a 1e-5 relative threshold. HODLR differs from the dense L by about 3e-6 on this mesh for every target size, including a single block. Both cases abort with "Maximum recursion" without the fix and pass with it.Verified locally (Ubuntu 24.04 system libraries, OpenMPI + OpenMP): all 140 tests in
test_ThinCurr.pyandtest_ThinCurr_junctions.pypass. The Fortran stack lint passes.Secondary changes
None.
API changes
None. No changes to Python/Fortran APIs or input files.
Generated by Claude Code