nucleide-emit 0.12.0

Single-material emission to MCNP/Serpent/FLUKA/ALARA/PARTISN cards plus mass-drift reports
Documentation

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