Skip to main content

Crate nucleide_emit

Crate nucleide_emit 

Source
Expand description

Single-material emission to legacy transport-code cards.

emit_all renders one Material through five code dialects — MCNP, Serpent, FLUKA, ALARA, PARTISN — and drift_table reports how much mass survives each translation. Every emitter is pure glue over the workspace *-io crates plus nucleide_nuclei::dialects; no new physics lives here.

§Drift semantics

Each emitter returns the mass it could represent per nuclide (Emitted::accounted) plus what it had to drop (Emitted::dropped, e.g. a nuclide with no FLUKA name). DriftRow::rel_drift is (mass_in - mass_out) / mass_in. Emitted::reparsed tells whether the emitted text was machine-verified by feeding it back through that code’s reader (MCNP and ALARA only — Serpent, FLUKA, and PARTISN have no material readers in this workspace, so their drift is analytic).

§Example

use nucleide_emit::{EmitOptions, emit_drift};
use nucleide_material::Material;
use nucleide_nuclei::NuclideId;

let mut mat = Material::new();
mat.add_nuclide(NuclideId::from_name("U235").unwrap(), 5.0);
mat.add_nuclide(NuclideId::from_name("U238").unwrap(), 95.0);
let opts = EmitOptions::new("leu").with_density(10.0);
let (emitted, table) = emit_drift(&mat, &opts).unwrap();
assert_eq!(emitted.len(), 5);
assert!(table.worst_rel_drift() < 1e-9);

Modules§

alara
ALARA mixture block emission.
armi
ARMI blueprint mass fractions → Material.
fluka
FLUKA COMPOUND card emission.
mcnp
MCNP m<number> card emission.
partisn
PARTISN single-zone deck emission.
serpent
Serpent mat card emission.

Structs§

DriftRow
One row of the mass-drift report.
DriftTable
Mass conservation across all five dialects.
Dropped
One nuclide the emitter could not represent.
EmitOptions
Shared emission settings.
Emitted
Cards emitted for one dialect.

Enums§

Code
One of the five supported transport-code dialects.
Error
Errors raised while emitting cards.

Functions§

drift_table
Build the mass-drift report for already-emitted cards.
emit_all
Emit one Material through all five dialects, in Code::all order.
emit_drift
Emit through all dialects and report mass drift in one call.

Type Aliases§

Result
Crate-local result alias.