pub struct Nuclide {Show 13 fields
pub name: Option<String>,
pub element: Option<String>,
pub atomic_symbol: Option<String>,
pub atomic_number: Option<u32>,
pub neutron_number: Option<u32>,
pub mass_number: Option<u32>,
pub library: Option<String>,
pub energy: Option<HashMap<String, Vec<f64>>>,
pub reactions: HashMap<String, HashMap<i32, Reaction>>,
pub fissionable: bool,
pub available_temperatures: Vec<String>,
pub loaded_temperatures: Vec<String>,
pub data_path: Option<String>,
}Expand description
Core data model for a single nuclide and its reaction cross section data.
A Nuclide mirrors (and is deserialized from) a JSON schema containing
metadata plus reaction channel data at one or more temperatures. Reaction
data are organized by temperature key (e.g. “294”) and then by ENDF/MT
number. Each Reaction holds its own threshold information and (possibly
truncated) energy grid relative to the top‑level temperature energy grid.
Temperatures:
available_temperaturesalways lists every temperature present in the source JSON file – even if a filtered load only materialized a subset.loaded_temperaturestracks the subset actually parsed intoreactionsandenergyaccording to caller filtering semantics.
Fields§
§name: Option<String>Canonical nuclide name (e.g. “Li6”). May be derived when absent.
element: Option<String>Optional human readable element name (legacy field; may be absent).
atomic_symbol: Option<String>Element symbol, e.g. “Li”.
atomic_number: Option<u32>Atomic (proton) number Z.
neutron_number: Option<u32>Neutron number N (may be computed from A - Z if missing).
mass_number: Option<u32>Mass number A.
library: Option<String>Origin / library identifier (e.g. JEFF, ENDF, custom tag).
energy: Option<HashMap<String, Vec<f64>>>Top‑level energy grid per temperature (full grid; per‑reaction grids may be threshold‑truncated).
reactions: HashMap<String, HashMap<i32, Reaction>>temperature -> MT number -> reaction data.
fissionable: boolTrue if any fission MT channel is present.
available_temperatures: Vec<String>All temperatures present in the JSON file regardless of filtering.
loaded_temperatures: Vec<String>Subset of temperatures actually loaded into reactions / energy.
data_path: Option<String>Optional path the JSON was read from (None for in‑memory sources / WASM).
Implementations§
Source§impl Nuclide
impl Nuclide
Sourcepub fn sample_reaction<R: Rng + ?Sized>(
&self,
energy: f64,
temperature: &str,
rng: &mut R,
) -> Option<&Reaction>
pub fn sample_reaction<R: Rng + ?Sized>( &self, energy: f64, temperature: &str, rng: &mut R, ) -> Option<&Reaction>
Sample the top-level reaction type (fission, absorption, elastic, inelastic, other) at a given energy and temperature
Sourcepub fn energy_grid(&self, temperature: &str) -> Option<&Vec<f64>>
pub fn energy_grid(&self, temperature: &str) -> Option<&Vec<f64>>
Get the energy grid for a specific temperature
Sourcepub fn temperatures(&self) -> Option<Vec<String>>
pub fn temperatures(&self) -> Option<Vec<String>>
Get a list of available temperatures
Sourcepub fn reaction_mts(&self) -> Option<Vec<i32>>
pub fn reaction_mts(&self) -> Option<Vec<i32>>
Get a list of available MT numbers
Sourcepub fn microscopic_cross_section<R>(
&mut self,
reaction: R,
temperature: Option<&str>,
) -> Result<(Vec<f64>, Vec<f64>), Box<dyn Error>>where
R: Into<ReactionIdentifier>,
pub fn microscopic_cross_section<R>(
&mut self,
reaction: R,
temperature: Option<&str>,
) -> Result<(Vec<f64>, Vec<f64>), Box<dyn Error>>where
R: Into<ReactionIdentifier>,
Get microscopic cross section data for a specific reaction and temperature. Returns a tuple of (cross_section_values, energy_grid). If temperature is None, uses the single loaded temperature if only one exists. Automatically loads data if not already loaded, using the nuclide name and config.
§Arguments
reaction- Either an MT number (i32) or reaction name (String/&str) like “(n,gamma)” or “fission”temperature- Optional temperature string