Skip to main content

CompositionGrid

Struct CompositionGrid 

Source
pub struct CompositionGrid { /* private fields */ }
Expand description

A finite-slab target with per-slab species inventories, an optional immutable substrate, and a Relaxation convention.

Implementations§

Source§

impl CompositionGrid

Source

pub fn from_stack( stack: &Stack, relaxation: Relaxation, ) -> Result<Self, DynamicError>

Build from a Stack: finite layers become slabs (inventory n_i * thickness, thicknesses kept as given), and a semi-infinite last layer becomes the immutable substrate.

Source

pub fn has_substrate(&self) -> bool

Whether an immutable substrate backs the slabs.

Source

pub fn n_slabs(&self) -> usize

Number of mutable slabs.

Source

pub fn relaxation(&self) -> &Relaxation

The relaxation convention in use.

Source

pub fn thicknesses_m(&self) -> Vec<f64>

Slab thicknesses in m, front first.

Source

pub fn inventory(&self, slab: usize) -> Option<Vec<(u8, f64)>>

Inventory of one slab as (Z, atoms/m^2) sorted by Z.

Source

pub fn seed_energies( &mut self, z: u8, e_d_ev: Option<f64>, e_b_ev: Option<f64>, e_s_ev: Option<f64>, )

Record energies for element z in every slab, for the case that z is (or later becomes) present: only the values that are still unset are filled, so explicit values and defaults already in place are kept. This is how an element that only enters through implantation or recoil mixing (the beam species, a substrate element) gets the displacement, lattice-binding and surface-binding energies the engine requires of every element in a layer.

Source

pub fn total_inventory(&self, z: u8) -> f64

Total areal inventory of element z over all finite slabs, atoms/m². The substrate is not counted. Summed front to back.

Source

pub fn relax(&mut self) -> Result<UpdateOutcome, DynamicError>

Re-relax without changing any inventory; same as apply(&[]).

Source

pub fn apply( &mut self, deltas: &[InventoryDelta], ) -> Result<UpdateOutcome, DynamicError>

Apply inventory deltas, then relax every slab. Transactional: on error the grid is unchanged. See the module docs.

Source

pub fn to_stack(&self) -> Result<Stack, DynamicError>

Convert to the engine’s layer model: contiguous finite layers from the front surface, then the substrate if any.

Trait Implementations§

Source§

impl Clone for CompositionGrid

Source§

fn clone(&self) -> CompositionGrid

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CompositionGrid

Source§

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

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

impl PartialEq for CompositionGrid

Source§

fn eq(&self, other: &CompositionGrid) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CompositionGrid

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
§

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

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

§

fn vzip(self) -> V