Skip to main content

DynamicRun

Struct DynamicRun 

Source
pub struct DynamicRun<'a> { /* private fields */ }
Expand description

A fluence-stepped run. See the module docs.

Implementations§

Source§

impl<'a> DynamicRun<'a>

Source

pub fn new( grid: CompositionGrid, beam: Beam, config: BcaConfig, stopping: &'a (dyn ElectronicStopping + Sync), table: &'a ScatteringTable, cfg: DynamicConfig, ) -> Result<Self, DynamicRunError>

Set up a run of beam.count primaries on grid.

Source

pub fn with_retention( self, limits: impl IntoIterator<Item = (u8, f64)>, ) -> Result<Self, DynamicRunError>

Set the retention limits (see the module docs, “Retention limit”): for each (Z, f) the largest atomic fraction f, with 0 < f < 1, of element Z a slab may hold. Replaces any earlier limits; an empty map switches the model off (the default).

Source

pub fn re_emitted_m2(&self) -> &BTreeMap<u8, f64>

Atoms/m² re-emitted by the retention limit over the accepted steps, by atomic number.

Source

pub fn grid(&self) -> &CompositionGrid

The current target.

Source

pub fn ions_done(&self) -> u64

Primaries used so far (accepted steps only).

Source

pub fn ions_total(&self) -> u64

Total primaries of the run.

Source

pub fn fluence_done_m2(&self) -> f64

Fluence delivered so far, ions/m².

Source

pub fn fluence_per_ion_m2(&self) -> f64

Fluence one primary stands for, ions/m².

Source

pub fn steps_done(&self) -> u64

Accepted steps so far.

Source

pub fn cumulative(&self) -> &Yields

Event counts summed over the accepted steps.

Source

pub fn recession_m(&self) -> f64

Cumulative surface recession of the accepted steps, m (0 with erosion off).

Source

pub fn step(&mut self) -> Result<Option<StepRecord>, DynamicRunError>

Run the next step. Ok(None) when all primaries are used. On error the grid and the run state are unchanged.

Source

pub fn run_all( &mut self, on_step: impl FnMut(&StepRecord, &CompositionGrid), ) -> Result<(), DynamicRunError>

Run all remaining steps, calling on_step after each accepted step.

Trait Implementations§

Source§

impl Debug for DynamicRun<'_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for DynamicRun<'a>

§

impl<'a> !UnwindSafe for DynamicRun<'a>

§

impl<'a> Freeze for DynamicRun<'a>

§

impl<'a> Send for DynamicRun<'a>

§

impl<'a> Sync for DynamicRun<'a>

§

impl<'a> Unpin for DynamicRun<'a>

§

impl<'a> UnsafeUnpin for DynamicRun<'a>

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

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

§

fn vzip(self) -> V