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
impl CompositionGrid
Sourcepub fn from_stack(
stack: &Stack,
relaxation: Relaxation,
) -> Result<Self, DynamicError>
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.
Sourcepub fn has_substrate(&self) -> bool
pub fn has_substrate(&self) -> bool
Whether an immutable substrate backs the slabs.
Sourcepub fn relaxation(&self) -> &Relaxation
pub fn relaxation(&self) -> &Relaxation
The relaxation convention in use.
Sourcepub fn thicknesses_m(&self) -> Vec<f64>
pub fn thicknesses_m(&self) -> Vec<f64>
Slab thicknesses in m, front first.
Sourcepub fn inventory(&self, slab: usize) -> Option<Vec<(u8, f64)>>
pub fn inventory(&self, slab: usize) -> Option<Vec<(u8, f64)>>
Inventory of one slab as (Z, atoms/m^2) sorted by Z.
Sourcepub fn seed_energies(
&mut self,
z: u8,
e_d_ev: Option<f64>,
e_b_ev: Option<f64>,
e_s_ev: Option<f64>,
)
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.
Sourcepub fn total_inventory(&self, z: u8) -> f64
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.
Sourcepub fn relax(&mut self) -> Result<UpdateOutcome, DynamicError>
pub fn relax(&mut self) -> Result<UpdateOutcome, DynamicError>
Re-relax without changing any inventory; same as apply(&[]).
Sourcepub fn apply(
&mut self,
deltas: &[InventoryDelta],
) -> Result<UpdateOutcome, DynamicError>
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.
Sourcepub fn to_stack(&self) -> Result<Stack, DynamicError>
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
impl Clone for CompositionGrid
Source§fn clone(&self) -> CompositionGrid
fn clone(&self) -> CompositionGrid
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompositionGrid
impl Debug for CompositionGrid
Source§impl PartialEq for CompositionGrid
impl PartialEq for CompositionGrid
impl StructuralPartialEq for CompositionGrid
Auto Trait Implementations§
impl Freeze for CompositionGrid
impl RefUnwindSafe for CompositionGrid
impl Send for CompositionGrid
impl Sync for CompositionGrid
impl Unpin for CompositionGrid
impl UnsafeUnpin for CompositionGrid
impl UnwindSafe for CompositionGrid
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,
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