pub struct FftIsolated {
pub shape: [usize; 3],
pub dx: [f64; 3],
/* private fields */
}use VgfPoisson for isolated BC; FftIsolated will be removed in a future release
Expand description
Isolated-boundary-condition Poisson solver using the Hockney-Eastwood zero-padding method.
Embeds the N^3 density field into a (2N)^3 periodic box, convolves with the precomputed Fourier-space free-space Green’s function G(r) = -1/(4pir), and extracts the N^3 interior to obtain the potential with correct vacuum boundary conditions. O(N^3 log N).
FFT plans and the Green’s function FFT are precomputed at construction time for the (2N)^3 grid. Acceleration is computed via second-order finite differences (not spectral).
Deprecated: Prefer VgfPoisson which provides
spectral-accuracy isolated boundary conditions with lower memory overhead.
Fields§
§shape: [usize; 3]use VgfPoisson for isolated BC; FftIsolated will be removed in a future release
Number of grid cells along each spatial axis [nx, ny, nz] (physical grid, not padded).
dx: [f64; 3]use VgfPoisson for isolated BC; FftIsolated will be removed in a future release
Grid spacing along each spatial axis [dx, dy, dz].
Implementations§
Source§impl FftIsolated
impl FftIsolated
Sourcepub fn new(domain: &Domain) -> Self
pub fn new(domain: &Domain) -> Self
Create a new isolated-BC Poisson solver, precomputing FFT plans and the Green’s function.
Builds the free-space Green’s function G(r) = -1/(4pir) on the (2N)^3 padded grid
with minimum-image wrapping, then forward-transforms it for reuse in every solve() call.
Trait Implementations§
Source§impl PoissonSolver for FftIsolated
impl PoissonSolver for FftIsolated
Source§fn solve(&self, density: &DensityField, g: f64) -> PotentialField
fn solve(&self, density: &DensityField, g: f64) -> PotentialField
Solve nabla^2 Phi = 4piG*rho with isolated BC via Hockney-Eastwood convolution.
Zero-pads rho into (2N)^3, forward-FFTs, multiplies pointwise with the cached Green’s function, inverse-FFTs, and extracts the N^3 physical sub-grid.
Source§fn compute_acceleration(&self, potential: &PotentialField) -> AccelerationField
fn compute_acceleration(&self, potential: &PotentialField) -> AccelerationField
Compute gravitational acceleration via second-order centered finite differences.
Source§fn set_progress(&mut self, p: Arc<StepProgress>)
fn set_progress(&mut self, p: Arc<StepProgress>)
Auto Trait Implementations§
impl !Freeze for FftIsolated
impl !RefUnwindSafe for FftIsolated
impl Send for FftIsolated
impl Sync for FftIsolated
impl Unpin for FftIsolated
impl UnsafeUnpin for FftIsolated
impl !UnwindSafe for FftIsolated
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> 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>
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