Official agent skill

Physicsnemo Cfd Create Custom Metric

by NVIDIA in NVIDIA/physicsnemo-cfd

Create a custom metric for the PhysicsNeMo CFD benchmarking workflow.

OfficialApache-2.0Auto-check passedResearch & Science

Install Physicsnemo Cfd Create Custom Metric

skills CLI
$ npx skills add NVIDIA/physicsnemo-cfd --skill physicsnemo-cfd-create-custom-metric -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NVIDIA/physicsnemo-cfd physicsnemo-cfd-create-custom-metric --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NVIDIA/physicsnemo-cfd.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/physicsnemo-cfd-create-custom-metric .claude/skills/physicsnemo-cfd-create-custom-metric && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
physicsnemo-cfd-create-custom-metric
GitHub stars
153
Token cost
~1.6k tokens
SKILL.md length
325 words
Files
5
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Create a custom metric for the PhysicsNeMo CFD benchmarking workflow.

  • Works in 4 steps: Write the metric function → Register the metric → Use in benchmark config → …
  • The user wants to add a new evaluation metric
  • SKILL.md covers Reference files to read first, Metric function signature, Step 1: Write the metric… and Step 2: Register the metric, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Physicsnemo Cfd Create Custom Metric is an agent skill from NVIDIA/physicsnemo-cfd, published by the product's own GitHub organization. Create a custom metric for the PhysicsNeMo CFD benchmarking workflow. Use when the user wants to add a new evaluation metric, implement a custom error measure, compute force coefficients, or extend the benchmark with domain-specific quantities.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files (for example `BENCHMARK.md`, `evals/evals.json` and `skill-card.md`).

It sits in Research & Science, covering Physical and earth sciences. It works with NVIDIA AI Platform. The repository describes itself as: Library for using the models trained in PhysicsNeMo in Engineering and CFD workflows. The licence is Apache-2.0.

When your agent uses it

  • The user wants to add a new evaluation metric
  • Implement a custom error measure
  • Compute force coefficients
  • Extend the benchmark with domain-specific quantities

Example prompts

  • “/physicsnemo-cfd-create-custom-metric”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Write the metric function
  2. Register the metric
  3. Use in benchmark config
  4. Make permanent (optional)

What it can do on your machine

Read from SKILL.md and the folder at commit 0612ec4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and yaml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Physicsnemo Cfd Create Custom Metric loads about 1.6k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 325 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from NVIDIA/physicsnemo-cfd at commit 0612ec4, republished under its Apache-2.0 licence (© NVIDIA). 325 words, ~1,588 tokens.

Download SKILL.mdSave it as .claude/skills/physicsnemo-cfd-create-custom-metric/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
physicsnemo-cfd-create-custom-metric
description
Create a custom metric for the PhysicsNeMo CFD benchmarking workflow. Use when the user wants to add a new evaluation metric, implement a custom error measure, compute force coefficients, or extend the benchmark with domain-specific quantities.
license
Apache-2.0

Create a Custom Metric

Guide the user through adding a new metric to the benchmarking workflow.

Reference files to read first

  • physicsnemo/cfd/postprocessing_tools/metric_registry.py — register_metric, get_metric, MetricFn
  • physicsnemo/cfd/evaluation/metrics/builtin/forces.py — drag_error, lift_error (dict-returning, mesh-based)
  • physicsnemo/cfd/evaluation/metrics/builtin/l2.py — L2 metrics (scalar-returning, numpy fallback)
  • physicsnemo/cfd/evaluation/metrics/mesh_bridge.py — build_comparison_mesh, resolve_comparison_mesh_for_metric
  • physicsnemo/cfd/postprocessing_tools/metrics/aero_forces.py — compute_force_coefficients (normals, areas, integration)
  • workflows/benchmarking/notebooks/adding_a_new_metric.ipynb — end-to-end tutorial

Metric function signature

Metrics are plain callables, no base class:

python
MetricFn = Callable[..., float | dict[str, float]]

Modern signature (accepts extended engine kwargs):

python
def my_metric(
    ground_truth: dict,      # canonical GT: {"pressure": ..., "shear_stress": ...}
    predictions: dict,        # canonical predictions from decode_outputs
    *,
    case: Any = None,         # CanonicalCase from the dataset adapter
    comparison_mesh: Any = None,  # PyVista mesh with GT + pred arrays attached
    metric_dtype: str | None = None,  # "cell" or "point"
    output: Any = None,       # OutputConfig with field name mappings
    **_: object,              # absorb unknown kwargs
) -> float | dict[str, float]:
    ...

Return types:

  • float — single scalar value (e.g., L2 error)
  • dict[str, float] — multiple values; keys are auto-flattened by the engine: {"error": 0.1, "pred": 42.0} from metric side_force becomes side_force_error and side_force_pred in results

Step 1: Write the metric function

Simple array-based metric (no mesh needed)
python
import numpy as np

