pub struct HybridRepr {
pub sheet: SheetTracker,
pub grid: UniformGrid6D,
pub domain: Domain,
pub stream_threshold: u32,
pub mask: Vec<bool>,
}Expand description
Hybrid representation combining SheetTracker and UniformGrid6D.
Single-stream regions (stream_count ≤ threshold) are tracked by the Lagrangian sheet (exact characteristics, zero diffusion). Multi-stream regions are handled by the Eulerian 6D grid (captures velocity dispersion).
The mask vector marks each spatial cell: true = grid mode, false = sheet mode.
Fields§
§sheet: SheetTracker§grid: UniformGrid6D§domain: Domain§stream_threshold: u32§mask: Vec<bool>Per spatial cell: true = grid mode (multi-stream), false = sheet mode.
Implementations§
Source§impl HybridRepr
impl HybridRepr
pub fn new(domain: Domain) -> Self
Sourcepub fn update_interface(&mut self)
pub fn update_interface(&mut self)
Transfer particles from SheetTracker to grid where stream_count > stream_threshold.
For each spatial cell where the stream count exceeds the threshold and is not yet in grid mode: deposit the sheet particles into the 6D grid via CIC and mark the cell as grid mode.
Trait Implementations§
Source§impl PhaseSpaceRepr for HybridRepr
impl PhaseSpaceRepr for HybridRepr
Source§fn compute_density(&self) -> DensityField
fn compute_density(&self) -> DensityField
Integrate f over all velocities: ρ(x) = ∫f dv³.
This is the coupling moment to the Poisson equation.
Source§fn advect_x(&mut self, displacement: &DisplacementField, dt: f64)
fn advect_x(&mut self, displacement: &DisplacementField, dt: f64)
Drift sub-step: advect f in spatial coordinates by displacement Δx = v·dt.
Pure translation in x at constant v.
Source§fn advect_v(&mut self, acceleration: &AccelerationField, dt: f64)
fn advect_v(&mut self, acceleration: &AccelerationField, dt: f64)
Kick sub-step: advect f in velocity coordinates by Δv = g·dt.
Pure translation in v at constant x.
Source§fn moment(&self, position: &[f64; 3], order: usize) -> Tensor
fn moment(&self, position: &[f64; 3], order: usize) -> Tensor
Compute velocity moment of order n at given spatial position.
Order 0 = density, 1 = mean velocity, 2 = dispersion tensor.
Source§fn total_mass(&self) -> f64
fn total_mass(&self) -> f64
Total mass M = ∫f dx³dv³. Should be conserved to machine precision.
Source§fn casimir_c2(&self) -> f64
fn casimir_c2(&self) -> f64
Casimir invariant C₂ = ∫f² dx³dv³.
Increase over time indicates numerical diffusion.
Source§fn entropy(&self) -> f64
fn entropy(&self) -> f64
Boltzmann entropy S = −∫f ln f dx³dv³.
Should be exactly conserved; growth = numerical error.
Source§fn stream_count(&self) -> StreamCountField
fn stream_count(&self) -> StreamCountField
Number of distinct velocity streams at each spatial point.
Detects caustic surfaces (sheet folds).
Source§fn velocity_distribution(&self, position: &[f64; 3]) -> Vec<f64>
fn velocity_distribution(&self, position: &[f64; 3]) -> Vec<f64>
Extract the local velocity distribution f(v|x) at a given spatial position.
Used for dark matter detection predictions.
Source§fn total_kinetic_energy(&self) -> f64
fn total_kinetic_energy(&self) -> f64
Total kinetic energy T = ½∫fv² dx³dv³.
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Downcast to concrete type for implementation-specific queries (e.g. HT rank data).
Source§fn to_snapshot(&self, time: f64) -> PhaseSpaceSnapshot
fn to_snapshot(&self, time: f64) -> PhaseSpaceSnapshot
Extract a full 6D snapshot of the current state.
Source§fn load_snapshot(&mut self, snap: PhaseSpaceSnapshot)
fn load_snapshot(&mut self, snap: PhaseSpaceSnapshot)
Replace the current state with data from a dense 6D snapshot. Read more
Auto Trait Implementations§
impl Freeze for HybridRepr
impl RefUnwindSafe for HybridRepr
impl Send for HybridRepr
impl Sync for HybridRepr
impl Unpin for HybridRepr
impl UnsafeUnpin for HybridRepr
impl UnwindSafe for HybridRepr
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