pub struct SheetTracker {
pub particles: Vec<SheetParticle>,
pub shape: [usize; 3],
pub domain: Domain,
pub stream_threshold: f64,
pub particle_mass: f64,
}Expand description
Lagrangian cold dark matter sheet tracker.
Stores N³ particles on a Lagrangian grid. Each particle tracks its initial coordinate q, current position x, and velocity v. The distribution function is a sum of delta functions — a cold (zero-entropy) system.
Fields§
§particles: Vec<SheetParticle>§shape: [usize; 3]§domain: Domain§stream_threshold: f64§particle_mass: f64Implementations§
Source§impl SheetTracker
impl SheetTracker
Sourcepub fn new(domain: Domain) -> Self
pub fn new(domain: Domain) -> Self
Create a new sheet tracker with N³ particles at spatial cell centers, v = 0.
Domain spans [−L_k, L_k] in each dimension. Particles are placed at x_k = −L_k + (i_k + 0.5) * dx_k, with q = x (identity mapping).
Sourcepub fn from_zeldovich(ic: &ZeldovichIC, domain: &Domain) -> Self
pub fn from_zeldovich(ic: &ZeldovichIC, domain: &Domain) -> Self
Place one particle at each Lagrangian grid point, displaced by s(q).
Uses ZeldovichIC::displacement_field() and velocity_field() to set
x = q + s(q), v = v₀(q).
Sourcepub fn detect_caustics(&self) -> StreamCountField
pub fn detect_caustics(&self) -> StreamCountField
Detect stream crossings by counting the number of particles per spatial cell.
In a single-stream region each cell contains at most one particle. When the sheet folds (caustic formation), multiple Lagrangian elements map to the same Eulerian cell, so the count exceeds 1.
Sourcepub fn interpolate_density(&self, domain: &Domain) -> DensityField
pub fn interpolate_density(&self, domain: &Domain) -> DensityField
Cloud-in-Cell (CIC) density deposition from particle positions.
Each particle of mass particle_mass at position x is distributed
to the 8 surrounding grid nodes using trilinear weights. The result
is divided by cell volume to give density ρ(x).
Trait Implementations§
Source§impl PhaseSpaceRepr for SheetTracker
impl PhaseSpaceRepr for SheetTracker
Source§fn compute_density(&self) -> DensityField
fn compute_density(&self) -> DensityField
Source§fn advect_x(&mut self, _displacement: &DisplacementField, dt: f64)
fn advect_x(&mut self, _displacement: &DisplacementField, dt: f64)
Source§fn advect_v(&mut self, acceleration: &AccelerationField, dt: f64)
fn advect_v(&mut self, acceleration: &AccelerationField, dt: f64)
Source§fn moment(&self, position: &[f64; 3], order: usize) -> Tensor
fn moment(&self, position: &[f64; 3], order: usize) -> Tensor
Source§fn total_mass(&self) -> f64
fn total_mass(&self) -> f64
Source§fn casimir_c2(&self) -> f64
fn casimir_c2(&self) -> f64
Source§fn entropy(&self) -> f64
fn entropy(&self) -> f64
Source§fn total_kinetic_energy(&self) -> f64
fn total_kinetic_energy(&self) -> f64
Source§fn stream_count(&self) -> StreamCountField
fn stream_count(&self) -> StreamCountField
Source§fn velocity_distribution(&self, position: &[f64; 3]) -> Vec<f64>
fn velocity_distribution(&self, position: &[f64; 3]) -> Vec<f64>
Source§fn to_snapshot(&self, time: f64) -> PhaseSpaceSnapshot
fn to_snapshot(&self, time: f64) -> PhaseSpaceSnapshot
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Source§fn load_snapshot(&mut self, snap: PhaseSpaceSnapshot)
fn load_snapshot(&mut self, snap: PhaseSpaceSnapshot)
Auto Trait Implementations§
impl Freeze for SheetTracker
impl RefUnwindSafe for SheetTracker
impl Send for SheetTracker
impl Sync for SheetTracker
impl Unpin for SheetTracker
impl UnsafeUnpin for SheetTracker
impl UnwindSafe for SheetTracker
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