Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
e3ce39e
fixes default label
peterdsharpe Jan 7, 2026
537deb0
Adds text and lumpy sphere
peterdsharpe Jan 7, 2026
8ec7121
import ordering
peterdsharpe Jan 8, 2026
de2c5f1
Fixes lumpy sphere
peterdsharpe Jan 8, 2026
f99567d
INITIAL WIP changes to Mesh.
peterdsharpe Jan 14, 2026
258d1a5
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Jan 16, 2026
097563c
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Jan 20, 2026
db896cd
Refactor text module and enhance documentation
peterdsharpe Jan 22, 2026
a47e93b
Add icosahedral sphere surface implementation
peterdsharpe Jan 22, 2026
ed6fe82
Refactor calculus tests to use procedural mesh generation
peterdsharpe Jan 22, 2026
d56fc03
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Jan 27, 2026
70b929a
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Jan 28, 2026
9883c91
path fixes
peterdsharpe Jan 28, 2026
0d1e2ef
tol fixes
peterdsharpe Jan 28, 2026
3e277a5
matches error message
peterdsharpe Jan 28, 2026
4d7da4e
matches error message + path fix
peterdsharpe Jan 28, 2026
b0e809d
Standardizes to use interesting meshes
peterdsharpe Jan 28, 2026
0a86a38
Switch to lumpy sphere
peterdsharpe Jan 28, 2026
4bc6c56
removes old importorskip
peterdsharpe Jan 28, 2026
8db6ff2
verified fixes
peterdsharpe Jan 28, 2026
8f72b77
more asserts
peterdsharpe Jan 28, 2026
9d91ef9
removes old duplicates
peterdsharpe Jan 28, 2026
d7eeacc
deduplicate
peterdsharpe Jan 28, 2026
1f8d5c9
deduplicate
peterdsharpe Jan 28, 2026
ccbd50b
deduplicates
peterdsharpe Jan 28, 2026
0f1c17d
test improvements
peterdsharpe Jan 28, 2026
20c45c1
Adds lumpy ball primitive for test suite
peterdsharpe Jan 28, 2026
1cedb9f
vectorizes
peterdsharpe Jan 28, 2026
75aed63
fixed subdivision algorithms
peterdsharpe Jan 28, 2026
f1bb886
set nontrivial amplitude as default
peterdsharpe Jan 28, 2026
8f34f8d
Migrate tests to lumpy ball
peterdsharpe Jan 28, 2026
1696870
Enhance lumpy ball mesh generation by ensuring consistent tetrahedron…
peterdsharpe Jan 28, 2026
d4186a4
Add comprehensive tests for lumpy ball boundary extraction, including…
peterdsharpe Jan 28, 2026
fab24a6
fix marks
peterdsharpe Jan 28, 2026
cda6abe
DEC Laplacian working!
peterdsharpe Jan 28, 2026
1f584c9
Combines disjoint test files
peterdsharpe Jan 28, 2026
6ad72e6
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Jan 29, 2026
8c59360
formatting
peterdsharpe Jan 29, 2026
1575268
remove unused imports
peterdsharpe Jan 29, 2026
2d97294
pre-commit fixes
peterdsharpe Jan 29, 2026
6776231
markdownlints
peterdsharpe Jan 29, 2026
f91f3ac
remove ugly exception
peterdsharpe Jan 29, 2026
c5ffd9d
Guards import properly
peterdsharpe Jan 29, 2026
13d9508
makes imports compliant
peterdsharpe Jan 29, 2026
289023c
fixes a broken path
peterdsharpe Jan 30, 2026
6f86ec5
Adds license headers
peterdsharpe Jan 30, 2026
f43da08
adds requirements.txt
peterdsharpe Feb 2, 2026
b66b34e
doctest fixes
peterdsharpe Feb 2, 2026
bc7d9f0
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Feb 2, 2026
7faacce
Add tests for watertight mesh face deletion
peterdsharpe Feb 3, 2026
5790474
Fixes a bug with codimension != 0 manifolds
peterdsharpe Feb 3, 2026
7c74596
Standardizes some kwargs
peterdsharpe Feb 3, 2026
574bec9
updates tests for fixed sampling logic
peterdsharpe Feb 3, 2026
3ff9ad6
Exposes some interfaces
peterdsharpe Feb 3, 2026
317a022
cleaner cache usage
peterdsharpe Feb 3, 2026
422e494
pre-commit
peterdsharpe Feb 3, 2026
85221ad
adds first-pass on examples
peterdsharpe Feb 3, 2026
d011359
adds fixes
peterdsharpe Feb 3, 2026
fa05b75
fixes a flux weighting bug
peterdsharpe Feb 3, 2026
d9d5bdb
Adds more sensible iteration upper-bound
peterdsharpe Feb 4, 2026
e72991c
standardize nomenclature
peterdsharpe Feb 4, 2026
c16d417
Sensible upper-bound limits.
peterdsharpe Feb 4, 2026
a774882
import fixes
peterdsharpe Feb 4, 2026
946e4ea
improve vectorization
peterdsharpe Feb 4, 2026
74c9117
deduplicate functionality
peterdsharpe Feb 4, 2026
233b247
deduplicates edge lookups
peterdsharpe Feb 4, 2026
9c353b5
performance improvements
peterdsharpe Feb 4, 2026
175a86e
docs
peterdsharpe Feb 4, 2026
1c1dfc6
sync tests with API changes
peterdsharpe Feb 4, 2026
d6c8e9c
Adds _edge_lookup abstraction
peterdsharpe Feb 4, 2026
bd0432b
cleanup from pr review
peterdsharpe Feb 4, 2026
9cd94db
Implement efficient duplicate vertex detection using spatial hashing …
peterdsharpe Feb 4, 2026
8b0a099
fixes naming conventions
peterdsharpe Feb 4, 2026
45d420d
API fixes
peterdsharpe Feb 4, 2026
d17909c
Adds counts property
peterdsharpe Feb 4, 2026
a5bd518
adds higher-order tensor flattening
peterdsharpe Feb 4, 2026
f776da7
finish demo 1
peterdsharpe Feb 4, 2026
6499818
Enhance draw_mesh_matplotlib function by adding scalar_label paramete…
peterdsharpe Feb 4, 2026
f6b3eb6
Adds ability to use string axes
peterdsharpe Feb 4, 2026
c07c91c
adds updates to 1
peterdsharpe Feb 4, 2026
92ccde9
Adds test for boundary extraction
peterdsharpe Feb 4, 2026
24e23e7
Adds fixes + tests for cube_volume
peterdsharpe Feb 4, 2026
7ac6aa7
Adds operations
peterdsharpe Feb 4, 2026
c0b5166
Enhances tutorial 3 by adding execution counts and outputs for gradie…
peterdsharpe Feb 4, 2026
8f3e542
final notebooks
peterdsharpe Feb 4, 2026
8de90fd
Adds notes on mesh quality and repair
peterdsharpe Feb 4, 2026
378edf2
comments cleanup
peterdsharpe Feb 5, 2026
794123a
NumPy-style docstrings
peterdsharpe Feb 5, 2026
362cef6
deduplicate
peterdsharpe Feb 5, 2026
835b72e
merge API
peterdsharpe Feb 5, 2026
afbdd63
adds utilities for duplicate detection and tols
peterdsharpe Feb 5, 2026
d6d911a
migrate edge extraction to natural home
peterdsharpe Feb 5, 2026
172c21c
Adds sharp/flat fix
peterdsharpe Feb 5, 2026
8caf478
API link
peterdsharpe Feb 5, 2026
5b49621
dead code
peterdsharpe Feb 5, 2026
b94df8a
numpy docstrings
peterdsharpe Feb 5, 2026
cb35e48
deduplicate
peterdsharpe Feb 5, 2026
d93ff76
consolidate sampling
peterdsharpe Feb 5, 2026
0569964
major simplifications
peterdsharpe Feb 5, 2026
4ce81cb
fixes for multiple holes
peterdsharpe Feb 5, 2026
23dd3d5
deduplicate
peterdsharpe Feb 5, 2026
cd6d83e
sync tests
peterdsharpe Feb 5, 2026
76155ba
docs
peterdsharpe Feb 5, 2026
a15bb99
fixes for repo rules
peterdsharpe Feb 5, 2026
465a154
types fixes
peterdsharpe Feb 5, 2026
5bcfd4d
Adds test fixes
peterdsharpe Feb 5, 2026
0555473
Part A fixes
peterdsharpe Feb 5, 2026
68ff3bb
Part C fixes: deduplication
peterdsharpe Feb 5, 2026
c75aa6e
Part A5: deduplication
peterdsharpe Feb 5, 2026
99c9089
Part D, 3/4: Performance improvements
peterdsharpe Feb 5, 2026
9481e02
Makes this CPU-side
peterdsharpe Feb 5, 2026
06888ef
bvh re-use
peterdsharpe Feb 6, 2026
ddbfbda
More consistent device preservation to eliminate torch.compile breaks
peterdsharpe Feb 6, 2026
f543b52
Rewrite of 3d vertex manifold check to be fully on the GPU
peterdsharpe Feb 6, 2026
e361171
Deduplication using FEM weights code
peterdsharpe Feb 6, 2026
ca5e13a
Branchless voronoi computations
peterdsharpe Feb 6, 2026
c340e76
Fixes for wing weights in newer butterfly scheme
peterdsharpe Feb 6, 2026
57f62d8
Docs in examples
peterdsharpe Feb 6, 2026
7f8a70e
Fixes a few outdated API uses
peterdsharpe Feb 6, 2026
a500058
Update test assertions for mesh repair and add skip condition for flo…
peterdsharpe Feb 6, 2026
a1a9833
Part C: Reorganization
peterdsharpe Feb 6, 2026
08b28b9
Part C: Missing __init__
peterdsharpe Feb 6, 2026
4bca64d
Part B: Deduplication
peterdsharpe Feb 6, 2026
86f65d9
fix for cell-based gaussian curvature
peterdsharpe Feb 6, 2026
3df6a3e
Part E: Numerical performance
peterdsharpe Feb 6, 2026
96b8932
Docs fix
peterdsharpe Feb 6, 2026
0df49ca
Part A1 and A3 fix.
peterdsharpe Feb 6, 2026
2a21d97
Deduplication pass
peterdsharpe Feb 6, 2026
4ab53f2
Vectorizes primitive generation
peterdsharpe Feb 6, 2026
f07f645
Test deduplication
peterdsharpe Feb 6, 2026
cee6ece
Deduplicates unique edge identification
peterdsharpe Feb 6, 2026
f514929
Consolidation of facet extraction tests
peterdsharpe Feb 6, 2026
7387e72
Further consolidation in test_facet_extraction.py
peterdsharpe Feb 6, 2026
e031e3b
vectorized
peterdsharpe Feb 6, 2026
9497bb1
Refactor spatial dimension operations: rename embed_in_spatial_dims t…
peterdsharpe Feb 6, 2026
6982f1d
Splits embedding and projection tests
peterdsharpe Feb 6, 2026
7b77bab
Unifies loops
peterdsharpe Feb 6, 2026
8a0ef4b
Refactor of BVH to use LBVH - goes from O(N) Python loops to O(log N).
peterdsharpe Feb 6, 2026
ae935bc
fixes test for first-order composition accuracy
peterdsharpe Feb 6, 2026
1e76784
Consolidates interior angle calculation
peterdsharpe Feb 6, 2026
79c924e
Refactors mesh data handling by enhancing key exclusion logic, optimi…
peterdsharpe Feb 6, 2026
31a317a
formatting
peterdsharpe Feb 6, 2026
b882e92
markdownlint noqa
peterdsharpe Feb 6, 2026
c4f1712
Ruff check fixes
peterdsharpe Feb 6, 2026
b07bfc2
formatting
peterdsharpe Feb 6, 2026
78db9cf
Adds pyvista import for type checking
peterdsharpe Feb 6, 2026
cf0609b
cleans up no-longer-needed type hint ignores
peterdsharpe Feb 6, 2026
9d68601
Adds perf notes
peterdsharpe Feb 6, 2026
f95fc1a
visualization fixes in 3D
peterdsharpe Feb 6, 2026
c08153f
Review pass
peterdsharpe Feb 6, 2026
f5f2ce2
__init__.py changes
peterdsharpe Feb 6, 2026
27e3296
formatting
peterdsharpe Feb 6, 2026
282c008
cleanup
peterdsharpe Feb 6, 2026
6a788cf
dtype fix
peterdsharpe Feb 6, 2026
3b1c797
formatting
peterdsharpe Feb 6, 2026
7a5ae00
test fixes
peterdsharpe Feb 6, 2026
d702c38
Deduplication
peterdsharpe Feb 6, 2026
fa407d7
fixes missing license header
peterdsharpe Feb 6, 2026
8fec6c9
tutorial progress
peterdsharpe Feb 6, 2026
fddceb4
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Feb 6, 2026
149ec61
Update license year
peterdsharpe Feb 6, 2026
92c7687
tutorial sync
peterdsharpe Feb 6, 2026
19bc475
notebook updates
peterdsharpe Feb 9, 2026
431f50f
addresses review comments
peterdsharpe Feb 9, 2026
86f4559
post-review updates
peterdsharpe Feb 9, 2026
77fd304
docs
peterdsharpe Feb 9, 2026
f6d21a9
Adds a fix for 3D matplotlib viz
peterdsharpe Feb 9, 2026
93b431b
support for 3D data viz
peterdsharpe Feb 9, 2026
00deaf9
makes 2D and 3D shading consistent
peterdsharpe Feb 9, 2026
902b7a9
Update gradient computation to allow zero minimum neighbors and clari…
peterdsharpe Feb 9, 2026
f88a3ab
Adds shading
peterdsharpe Feb 9, 2026
ba8b69b
Adds shading
peterdsharpe Feb 9, 2026
eb55f04
Adds a fix for curl on lsq reconstruction.
peterdsharpe Feb 9, 2026
9f4b0f0
viz improvements
peterdsharpe Feb 9, 2026
860fc7e
Fixes a null type
peterdsharpe Feb 9, 2026
085caea
Adds viz
peterdsharpe Feb 9, 2026
278ead7
adds viz
peterdsharpe Feb 9, 2026
70710c0
Adds mesh benchmarks
peterdsharpe Feb 10, 2026
0958f99
format
peterdsharpe Feb 10, 2026
b4f11a2
license headers
peterdsharpe Feb 10, 2026
0d52883
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Feb 10, 2026
a752813
modifies importlinter
peterdsharpe Feb 10, 2026
fff32a5
Merge branch 'main' into psharpe/add-physicsnemo-mesh
peterdsharpe Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .importlinter
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ root_package = physicsnemo
include_external_packages = True
contract_types =
forbidden_import: test.ci_tests.prevent_untracked_imports.ForbiddenImportContract
exclude_type_checking_imports = true

