pub struct Input {
pub beam: BeamSpec,
pub materials: BTreeMap<String, MaterialSpec>,
pub target: TargetSpec,
pub physics: PhysicsSpec,
pub stopping: StoppingSpec,
pub run: RunSpec,
pub tally: TallySpec,
pub dynamic: Option<DynamicSpec>,
pub crystal: Vec<CrystalSpec>,
}Expand description
The whole run description.
Fields§
§beam: BeamSpecThe incident beam.
materials: BTreeMap<String, MaterialSpec>Named materials, referenced by name from the target layers.
target: TargetSpecThe layered target.
physics: PhysicsSpecPhysics model choices and cutoffs.
stopping: StoppingSpecUser-supplied electronic stopping tables (optional).
run: RunSpecRun size, seed and threads.
tally: TallySpecWhat the run records.
dynamic: Option<DynamicSpec>Fluence-dependent target (optional). Absent: the static run.
crystal: Vec<CrystalSpec>Cubic crystal assignments to stack layers (optional). Absent: every layer is amorphous.
Implementations§
Source§impl Input
impl Input
Sourcepub fn resolve(&self) -> Result<Resolved, InputError>
pub fn resolve(&self) -> Result<Resolved, InputError>
Validate everything and build the engine’s inputs. Errors name the offending key.
Sourcepub fn resolve_in(&self, base_dir: &Path) -> Result<Resolved, InputError>
pub fn resolve_in(&self, base_dir: &Path) -> Result<Resolved, InputError>
Like Input::resolve, with relative [stopping] table paths taken
relative to base_dir (the directory of the input file).
Sourcepub fn resolve_with_sets(
&self,
base_dir: &Path,
sets: &[TuningSet],
) -> Result<Resolved, InputError>
pub fn resolve_with_sets( &self, base_dir: &Path, sets: &[TuningSet], ) -> Result<Resolved, InputError>
Input::resolve_in against an explicit registry of tuning sets
(tests use synthetic sets; production uses TUNING_SETS).
Source§impl Input
impl Input
Sourcepub fn from_toml_str(text: &str) -> Result<Self, InputError>
pub fn from_toml_str(text: &str) -> Result<Self, InputError>
Parse a TOML document. Schema errors (unknown or missing keys, wrong
types) are reported with the key and line; values are checked by
Input::resolve.
Sourcepub fn to_toml_string(&self) -> Result<String, InputError>
pub fn to_toml_string(&self) -> Result<String, InputError>
The input as a TOML document in the same schema Input::from_toml_str
reads: parsing the text gives back an equal Input.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Input
impl<'de> Deserialize<'de> for Input
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Input
Auto Trait Implementations§
impl Freeze for Input
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Input
impl UnwindSafe for Input
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more