pub struct Stack { /* private fields */ }Expand description
A 1D layered target: finite layers front to back, optionally ending in a semi-infinite substrate.
Implementations§
Source§impl Stack
impl Stack
Sourcepub fn new(
layers: Vec<(Material, f64)>,
substrate: Option<Material>,
) -> Result<Self, GeometryError>
pub fn new( layers: Vec<(Material, f64)>, substrate: Option<Material>, ) -> Result<Self, GeometryError>
Build from (material, thickness in m) pairs, front first, and an
optional semi-infinite substrate behind them.
Sourcepub fn semi_infinite(material: Material) -> Self
pub fn semi_infinite(material: Material) -> Self
A single semi-infinite material.
Sourcepub fn back_face_m(&self) -> Option<f64>
pub fn back_face_m(&self) -> Option<f64>
Depth of the back face, m, or None if the last layer is semi-infinite.
Trait Implementations§
Source§impl Geometry for Stack
impl Geometry for Stack
Source§fn material_index(&self, region: usize) -> usize
fn material_index(&self, region: usize) -> usize
Each layer is its own material entry, so layer data is cached per layer.
Source§fn as_stack(&self) -> Option<&Stack>
fn as_stack(&self) -> Option<&Stack>
This geometry as a layered
Stack, if it is one. Tallies defined
per layer (dose, depth-dose, interface transmission) need it.Source§fn n_materials(&self) -> usize
fn n_materials(&self) -> usize
Number of distinct materials.
Source§fn locate(&self, pos: [f64; 3]) -> Option<usize>
fn locate(&self, pos: [f64; 3]) -> Option<usize>
The region containing
pos, or None outside the target (or for a
non-finite position). Ownership of shared faces: see the module docs.Source§fn entry_point(&self) -> [f64; 3]
fn entry_point(&self) -> [f64; 3]
Source§fn exit(
&self,
region: usize,
pos: [f64; 3],
dir: [f64; 3],
limit: f64,
) -> Option<Exit>
fn exit( &self, region: usize, pos: [f64; 3], dir: [f64; 3], limit: f64, ) -> Option<Exit>
The first event along the straight flight from
pos (inside region,
or on one of its faces) in the unit direction dir, if it happens at
a path length of at most limit; otherwise None. The event is a
change of material, a periodic wrap, or leaving the target. Read moreSource§fn in_vacuum(&self, pos: [f64; 3]) -> bool
fn in_vacuum(&self, pos: [f64; 3]) -> bool
Whether
pos lies outside the target in vacuum, used to skip weak-
collision partners that would lie beyond a surface. For a Stack
this is in front of the front face only (as in the M0 engine).Source§fn flight(
&self,
region: usize,
pos: [f64; 3],
dir: [f64; 3],
limit: f64,
) -> Flight
fn flight( &self, region: usize, pos: [f64; 3], dir: [f64; 3], limit: f64, ) -> Flight
Geometry::exit, also reporting the region the flight ends in when
there is no event, so a transport engine can keep its particle’s
region consistent with its position after crossing same-material
faces. The default suits a geometry whose regions are each a whole
material run along every flight (a Stack, where leaving a layer is
always an event): without an event the region is unchanged.impl StructuralPartialEq for Stack
Auto Trait Implementations§
impl Freeze for Stack
impl RefUnwindSafe for Stack
impl Send for Stack
impl Sync for Stack
impl Unpin for Stack
impl UnsafeUnpin for Stack
impl UnwindSafe for Stack
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
Mutably borrows from an owned value. Read more
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> ⓘ
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 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> ⓘ
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