[importlinter:contract:physicsnemo-modules]
name = Prevent Upward Imports in the PhysicsNemo Structure
Expand Down
167 changes: 167 additions & 0 deletions examples/minimal/mesh/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# PhysicsNeMo-Mesh Tutorials

This directory contains a series of progressive tutorials introducing
**PhysicsNeMo-Mesh** - NVIDIA's GPU-accelerated mesh processing library for
physics-AI applications.

## What is PhysicsNeMo-Mesh?

PhysicsNeMo-Mesh is a PyTorch-based library for working with simplicial meshes
(point clouds, curves, surfaces, volumes) in a unified, dimensionally-generic
framework. Key features include:

- **GPU-Accelerated**: All operations vectorized with PyTorch, run natively on CUDA
- **Dimensionally Generic**: Works with n-D manifolds embedded in m-D spaces
- **TensorDict Integration**: Structured data management with automatic device handling
- **Differentiable**: Seamless integration with PyTorch autograd
- **Flexible Data**: Arbitrary-rank tensor fields on points, cells, or globally

For the complete feature list, see the
[physicsnemo.mesh README](../../../physicsnemo/mesh/README.md).

## Prerequisites

- Python 3.10+
- PyTorch 2.0+
- CUDA-capable GPU (recommended, not required)

## Installation

