Skip to content

Mesh: Add differentiable exact RBF mesh morphing#1830

Open
mehdiataei wants to merge 3 commits into
NVIDIA:mainfrom
mehdiataei:mehdiataei/rbf-morph
Open

Mesh: Add differentiable exact RBF mesh morphing#1830
mehdiataei wants to merge 3 commits into
NVIDIA:mainfrom
mehdiataei:mehdiataei/rbf-morph

Conversation

@mehdiataei

Copy link
Copy Markdown
Collaborator

PhysicsNeMo Pull Request

Description

This PR adds dimensionally generic thin-plate-spline radial basis function (RBF) morphing for points and meshes.

The new APIs include:

  • rbf_morph_points for batched or unbatched tensor inputs.
  • Mesh.rbf_morph for individual meshes.
  • DomainMesh.rbf_morph for applying one fitted field across all domain components.

PyTorch performs the differentiable coefficient solve. Field evaluation supports both PyTorch and a fused NVIDIA Warp backend, with automatic device-based dispatch. The implementation supports an optional affine polynomial tail, smoothing, and per-point weights. With zero smoothing, the fitted field interpolates control displacements before optional point weights are applied.

The PyTorch implementation supports first- and second-order gradients. The Warp evaluator supports first-order gradients through query points, control locations, control displacements, and floating-point weights. Input validation reports invalid layouts and singular control systems with actionable errors.

Documentation includes reproducible 2D and 3D examples and visualizations.

Validation completed:

  • 475 tests passed with 22 expected skips.
  • PyTorch gradcheck and gradgradcheck passed.
  • PyTorch/Warp forward and backward parity tests passed.
  • Dynamic and compiled execution tests passed.
  • All pre-commit hooks passed.
  • The documentation build completed successfully.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.
  • The CHANGELOG.md is up to date with these changes.
  • An issue is linked to this pull request.
  • If I am implementing a new model or modifying any existing model, I have followed the Models Implementation Coding Standards. (Not applicable; no model code was changed.)

Dependencies

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

Signed-off-by: Mehdi Ataei <ataei8@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 10, 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.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds exact RBF morphing for tensors and meshes. The main changes are:

  • New rbf_morph_points functional with Torch fitting and Torch/Warp evaluation.
  • New Mesh.rbf_morph and DomainMesh.rbf_morph APIs.
  • Shared DomainMesh deformation helper for combined component evaluation.
  • Warp kernels and custom-op bindings for RBF field evaluation.
  • Documentation, examples, benchmarks, and broad RBF test coverage.

Important Files Changed

Filename Overview
physicsnemo/nn/functional/geometry/deform/rbf.py Adds the public RBF morph functional, validation, backend dispatch, and benchmark cases.
physicsnemo/nn/functional/geometry/deform/_rbf_torch_impl.py Adds Torch-side TPS coefficient fitting and chunked field evaluation.
physicsnemo/nn/functional/geometry/deform/_warp_impl/rbf_op.py Adds Warp custom-op integration and autograd registration for RBF field evaluation.
physicsnemo/nn/functional/geometry/deform/_warp_impl/rbf_kernels.py Adds Warp kernels for TPS forward evaluation and first-order pullbacks.
physicsnemo/mesh/domain_mesh.py Adds DomainMesh RBF morphing and factors shared component deformation logic.
physicsnemo/mesh/transformations/deform/rbf.py Adds the Mesh-level RBF morph wrapper around the tensor functional.
physicsnemo/mesh/transformations/deform/_utils.py Adds shared DomainMesh point-weight and component validation helpers.
test/nn/functional/geometry/test_rbf_morph.py Adds tensor-level RBF tests for interpolation, validation, gradients, Warp parity, and compile paths.
test/mesh/transformations/test_mesh_rbf_morph.py Adds Mesh and DomainMesh integration tests for RBF morphing.

Reviews (1): Last reviewed commit: "Add exact RBF mesh morphing" | Re-trigger Greptile

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