Nuclide

Struct Nuclide 

Source
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_temperatures always lists every temperature present in the source JSON file – even if a filtered load only materialized a subset.
  • loaded_temperatures tracks the subset actually parsed into reactions and energy according 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: bool

True 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

Source

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

Source

pub fn energy_grid(&self, temperature: &str) -> Option<&Vec<f64>>

Get the energy grid for a specific temperature

Source

pub fn temperatures(&self) -> Option<Vec<String>>

Get a list of available temperatures

Source

pub fn reaction_mts(&self) -> Option<Vec<i32>>

Get a list of available MT numbers

Source

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

Trait Implementations§

Source§

impl Clone for Nuclide

Source§

fn clone(&self) -> Nuclide

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Nuclide

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Nuclide

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Nuclide

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,