pub struct ZeldovichIC {
pub mean_density: f64,
pub h0: f64,
pub omega_m: f64,
pub omega_lambda: f64,
pub scale_factor_init: f64,
pub random_seed: u64,
}Expand description
Zel’dovich pancake IC: cold dark matter sheet. f(x,v,t₀) = ρ̄·δ³(v − v₀(x)) where v₀ is the Zel’dovich velocity field.
Fields§
§mean_density: f64§h0: f64§omega_m: f64§omega_lambda: f64§scale_factor_init: f64§random_seed: u64Implementations§
Source§impl ZeldovichIC
impl ZeldovichIC
pub fn new(mean_density: f64, cosmology: CosmologyParams, seed: u64) -> Self
Sourcepub fn new_single_mode(
mean_density: f64,
amplitude: f64,
wavenumber: f64,
sigma_v: f64,
) -> ZeldovichSingleMode
pub fn new_single_mode( mean_density: f64, amplitude: f64, wavenumber: f64, sigma_v: f64, ) -> ZeldovichSingleMode
Create a simple single-mode Zel’dovich pancake for testing.
v₀(x) = -A·sin(k·x₁) f(x,v) = (ρ̄/S) · exp(-(v - v₀(x))² / (2σ_v²))
where S normalises the Gaussian to unity over velocity space.
Sourcepub fn displacement_field(&self, domain: &Domain) -> [Vec<f64>; 3]
pub fn displacement_field(&self, domain: &Domain) -> [Vec<f64>; 3]
Generate the Zel’dovich displacement field s(q) from P(k) via FFT.
Uses Xorshift64 RNG with Box-Muller transform for Gaussian random
field generation in Fourier space, then IFFT to real space.
Sourcepub fn velocity_field(&self, domain: &Domain) -> [Vec<f64>; 3]
pub fn velocity_field(&self, domain: &Domain) -> [Vec<f64>; 3]
Zel’dovich velocity v₀(q) = a·H(a)·f(a)·s(q) (growing mode).
f(a) ≈ Ω_m(a)^{0.55} is the logarithmic growth rate.
Sourcepub fn sample_on_grid(&self, domain: &Domain) -> PhaseSpaceSnapshot
pub fn sample_on_grid(&self, domain: &Domain) -> PhaseSpaceSnapshot
Sample onto 6D grid as a thin Gaussian in velocity centred on v₀(x).
f(x,v) = ρ̄ / ((2π)^{3/2} σ_v³) · exp(-|v - v₀(x)|² / (2σ_v²)) where σ_v = 0.3 · max(Δv) keeps the distribution cold but resolved.
Auto Trait Implementations§
impl Freeze for ZeldovichIC
impl RefUnwindSafe for ZeldovichIC
impl Send for ZeldovichIC
impl Sync for ZeldovichIC
impl Unpin for ZeldovichIC
impl UnsafeUnpin for ZeldovichIC
impl UnwindSafe for ZeldovichIC
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