Skip to content

Unified external aero recipe: rescale_geometry=true restores physical scale and position - #2344

Open
peterdsharpe wants to merge 6 commits into
NVIDIA:mainfrom
peterdsharpe:pr/recipe-infer-rescale-center
Open

peterdsharpe wants to merge 6 commits into
NVIDIA:mainfrom
peterdsharpe:pr/recipe-infer-rescale-center

Conversation

@peterdsharpe

@peterdsharpe peterdsharpe commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

The recipe's infer.py writes predictions onto each case's mesh. With rescale_geometry=true, it multiplies coordinates by L_ref but leaves them centered at the origin. CenterMesh subtracts each case's center, and on main no dataset config stores it. So the saved geometry does not sit where the case's original mesh does.

A synthetic case offset from the origin, run through each dataset config's own transforms and saved with rescale_geometry=true:

Dataset config Largest vehicle point error, main This PR
drivaer_ml_surface 1.5 m 2.4e-7 m
drivaer_ml_volume 2.25 m 2.4e-7 m
highlift_surface 1.5 m 2.4e-7 m
shift_suv_estate_surface 1.5 m 2.4e-7 m
shift_suv_fastback_surface 1.5 m 2.4e-7 m
  • These five configs run CenterMesh before NonDimensionalizeByMetadata. Each now sets store_center_as: center, so the center is stored in physical coordinates.
  • attach_and_save scales by L_ref as before, then translates by global_data.center when it is present. This inverts the pipeline's x* = (x - center) / L_ref.
  • A dataset config that does not store the center keeps main's behaviour: its saved geometry stays centered at the origin.
  • The force and moment integration runs before the save, so moment_center stays in the centered frame. The conf/infer.yaml comment says so.

The new global_data.center leaf reaches every model trained on these datasets. Apart from ISLA, they read only named leaves such as global_data.U_inf, or no global_data at all. ISLA takes global_data whole and selects the leaves it declares. With a center leaf added to the synthetic surface and volume samples, collate and one forward pass succeed for all 21 configurations in test_synthetic_configs.py. DoMINO, not in that suite, reads only global_data.U_inf.

Testing: a new test in tests/test_infer.py, parametrized over the five configs, builds the table's case and checks the saved points. It fails on main for all five and passes here. A second new test checks that the saved points equal x * L_ref + center. test_merge_global_data.py now expects the center leaf on the domain of both the plain and the ISLA surface sample. The recipe's tests/ pass on CPU.

Checklist

Dependencies

Review Process

All PRs are reviewed by the PhysicsNeMo team before merging.

Depending on which files are changed, GitHub may automatically assign a maintainer for review.

We are also testing AI-based code review tools (e.g., Greptile), which may add automated comments with a confidence score.
This score reflects the AI’s assessment of merge readiness and is not a qualitative judgment of your work, nor is
it an indication that the PR will be accepted / rejected.

AI-generated feedback should be reviewed critically for usefulness.
You are not required to respond to every AI comment, but they are intended to help both authors and reviewers.
Please react to Greptile comments with 👍 or 👎 to provide feedback on their accuracy.

…erMesh translation

drivaer_ml_surface.yaml stores each case's CenterMesh center as
global_data.center, and attach_and_save adds it back after the L_ref
scaling, so saved geometry sits at its original position.

Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Dec 1, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS review map

Current for commit a86387e1e309. An approval covers every file listed for that owner; one owner is sufficient for shared files.

⏳ @coreyjadams — 6 file(s)
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/README.md
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/conf/infer.yaml
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/datasets/drivaer_ml_surface.yaml
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/src/infer.py
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_infer.py
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_merge_global_data.py
⏳ @peterdsharpe — 6 file(s)
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/README.md
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/conf/infer.yaml
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/datasets/drivaer_ml_surface.yaml
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/src/infer.py
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_infer.py
  • examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_merge_global_data.py

No CODEOWNER

  • CHANGELOG.md

Comment /codeowners-info to refresh.

…nterMesh dataset's position

The DrivAerML volume, HiLift surface and both SHIFT-SUV surface configs
now store their CenterMesh center too, so attach_and_save restores their
position as it does DrivAerML surface's. The YAML-introspection test is
replaced by a behaviour test over the five configs: each one's own
transforms on an off-origin case, then a save that must land back on the
input points.

Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>
@peterdsharpe peterdsharpe changed the title Unified external aero recipe: rescale_geometry=true restores DrivAerML surface positions Unified external aero recipe: rescale_geometry=true restores physical scale and position Dec 1, 2026
@peterdsharpe
peterdsharpe marked this pull request as ready for review December 2, 2026 21:47
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

[Medium impact] This PR appears safe to merge.

RetriggerView in Greptile

Summary

Restores saved geometry to its original scale and position when rescale_geometry=true.

  • Inference saves rescaled meshes at their original physical position when the center is stored.

No actionable issues found. Tests were inspected but not run.

Reviews (1) · Last reviewed commit: "Unified external aero recipe: rescale_ge..." · Reviewed by Greptile

…cale-center

Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>

# Conflicts:
#	CHANGELOG.md
…cale-center

Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>

# Conflicts:
#	CHANGELOG.md
@melo-gonzo
melo-gonzo self-requested a review December 3, 2026 19:34
…cale-center

Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>

# Conflicts:
#	CHANGELOG.md
#	examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_infer.py
…cale-center

Signed-off-by: Peter Sharpe <peterdsharpe@gmail.com>

# Conflicts:
#	examples/cfd/external_aerodynamics/unified_external_aero_recipe/tests/test_infer.py
@peterdsharpe

Copy link
Copy Markdown
Collaborator Author

/ok to test eccb1bc

This branch has not been deployed

No deployments
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.

1 participant