nucleide-material 0.3.0

Nuclear material compositions: mixing, conversions, materials XML export
Documentation

Materials: compositions, mixing, and serialization for nuclear engineering.

A [Material] is a map from [NuclideId] to a stored mass in grams, plus an optional mass density (g/cm3 by convention) and free-form JSON metadata. Density lives outside the composition: it is a property of the stream rather than part of the composition itself.

Atomic-mass-dependent conversions ([Material::from_atom_frac] and [Material::atom_fractions]) take a [MassProvider] so the material crate stays independent of the nuclear-data tables; wire up nucleide_nuclei::data once it lands.

use nucleide_material::{MassProvider, Material, NoMasses};
use nucleide_nuclei::NuclideId;

let mut mat = Material::new();
mat.add_nuclide(NuclideId::from_name("U235").unwrap(), 19.0);
mat.add_nuclide(NuclideId::from_name("U238").unwrap(), 1.0);
assert_eq!(mat.mass(), 20.0);

// Atom conversions need atomic masses:
let atoms = mat.atom_fractions(&NoMasses);
assert!(atoms.is_err());