pub struct SphereClusterResidual {
k0: f64,
positions: Vec<[f64; 3]>,
plan: TranslationPlan,
spheres: Vec<SphereResidual>,
interaction: InteractionResidual,
}Expand description
What sphere_cluster saves for its pullback: the Mie residual of each sphere,
the translation plan between two spheres, the positions and the interaction solve.
Fields§
§k0: f64§positions: Vec<[f64; 3]>§plan: TranslationPlan§spheres: Vec<SphereResidual>§interaction: InteractionResidualImplementations§
Source§impl SphereClusterResidual
impl SphereClusterResidual
Sourcepub fn state_size(lmax: usize, particles: usize) -> Result<usize>
pub fn state_size(lmax: usize, particles: usize) -> Result<usize>
Byte count for a cluster’s saved numerical state, from its static layout.
Sourcepub const fn value(&self) -> &DMatrix<Complex>
pub const fn value(&self) -> &DMatrix<Complex>
Interacting T-matrix in the local multipole bases.
Sourcepub fn pushforward(
&self,
k0: f64,
radii: &[f64],
epsilon: &[Complex],
positions: &[[f64; 3]],
) -> Result<DMatrix<Complex>>
pub fn pushforward( &self, k0: f64, radii: &[f64], epsilon: &[Complex], positions: &[[f64; 3]], ) -> Result<DMatrix<Complex>>
Directional derivative for vacuum wavenumber, radii, permittivities and positions. Particle and translation tangents feed one solve with the saved LU.
Sourcepub fn pullback(
&self,
cotangent: &DMatrix<Complex>,
) -> Result<SphereClusterGradient>
pub fn pullback( &self, cotangent: &DMatrix<Complex>, ) -> Result<SphereClusterGradient>
Gradients of k0, the radii, the permittivities and the positions from
cotangent, the gradient of a real loss with respect to the interacting T-matrix.
The spheres run in parallel; their gradients add in sphere order, so the Rayon
pool does not change them. The LU solve and the matrix products of
InteractionResidual::pullback_blocks run in faer with the worker count of
linalg.
Trait Implementations§
Source§impl Clone for SphereClusterResidual
impl Clone for SphereClusterResidual
Source§fn clone(&self) -> SphereClusterResidual
fn clone(&self) -> SphereClusterResidual
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SphereClusterResidual
impl Debug for SphereClusterResidual
Source§impl SavedState for SphereClusterResidual
impl SavedState for SphereClusterResidual
Auto Trait Implementations§
impl Freeze for SphereClusterResidual
impl RefUnwindSafe for SphereClusterResidual
impl Send for SphereClusterResidual
impl Sync for SphereClusterResidual
impl Unpin for SphereClusterResidual
impl UnwindSafe for SphereClusterResidual
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> 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§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.