```bash
pip install nvidia-physicsnemo pyvista[all,trame] matplotlib jupyter
```

Or install from the repository:

```bash
pip install -e ".[mesh]"
```

## Tutorial Overview

<!-- markdownlint-disable MD013 -->
| Tutorial | Topic | What You'll Learn |
|----------|-------|-------------------|
| **1. Getting Started** | Core concepts | Mesh structure, data attachment, GPU acceleration |
| **2. Operations** | Mesh manipulation | Transformations, subdivision, slicing, merging |
| **3. Discrete Calculus** | Mathematical operators | Gradients, divergence, curl, curvature |
| **4. Neighbors & Spatial** | Queries | Adjacency, BVH, sampling, interpolation |
| **5. Quality & Repair** | Mesh health | Validation, quality metrics, repair |
| **6. ML Integration** | Production workflows | Performance, batching, torch.compile |
<!-- markdownlint-enable MD013 -->

## Running the Tutorials

### Option 1: Jupyter Notebook

```bash
cd examples/minimal/mesh
jupyter notebook
```

Then open any `tutorial_*.ipynb` file.

### Option 2: JupyterLab

```bash
cd examples/minimal/mesh
jupyter lab
```

### Option 3: VS Code / Cursor

Open the `.ipynb` files directly - they work with the built-in notebook support.

