pub struct Simulation {Show 18 fields
pub domain: Domain,
pub repr: Box<dyn PhaseSpaceRepr>,
pub poisson: Box<dyn PoissonSolver>,
pub advector: Box<dyn Advector>,
pub integrator: Box<dyn TimeIntegrator>,
pub diagnostics: Diagnostics,
pub io: IOManager,
pub exit_evaluator: ExitEvaluator,
pub opts: OptionalParams,
pub lomac: Option<LoMaC>,
pub g: f64,
pub time: f64,
pub step: u64,
pub start_time: Instant,
pub last_step_timings: StepTimings,
pub cached_density: Option<DensityField>,
pub cached_potential: Option<PotentialField>,
pub cached_acceleration: Option<AccelerationField>,
/* private fields */
}Expand description
The top-level simulation object. Owns all solver components.
Fields§
§domain: Domain§repr: Box<dyn PhaseSpaceRepr>§poisson: Box<dyn PoissonSolver>§advector: Box<dyn Advector>§integrator: Box<dyn TimeIntegrator>§diagnostics: Diagnostics§io: IOManager§exit_evaluator: ExitEvaluator§opts: OptionalParams§lomac: Option<LoMaC>Optional LoMaC conservation framework. When active, projects the distribution function after each time step to restore exact local conservation of mass, momentum, and energy.
g: f64§time: f64§step: u64§start_time: Instant§last_step_timings: StepTimingsPer-step phase timing breakdown from the most recent step() call.
Includes integrator sub-step timings + post-advance diagnostics timing.
cached_density: Option<DensityField>Cached density from the most recent step, for TUI reuse.
cached_potential: Option<PotentialField>Cached potential from the most recent step, for TUI reuse.
cached_acceleration: Option<AccelerationField>Cached acceleration from the most recent step, for TUI reuse.
Implementations§
Source§impl Simulation
impl Simulation
Sourcepub fn run(&mut self) -> Result<ExitPackage>
pub fn run(&mut self) -> Result<ExitPackage>
Run the simulation to completion and return the exit package.
Sourcepub fn step(&mut self) -> Result<Option<ExitReason>>
pub fn step(&mut self) -> Result<Option<ExitReason>>
Advance by a single timestep. Returns Some(reason) if the simulation should stop.
Sourcepub fn set_progress(&mut self, p: Arc<StepProgress>)
pub fn set_progress(&mut self, p: Arc<StepProgress>)
Attach shared progress state for intra-step TUI visibility. Propagates to the integrator so sub-step phases are reported.
Sourcepub fn current_time(&self) -> f64
pub fn current_time(&self) -> f64
Current simulation time.
Auto Trait Implementations§
impl Freeze for Simulation
impl !RefUnwindSafe for Simulation
impl !Send for Simulation
impl !Sync for Simulation
impl Unpin for Simulation
impl UnsafeUnpin for Simulation
impl !UnwindSafe for Simulation
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