AGENT SKILL

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

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

  1. 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.
  2. Choose object type. Use Mesh for one geometry and DomainMesh for an interior mesh plus named boundary meshes.
  3. Import from the right surface. Root physicsnemo.mesh exports only the core object model and field-rank helpers. Validation, I/O, sampling, repair, remeshing, spatial, and calculus functions live in submodules.
  4. 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.
  5. 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.
  6. 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 as points; omit it or pass None for 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_data leaves start with n_points; cell_data leaves start with n_cells; global_data has no leading mesh batch dimension.
  • For semantic rank schemas, use root field helpers such as ranks_from_tensordict() and validate_data_contains_ranks().
  • For DomainMesh, every boundary value must be a Mesh and share the interior spatial dimension; use dm.validate() plus dm.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 MeshReader or DomainMeshReader: route to sibling sub-skill datapipes.
  • 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351