## Tutorial Contents

### Tutorial 1: Getting Started

**File**: `tutorial_1_getting_started.ipynb`

Learn the core concepts - a `Mesh` is just 5 fields: 2 for geometry, 3 for data.

- The 5-field data structure (points, cells, point_data, cell_data, global_data)
- Creating meshes from scratch
- Loading from PyVista and built-in primitives
- Attaching scalar, vector, and tensor data
- Visualization with `.draw()`
- GPU acceleration with `.to("cuda")`
- Autograd integration

### Tutorial 2: Operations and Transformations

**File**: `tutorial_2_operations.ipynb`

Learn mesh manipulation operations.

- Geometric transformations (translate, rotate, scale, transform)
- Subdivision schemes (linear, Loop, Butterfly)
- Slicing (slice_cells, slice_points)
- Merging multiple meshes
- Boundary and facet extraction
- Data conversion (cell_data_to_point_data, point_data_to_cell_data)
- Topology checks (is_watertight, is_manifold)

### Tutorial 3: Discrete Calculus and Differential Geometry

**File**: `tutorial_3_calculus.ipynb`

Learn mathematical operations on meshes.

- Computing gradients (LSQ and DEC methods)
- Divergence and curl
- Gaussian and mean curvature
- Intrinsic vs extrinsic derivatives
- Vector calculus identities
- Physics-informed feature extraction

