pub struct MultipoleExpansion {
pub l_max: usize,
pub dx: [f64; 3],
pub shape: [usize; 3],
}Expand description
Multipole expansion calculator for computing far-field boundary conditions.
Fields§
§l_max: usizeMaximum angular momentum quantum number.
dx: [f64; 3]Grid spacing.
shape: [usize; 3]Grid shape.
Implementations§
Source§impl MultipoleExpansion
impl MultipoleExpansion
Sourcepub fn new(shape: [usize; 3], dx: [f64; 3], l_max: usize) -> Self
pub fn new(shape: [usize; 3], dx: [f64; 3], l_max: usize) -> Self
Create a multipole expansion calculator for the given grid geometry.
Sourcepub fn compute_moments(
&self,
density: &DensityField,
g: f64,
) -> Vec<(usize, i32, f64)>
pub fn compute_moments( &self, density: &DensityField, g: f64, ) -> Vec<(usize, i32, f64)>
Compute multipole moments q_lm from the density field.
q_lm = integral rho(x) * r^l * Y_lm(theta, phi) * dx^3
Returns moments indexed as [(l, m)] for l=0..l_max, m=-l..l.
Sourcepub fn evaluate_potential(
&self,
moments: &[(usize, i32, f64)],
x: f64,
y: f64,
z: f64,
g: f64,
) -> f64
pub fn evaluate_potential( &self, moments: &[(usize, i32, f64)], x: f64, y: f64, z: f64, g: f64, ) -> f64
Evaluate the multipole potential at a point (x, y, z).
Sourcepub fn compute_boundary_values(
&self,
density: &DensityField,
g: f64,
) -> BoundaryValues
pub fn compute_boundary_values( &self, density: &DensityField, g: f64, ) -> BoundaryValues
Compute boundary values from multipole expansion.
Auto Trait Implementations§
impl Freeze for MultipoleExpansion
impl RefUnwindSafe for MultipoleExpansion
impl Send for MultipoleExpansion
impl Sync for MultipoleExpansion
impl Unpin for MultipoleExpansion
impl UnsafeUnpin for MultipoleExpansion
impl UnwindSafe for MultipoleExpansion
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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