pub struct CylinderResidual {
blocks: Vec<Block>,
solves: Vec<MieCylResidual>,
kz_count: usize,
boundaries: usize,
}Expand description
What cylinder saves for its pullback: one boundary solve per (kz, m) pair,
shared with the mirror pair (-kz, -m) when both are requested.
Fields§
§blocks: Vec<Block>§solves: Vec<MieCylResidual>§kz_count: usize§boundaries: usizeImplementations§
Source§impl CylinderResidual
impl CylinderResidual
Sourcepub const fn input_counts(&self) -> (usize, usize)
pub const fn input_counts(&self) -> (usize, usize)
The counts of recorded axial wavenumbers and layer boundaries.
Sourcepub fn shape(&self) -> (usize, usize)
pub fn shape(&self) -> (usize, usize)
The shape of the T-matrix: two helicities for each (kz, m) block.
Sourcepub fn pushforward(
&self,
kzs: &[f64],
k0: f64,
radii: &[f64],
materials: &[Material],
) -> Result<DMatrix<Complex>>
pub fn pushforward( &self, kzs: &[f64], k0: f64, radii: &[f64], materials: &[Material], ) -> Result<DMatrix<Complex>>
The T-matrix tangent along changes of the axial wavenumbers, k0, radii and
materials. Material entries store changes of epsilon, mu and kappa.
Mirror blocks reuse their cached solve, with the sign of their own kz
direction reversed; their axial directions need not preserve the symmetry.
Sourcepub fn pullback(&self, cotangent: &DMatrix<Complex>) -> Result<CylinderGradient>
pub fn pullback(&self, cotangent: &DMatrix<Complex>) -> Result<CylinderGradient>
Gradients of kzs, k0, the radii and the materials from cotangent, the
gradient of a real loss with respect to the T-matrix.
The blocks run in parallel and their gradients add in block order, so the Rayon pool does not change them.
Trait Implementations§
Source§impl Debug for CylinderResidual
impl Debug for CylinderResidual
Source§impl SavedState for CylinderResidual
impl SavedState for CylinderResidual
Auto Trait Implementations§
impl Freeze for CylinderResidual
impl RefUnwindSafe for CylinderResidual
impl Send for CylinderResidual
impl Sync for CylinderResidual
impl Unpin for CylinderResidual
impl UnwindSafe for CylinderResidual
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
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§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>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.