Skip to content
Back to skills

Model Geometry

ASecurity

"Construct and validate OpenMC Python model inputs: materials, CSG

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
documentationpythonapi

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill model-geometry --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Model Geometry?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Model Geometry
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-model-geometry/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-model-geometry)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: model-geometry
description: "Construct and validate OpenMC Python model inputs: materials, CSG
  geometry, universes, lattices, sources, settings, plots, IDs, bounding boxes,
  and XML exports."
disable-model-invocation: true
metadata:
  disco-role: operating
license: NOASSERTION
---

# Model and geometry

Use this route when the task is to build or inspect OpenMC **input objects** in
Python. Keep the work at model-construction level: do not run transport, infer
nuclear-data availability, or analyze statepoints and tallies.

## Route by need

- For object APIs, type checks, IDs, CSG, lattices, transforms, and XML tags,
  read [api-reference.md](references/api-reference.md).
- For a novice pin cell, a repeated-universe/lattice model, custom or
  parameterized source, or XML-only validation, read
  [modeling-workflows.md](references/modeling-workflows.md).
- For failures, warnings, missing prerequisites, malformed XML, or finite
  bounding-box issues, read [troubleshooting.md](references/troubleshooting.md).
- To generate a deterministic, transport-free fixture, use
  [scripts/build_minimal_model.py](scripts/build_minimal_model.py). Run its
  `--help` first, then pass the required explicit `--output-dir`; it writes
  and validates `materials.xml`, `geometry.xml`, `settings.xml`, and
  `model.xml` for a material-filled sphere cell in an explicit universe.

## Operating contract

1. Choose explicit IDs or call `openmc.reset_auto_ids()` at the start of an
   isolated construction. Treat duplicate explicit-ID warnings as a model
   ownership problem; do not silence them.
2. Build the object graph in dependency order: materials and distributions,
   surfaces and half-spaces, cells, universes/lattices, root geometry, settings,
   optional plots, then `openmc.Model`.
3. Validate with Python-level assertions before any native execution: object
   types, fill/region relationships, lattice shape/indexing, source and
   settings values, finite/infinite bounding-box expectations, and XML parse
   results.
4. Use `Model.export_to_xml(directory=...)` for separate input files and
   `Model.export_to_model_xml(path=...)` for one combined model document. XML
   generation is not a transport run and does not require
   `OPENMC_CROSS_SECTIONS`; a later transport run has separate runtime/data
   prerequisites owned by `setup-runtime`.
5. Keep tally/result arithmetic, StatePoint/summary readers, data libraries,
   depletion, C API/library mode, build flags, and advanced solvers in their
   owning routes. Link back to those routes rather than expanding this one.

## Definition of done

A model-geometry task is complete when the requested Python graph is
constructible, invalid assignments fail with the expected exception class,
`geometry.bounding_box` and lattice/source choices are checked, and the
requested XML file(s) are written and parsed. The bundled fixture is a
transport-free smoke case and does not establish that a compiled executable,
native shared library, or cross-section data is available. Classify such
checks as optional/blocked instead of treating XML construction as failed.

Files in this skill

  • SKILL.md3.1 KB
  • references/api-reference.md8.7 KB
  • references/modeling-workflows.md7.5 KB
  • references/troubleshooting.md6.7 KB
  • scripts/build_minimal_model.py6.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.