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.
Requires rand crate for Gaussian random field generation.
Use ZeldovichSingleMode for single-mode validation tests.
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) = H·f·s (growing mode).
Requires displacement_field which needs rand crate.
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).
Requires velocity_field which needs rand crate.
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
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