### Tutorial 4: Neighbors, Adjacency, and Spatial Queries

**File**: `tutorial_4_neighbors_spatial.ipynb`

Learn about mesh queries for GNN-style processing.

- Topological neighbors (point-to-points, cell-to-cells)
- Sparse adjacency encoding
- BVH construction and queries
- Point containment
- Random point sampling
- Data interpolation at query points

### Tutorial 5: Quality, Validation, and Repair

**File**: `tutorial_5_quality_repair.ipynb`

Learn mesh quality assessment and repair.

- Quality metrics (aspect ratio, angles, quality score)
- Mesh statistics
- Validation (detect errors)
- Repair operations (clean, remove duplicates, fix orientation)
- Manifold and watertight checking

### Tutorial 6: Integration with ML Workflows

**File**: `tutorial_6_ml_integration.ipynb`

Learn to use PhysicsNeMo-Mesh in production ML pipelines.

- Performance comparison with PyVista/VTK
- Batching with padding for torch.compile
- Feature extraction for ML models
- Boundary condition handling
- End-to-end CAE preprocessing workflow
- torch.compile compatibility

## Assets

The `assets/` directory contains pre-saved meshes for use in tutorials:

- `bunny.pt` - Stanford bunny mesh (coarse, use `.subdivide()` for detail)

