Aero recipe: filter degenerate cells with consistent measures - #1973
Draft
peterdsharpe wants to merge 14 commits into
Draft
peterdsharpe wants to merge 14 commits into
peterdsharpe wants to merge 14 commits into
Conversation
MeshToDomainMesh in cell_centroids mode turns each source cell into an interior query point and discards the cells. Any integral over those points (forces, area-weighted losses or metrics) then has no measure to weight by, and after SubsampleMesh the retained cells' measure weights are lost as well. Record cell_measures(mesh) (area times composed measure weights) on the interior under the reserved point_data key TARGET_QUADRATURE_MEASURE_KEY, aligned one-for-one with the centroids. Reject the key as a user target or as a pre-existing input field so it cannot be silently shadowed. Also validate the shape of the reserved per-cell measure-weights field and of tensor factors passed to compose_measure_weights: TensorDict only checks the leading dimension, so a (n_cells, 1) tensor was storable but broadcast wrongly against cell_areas.
…ransforms Two small recipe-local mesh transforms, used by the surface dataset configs (DrivAerML, HiLiftAeroML, SHIFT-SUV): - ComputeFreestreamDirection writes the unit freestream direction to a new global_data leaf (U_inf_dir); U_inf itself stays physical. - DropDegenerateCells drops cells whose area is zero or non-finite, which can happen to sliver cells after float32 centering/rotation and would otherwise yield all-zero surface normals. Registered via src/datasets.py like the other recipe-local components; unit tests in tests/test_domain_transforms.py.
Collaborator
Author
|
/ok to test db19fab |
Contributor
CODEOWNERS review mapCurrent for commit ⏳ @coreyjadams — 8 file(s)
⏳ @peterdsharpe — 8 file(s)
No CODEOWNER
Comment |
…dit-fix-1973-sept9 Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>
Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>
Collaborator
Author
|
/ok to test 414f03b |
Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>
Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>
Collaborator
Author
|
/ok to test 0a7d751 |
Collaborator
Author
|
/ok to test 1285236 |
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.
Stacked on #1970: main → #1970 → #1973. The current #1970 head (
e2ff58109108d67da4bb26eb8bb35a47b6cb045e) is merged into this branch. Merge #1970 first; this PR uses its unified cell/point measure API and centroid measure transfer. It does not depend on #1971. Review the changes above #1970.Keep valid surface faces and their positive quadrature measures aligned through filtering and centroid conversion. Previously, a thin triangle could pass a geometric cross-product check while the Gram-based area calculation returned zero, leaving its centroid with an unusable measure for weighted losses.
DropDegenerateCellstransform to the DrivAerML, HiLift, and SHIFT-SUV surface pipelines beforeMeshToDomainMesh. It recomputes areas from the current coordinates using the same routine asMesh.cell_areas, rejects zero/non-finite areas, slices cell fields and complete sampling-corrected measures together, and retains vertices. It ignores cached areas; an entirely rejected mesh has empty connectivity and cell fields.Validation: 267 geometry, normals, measure, centroid-conversion, augmentation, and compilation tests passed, including CPU/CUDA, reduced-precision autocast, and gradients. The recipe suite passed 207 tests, including all 15 filtering/pipeline regressions; its one remaining pre-existing failure is
test_sdf_normals_near_wall_use_face_normal, addressed separately in #2011. All pre-commit hooks passed. Downstream on the ISLA branch, an actual ISLA forward pass and weighted training loss/backpropagation pass on CPU and CUDA with retained thin faces and sampling-corrected measures.