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: SheetTrackerLagrangian sheet tracker for single-stream regions.
grid: UniformGrid6DEulerian 6D grid for multi-stream regions.
domain: DomainSimulation domain (spatial and velocity extents, boundary conditions).
stream_threshold: u32Stream count above which a cell transitions from sheet to grid mode.
mask: Vec<bool>Per spatial cell: true = grid mode (multi-stream), false = sheet mode.
Implementations§
Source§impl HybridRepr
impl HybridRepr
Sourcepub fn new(domain: Domain) -> Self
pub fn new(domain: Domain) -> Self
Create a new hybrid representation with all cells initially in sheet mode.
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
Compute density by selecting grid or sheet density per cell via the mask.
Source§fn advect_x(&mut self, displacement: &DisplacementField, dt: f64)
fn advect_x(&mut self, displacement: &DisplacementField, dt: f64)
Spatial drift: advance both sheet and grid, then update the interface mask.
Source§fn advect_v(&mut self, acceleration: &AccelerationField, dt: f64)
fn advect_v(&mut self, acceleration: &AccelerationField, dt: f64)
Velocity kick: advance both sheet and grid, then update the interface mask.
Source§fn moment(&self, position: &[f64; 3], order: usize) -> Tensor
fn moment(&self, position: &[f64; 3], order: usize) -> Tensor
Velocity moment dispatched to grid or sheet depending on the cell mask.
Source§fn total_mass(&self) -> f64
fn total_mass(&self) -> f64
Total mass summed over grid-mode and sheet-mode cells according to the mask.
Source§fn casimir_c2(&self) -> f64
fn casimir_c2(&self) -> f64
Casimir C2 invariant. Returns infinity if any cells are still in sheet mode (the sheet’s delta-function f makes C2 diverge).
Source§fn entropy(&self) -> f64
fn entropy(&self) -> f64
Entropy. Sheet cells contribute zero; grid cells contribute normally.
Source§fn stream_count(&self) -> StreamCountField
fn stream_count(&self) -> StreamCountField
Stream count derived from the sheet tracker regardless of the cell mask.
Source§fn velocity_distribution(&self, position: &[f64; 3]) -> Vec<f64>
fn velocity_distribution(&self, position: &[f64; 3]) -> Vec<f64>
Local velocity distribution dispatched to grid or sheet by cell mask.
Source§fn total_kinetic_energy(&self) -> Option<f64>
fn total_kinetic_energy(&self) -> Option<f64>
Total kinetic energy. Uses the grid in all-grid mode, otherwise the sheet.
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Downcast to &mut dyn Any for runtime type queries.
Source§fn to_snapshot(&self, time: f64) -> Option<PhaseSpaceSnapshot>
fn to_snapshot(&self, time: f64) -> Option<PhaseSpaceSnapshot>
Source§fn load_snapshot(
&mut self,
snap: PhaseSpaceSnapshot,
) -> Result<(), CausticError>
fn load_snapshot( &mut self, snap: PhaseSpaceSnapshot, ) -> Result<(), CausticError>
Source§fn can_materialize(&self) -> bool
fn can_materialize(&self) -> bool
Source§fn memory_bytes(&self) -> usize
fn memory_bytes(&self) -> usize
Source§fn set_progress(&mut self, _progress: Arc<StepProgress>)
fn set_progress(&mut self, _progress: Arc<StepProgress>)
StepProgress::set_intra_progress.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
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