def mae_pressure(ground_truth, predictions, **_):
    gt = np.asarray(ground_truth.get("pressure", []), dtype=np.float64).ravel()
    pred = np.asarray(predictions.get("pressure", []), dtype=np.float64).ravel()
    if gt.size == 0 or pred.size == 0 or gt.shape != pred.shape:
        return float("nan")
    return float(np.mean(np.abs(gt - pred)))
Mesh-based metric (uses normals, areas, geometry)

Use resolve_comparison_mesh_for_metric (shared helper in mesh_bridge; do not copy a local _resolve_mesh) to get the comparison mesh, then access arrays:

python
from physicsnemo.cfd.evaluation.metrics.mesh_bridge import resolve_comparison_mesh_for_metric

def my_force_metric(ground_truth, predictions, *, case=None, comparison_mesh=None,
                    metric_dtype=None, output=None, **_):
    mesh, dtype = resolve_comparison_mesh_for_metric(
        predictions,
        case=case,
        comparison_mesh=comparison_mesh,
        metric_dtype=metric_dtype,
        output=output,
    )
    if mesh is None or output is None:
        return float("nan")

    # Access fields by VTK array name from output config
    p = mesh.cell_data[output.mesh_field_names["pressure"]]
    wss = mesh.cell_data[output.mesh_field_names["shear_stress"]]

    # Access mesh geometry
    mesh = mesh.compute_normals().compute_cell_sizes()
    normals = mesh["Normals"]   # (N, 3)
    areas = mesh["Area"]        # (N,)

    # Compute your metric...
    return float(result)

Step 2: Register the metric

python
from physicsnemo.cfd.postprocessing_tools.metric_registry import register_metric

register_metric("my_metric", my_metric_fn, domain="surface")  # or "volume" or None
  • domain="surface" — only used when model's inference domain is surface
  • domain="volume" — only used for volume inference
  • domain=None — domain-agnostic fallback
  • Same name can be registered for both domains with different functions (like l2_pressure)

Step 3: Use in benchmark config

Add the metric name to the metrics list:

python
config = Config.from_dict({
    ...
    "metrics": ["l2_pressure", "drag", "lift", "my_metric"],
    ...
})

Or in YAML:

yaml
metrics:
  - l2_pressure
  - my_metric

Per-metric kwargs can be passed as a dict:

yaml
metrics:
  - name: my_metric
    some_param: 42

Step 4: Make permanent (optional)

Add to physicsnemo/cfd/evaluation/metrics/builtin/ and register from builtin/__init__.py:

python
def register_my_metrics():
    register_metric("my_metric", my_fn, domain="surface")

# In __init__.py:
def register_all_builtin_metrics():
    register_l2_metrics()
    register_force_metrics()
    register_physics_metrics()
    register_my_metrics()  # add this

Existing built-in metrics

NameDomain(s)Returns
l2_pressuresurface, volumefloat
l2_shear_stresssurfacedict
l2_pressure_area_weightedsurfacefloat
l2_velocityvolumedict
l2_turbulent_viscosityvolumefloat
dragsurfacedict (error, true, pred)
liftsurfacedict (error, true, pred)
continuity_residual_l2volumefloat
momentum_residual_l2volumefloat

Gotchas

  • Dict flattening: if metric returns {"error": 0.1, "true": 5.0}, engine stores as metricname_error and metricname_true. An empty string key "" maps to just metricname.
  • NaN handling: return float("nan") for failures; engine accumulates NaN gracefully.
  • Legacy fallback: engine tries extended kwargs first; on TypeError it falls back to fn(gt, predictions, **mkwargs) only. Modern metrics should accept **_ to absorb unknowns.
  • Results JSON format: benchmark_results.json is a plain list[dict], not {"results": [...]}.
  • OutputConfig field names: surface uses output.mesh_field_names / output.ground_truth_mesh_field_names; volume uses output.volume_mesh_field_names / output.ground_truth_volume_mesh_field_names.

© NVIDIA, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in skills/physicsnemo-cfd-create-custom-metric of NVIDIA/physicsnemo-cfd.

  • SKILL.md
  • BENCHMARK.md
  • evals/evals.json
  • skill-card.md
  • skill.oms.sig

Open the folder on GitHubat commit 0612ec4

Compare with similar skills

Physicsnemo Cfd Create Custom Metric next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Physicsnemo Cfd Create Custom Metric compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Physicsnemo Cfd Create Custom Metric this skillNVIDIA/physicsnemo-cfd153—~1.6kAutomated safety check: PassApache-2.0
Cantera Ignition DelayK-Dense-AI/scientific-agent-skills48k2 repos~2.2kAutomated safety check: PassMIT
AstropyzLanqing/codex-claude-academic-skills4.6k14 repos~2.9kAutomated safety check: PassBSD-3-Clause
PymatgenzLanqing/codex-claude-academic-skills4.6k12 repos~5kAutomated safety check: PassMIT
Weathertrpc-group/trpc-agent-go1.8k9 repos~591Automated safety check: PassApache-2.0
Pymol VisualizationChatMol/ChatMol372—~1.2kAutomated safety check: PassMIT

