use std::any::Any;
use super::types::{
AccelerationField, DensityField, DisplacementField, PhaseSpaceSnapshot, StreamCountField,
Tensor,
};
pub trait PhaseSpaceRepr: Send + Sync {
fn compute_density(&self) -> DensityField;
fn advect_x(&mut self, displacement: &DisplacementField, dt: f64);
fn advect_v(&mut self, acceleration: &AccelerationField, dt: f64);
fn moment(&self, position: &[f64; 3], order: usize) -> Tensor;
fn total_mass(&self) -> f64;
fn casimir_c2(&self) -> f64;
fn entropy(&self) -> f64;
fn stream_count(&self) -> StreamCountField;
fn velocity_distribution(&self, position: &[f64; 3]) -> Vec<f64>;
fn total_kinetic_energy(&self) -> Option<f64> {
None
}
fn to_snapshot(&self, time: f64) -> Option<PhaseSpaceSnapshot> {
let _ = time;
None
}
fn load_snapshot(&mut self, snap: PhaseSpaceSnapshot) -> Result<(), crate::CausticError> {
let _ = snap;
Err(crate::CausticError::Solver(
"load_snapshot not supported by this representation".into(),
))
}
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn can_materialize(&self) -> bool {
true
}
fn memory_bytes(&self) -> usize {
0
}
fn set_progress(&mut self, _progress: std::sync::Arc<super::progress::StepProgress>) {}
}