## Additional Resources

- [PhysicsNeMo Documentation](https://docs.nvidia.com/deeplearning/physicsnemo)
- [physicsnemo.mesh Module Reference](../../../physicsnemo/mesh/README.md)
- [PyTorch TensorDict](https://github.com/pytorch/tensordict)
- [PyVista](https://pyvista.org/)
Binary file added examples/minimal/mesh/assets/bunny.pt
Binary file not shown.
31 changes: 31 additions & 0 deletions examples/minimal/mesh/assets/make_bunny.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Make the Stanford bunny mesh for the tutorials."""

from pathlib import Path

import pyvista as pv
import torch

from physicsnemo.mesh.io.io_pyvista import from_pyvista
from physicsnemo.mesh.remeshing._remeshing import remesh

mesh = from_pyvista(pv.examples.download_bunny_coarse())
mesh = remesh(mesh.clean().subdivide(levels=3, filter="linear"), 400)
mesh = mesh.rotate(axis="x", angle=torch.pi / 2).rotate(axis="z", angle=torch.pi / 2)

torch.save(mesh, Path(__file__).parent / "bunny.pt")
48 changes: 48 additions & 0 deletions examples/minimal/mesh/benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Benchmark utilities for PhysicsNeMo-Mesh tutorial 6.

This package provides:
- ``benchmark()`` - a timing harness with CUDA synchronization and warmup
- ``compiled_ops`` - ``@torch.compile`` wrapped mesh operations
- ``raw_ops`` - uncompiled mesh operations (same logic, no ``torch.compile``)
- ``save_benchmark_results`` / ``load_benchmark_results`` - JSON serialization
- ``plot_speedup_chart`` - grouped bar chart of speedup vs. CPU-pyvista
"""

from . import compiled_ops, raw_ops
from .infrastructure import (
BENCHMARK_DISPLAY_CONFIGS,
VARIANT_CONFIGS,
benchmark,
collect_system_metadata,
load_benchmark_results,
plot_speedup_chart,
save_benchmark_results,
)

__all__ = [
"BENCHMARK_DISPLAY_CONFIGS",
"VARIANT_CONFIGS",
"benchmark",
"collect_system_metadata",
"compiled_ops",
"load_benchmark_results",
"plot_speedup_chart",
"raw_ops",
"save_benchmark_results",
]
37 changes: 37 additions & 0 deletions examples/minimal/mesh/benchmarks/compiled_ops.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: Copyright (c) 2023 - 2026 NVIDIA CORPORATION & AFFILIATES.
# SPDX-FileCopyrightText: All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""``torch.compile``-wrapped PhysicsNeMo-Mesh operations for benchmarking.

Each compiled function is a thin wrapper around the corresponding function in
:mod:`raw_ops`, with ``torch.compile`` applied. See ``raw_ops`` for the
actual implementations and docstrings.
"""

import torch

from . import raw_ops

cell_normals = torch.compile(raw_ops.cell_normals)
gaussian_curvature = torch.compile(raw_ops.gaussian_curvature)
gradient = torch.compile(raw_ops.gradient)
subdivide = torch.compile(raw_ops.subdivide)
p2p_neighbors = torch.compile(raw_ops.p2p_neighbors)
c2c_neighbors = torch.compile(raw_ops.c2c_neighbors)
sample_points = torch.compile(raw_ops.sample_points)
sample_points_area_weighted = torch.compile(raw_ops.sample_points_area_weighted)
smooth = torch.compile(raw_ops.smooth)
transforms = torch.compile(raw_ops.transforms)
Loading