Similar skills

  • Cantera Ignition Delay

    K-Dense-AI/scientific-agent-skills

    Runs Cantera constant-volume or constant-pressure ignition simulations and reports temperature-based ignition delay with mechanism provenance and checks.

    48k GitHub starsUsed in 2 repos~2.2k tokens
    Research & ScienceAuto-check passed
  • Astropy

    zLanqing/codex-claude-academic-skills

    Comprehensive Python library for astronomy and astrophysics.

    4.6k GitHub starsUsed in 14 repos~2.9k tokens
    Research & ScienceAuto-check passed
  • Pymatgen

    zLanqing/codex-claude-academic-skills

    Materials science toolkit. An agent skill from zLanqing/codex-claude-academic-skills.

    4.6k GitHub starsUsed in 12 repos~5k tokens
    Research & ScienceAuto-check passed
  • Weather

    trpc-group/trpc-agent-go

    Get current weather and forecasts via wttr.in or Open-Meteo.

    1.8k GitHub starsUsed in 9 repos~591 tokens
    Research & ScienceAuto-check passed
  • Pymol Visualization

    ChatMol/ChatMol

    Generate publication-quality molecular visualization images using PyMOL.

    372 GitHub stars~1.2k tokensUpdated 6 mo ago
    Research & ScienceAuto-check passed
  • Complexa Binder Design

    NVIDIA-BioNeMo/bionemo-agent-toolkit

    Run a complete protein binder design campaign with NVIDIA Proteina-Complexa: resolve a target structure and hotspots from a name/sequence/PDB, co-design binder sequence+structure with reward-guided…

    478 GitHub stars~3.1k tokensUpdated yesterday
    Research & ScienceAuto-check: notes

More from NVIDIA/physicsnemo-cfd

  • Official

    Create a new model wrapper for the PhysicsNeMo CFD benchmarking workflow.

    153 GitHub stars~5.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Official

    Create a new dataset adapter for the PhysicsNeMo CFD benchmarking workflow.

    153 GitHub stars~3k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Physicsnemo Cfd Create Custom Metric

What does Physicsnemo Cfd Create Custom Metric do?

Create a custom metric for the PhysicsNeMo CFD benchmarking workflow. Physicsnemo Cfd Create Custom Metric is an agent skill from NVIDIA/physicsnemo-cfd, published by the product's own GitHub organization. Create a custom metric for the PhysicsNeMo CFD benchmarking workflow.

When should I use Physicsnemo Cfd Create Custom Metric?

Physicsnemo Cfd Create Custom Metric fits situations like: the user wants to add a new evaluation metric; implement a custom error measure; compute force coefficients; extend the benchmark with domain-specific quantities.

How do I install Physicsnemo Cfd Create Custom Metric in Claude Code?

Run `npx skills add NVIDIA/physicsnemo-cfd --skill physicsnemo-cfd-create-custom-metric -a claude-code`. Or copy the skill folder (skills/physicsnemo-cfd-create-custom-metric in NVIDIA/physicsnemo-cfd) into .claude/skills/physicsnemo-cfd-create-custom-metric in your project. Claude Code loads it when a task matches its description.

How do I install Physicsnemo Cfd Create Custom Metric in Codex?

Run `npx skills add NVIDIA/physicsnemo-cfd --skill physicsnemo-cfd-create-custom-metric -a codex`. Or copy the skill folder (skills/physicsnemo-cfd-create-custom-metric in NVIDIA/physicsnemo-cfd) into .agents/skills/physicsnemo-cfd-create-custom-metric in your project. Codex loads it when a task matches its description.

Can I use Physicsnemo Cfd Create Custom Metric in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NVIDIA/physicsnemo-cfd --skill physicsnemo-cfd-create-custom-metric -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/physicsnemo-cfd-create-custom-metric, .gemini/skills/physicsnemo-cfd-create-custom-metric, .github/skills/physicsnemo-cfd-create-custom-metric and .opencode/skills/physicsnemo-cfd-create-custom-metric in your project.

What does Physicsnemo Cfd Create Custom Metric need to run?

SKILL.md names no scripts, command-line tools or credentials: Physicsnemo Cfd Create Custom Metric is instructions for the agent only. Our summary lists: Python 3.

Does Physicsnemo Cfd Create Custom Metric access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Physicsnemo Cfd Create Custom Metric safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Physicsnemo Cfd Create Custom Metric use?

Physicsnemo Cfd Create Custom Metric is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Physicsnemo Cfd Create Custom Metric use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Physicsnemo Cfd Create Custom Metric?

Skills that share tags, products or a category with Physicsnemo Cfd Create Custom Metric: Cantera Ignition Delay (K-Dense-AI/scientific-agent-skills, 48k stars), Astropy (zLanqing/codex-claude-academic-skills, 4.6k stars), Pymatgen (zLanqing/codex-claude-academic-skills, 4.6k stars) and Weather (trpc-group/trpc-agent-go, 1.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Physicsnemo Cfd Create Custom Metric?

NVIDIA (a GitHub organization, an official publisher) maintains it in NVIDIA/physicsnemo-cfd, which has 153 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on August 18, 2026.

Source: NVIDIA/physicsnemo-cfd on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.