mesh-and-geometry
Use PhysicsNeMo-Mesh for Mesh/DomainMesh creation, validation, geometry/calculus, queries, repair/remesh, I/O, and visualization.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mesh-and-geometry
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use PhysicsNeMo-Mesh for Mesh/DomainMesh creation, validation, geometry/calculus, queries, repair/remesh, I/O, and visualization.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md1.5 KB
- 参考文档references/mesh-workflows.md1.8 KB
- 参考文档references/troubleshooting.md1.4 KB
- 脚本scripts/mesh_smoke.py1.4 KB
03 SKILL.md 正文
PhysicsNeMo mesh-and-geometry
Use this sub-skill when the task is about PhysicsNeMo-Mesh objects or mesh preprocessing rather than choosing a neural model or building a data reader.
Trigger phrases
Mesh,DomainMesh, simplicial mesh, triangle mesh, tetrahedral mesh, point cloud, curve mesh.- Mesh creation, field attachment,
point_data,cell_data,global_data, TensorDict field ranks. - Mesh validation, quality metrics, manifold/watertight checks, duplicate vertices, degenerate or inverted cells.
- Geometry or calculus: centroids, areas/volumes, normals, curvature, gradient, divergence, curl, Laplace-Beltrami.
- Neighbors, adjacency, BVH, spatial query, barycentric sampling/interpolation.
- Mesh repair, cleaning, subdivision, remeshing, transformations/deformation.
- PyVista/VTK conversion, Zarr/native mesh serialization, visualization caveats.
Fast route
- Confirm the representation. PhysicsNeMo-Mesh accepts pure simplicial complexes: 0-simplices/points, 1-simplices/edges, 2-simplices/triangles, 3-simplices/tetrahedra, or higher-dimensional simplices. Do not treat arbitrary VTK polygons/polyhedra as directly supported until they are triangulated/tetrahedralized or converted through an explicit helper.
- Choose object type. Use
Meshfor one geometry andDomainMeshfor an interior mesh plus named boundary meshes. - Import from the right surface. Root
physicsnemo.meshexports only the core object model and field-rank helpers. Validation, I/O, sampling, repair, remeshing, spatial, and calculus functions live in submodules. - Validate before expensive work. Check tensor shape/dtype/device, out-of-bounds indices, degeneracy, duplicate vertices, and optional manifoldness/inversion. Then compute quality metrics if mesh health matters.
- Run operations on the mesh device.
mesh.to("cuda")moves geometry and attached data together; PyVista/VTK visualization and conversion are CPU/external-library workflows. - Use references for details. Recipes: references/mesh-workflows.md. API/import map: references/api-reference.md. Failure modes: references/troubleshooting.md.
Minimal import pattern
from physicsnemo.mesh import DomainMesh, Mesh
from physicsnemo.mesh.validation import compute_quality_metrics, validate
# Compatibility alias exists in the validation submodule, not the mesh root:
from physicsnemo.mesh.validation import validate_mesh # pending-deprecation alias
Never write from physicsnemo.mesh import validate_mesh; it is not a root export.
Validation checklist
points: floating tensor with shape(n_points, n_spatial_dims).cells: integer tensor with shape(n_cells, n_manifold_dims + 1), same device aspoints; omit it or passNonefor a point cloud.n_manifold_dims <= n_spatial_dims; triangles in 3D are valid, tetrahedra in 2D are not.- Cell indices are in
[0, n_points)and one cell should not repeat a vertex unless intentionally testing degeneracy. point_dataleaves start withn_points;cell_dataleaves start withn_cells;global_datahas no leading mesh batch dimension.- For semantic rank schemas, use root field helpers such as
ranks_from_tensordict()andvalidate_data_contains_ranks(). - For
DomainMesh, every boundary value must be aMeshand share the interior spatial dimension; usedm.validate()plusdm.is_boundary_watertight()when boundary closure matters.
Sibling routes
- Model-family choice for MeshGraphNet, Transolver, DoMINO, FIGConvNet, or graph/geometry models: route to sibling sub-skill
model-selection. - Mesh file readers inside a training data pipeline, including
MeshReaderorDomainMeshReader: route to sibling sub-skilldatapipes. - Multi-GPU/domain-parallel training after mesh preprocessing: route to sibling sub-skill
distributed-and-domain-parallel. - Active-learning loops or ONNX export after mesh-based inference: route to sibling sub-skill
active-learning-and-deployment.
Bundled smoke
Run a tiny local check without downloads:
python sub-skills/mesh-and-geometry/scripts/mesh_smoke.py
python sub-skills/mesh-and-geometry/scripts/mesh_smoke.py --cuda
The --cuda path only moves a three-point triangle mesh to CUDA when CUDA is available.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).