pub struct LayerStackResidual {
ks: Vec<[Complex; 2]>,
q: Vec<[f64; 2]>,
thickness: Vec<f64>,
channels: Vec<Channel>,
fixed_q: bool,
}Expand description
What layer_stack saves for its pullback: the solves of every transverse
wavevector, each on its own, without a dense matrix over all of them.
The pullback adds the medium and thickness gradients of all wavevectors in chunks of
consecutive wavevectors fixed by their count, and the chunk sums in chunk order
(numerics::parallel::try_fold_ordered), so the thread count does not change them.
Each q gradient belongs to one wavevector, which writes it in place.
Fields§
§ks: Vec<[Complex; 2]>§q: Vec<[f64; 2]>§thickness: Vec<f64>§channels: Vec<Channel>§fixed_q: boolImplementations§
Source§impl LayerStackResidual
impl LayerStackResidual
Sourcepub fn medium_count(&self) -> usize
pub fn medium_count(&self) -> usize
Number of media, including the exterior half-spaces.
Sourcepub fn channel_count(&self) -> usize
pub fn channel_count(&self) -> usize
Number of independent transverse channels.
Trait Implementations§
Source§impl Debug for LayerStackResidual
impl Debug for LayerStackResidual
Source§impl SavedState for LayerStackResidual
impl SavedState for LayerStackResidual
Auto Trait Implementations§
impl Freeze for LayerStackResidual
impl RefUnwindSafe for LayerStackResidual
impl Send for LayerStackResidual
impl Sync for LayerStackResidual
impl Unpin for LayerStackResidual
impl UnwindSafe for LayerStackResidual
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
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.