pub struct SphSimulation {
pub config: SphConfig,
pub state: SphParticleState,
pub time: f64,
/* private fields */
}Expand description
SPH simulation that dispatches compute to GPU when available.
Fields§
§config: SphConfigConfiguration (immutable after construction).
state: SphParticleStateParticle state.
time: f64Total elapsed simulation time.
Implementations§
Source§impl SphSimulation
impl SphSimulation
Sourcepub fn step(&mut self, dt: f64)
pub fn step(&mut self, dt: f64)
Advance the simulation by dt seconds.
Steps:
- Density summation (GPU or CPU)
- Pressure update (Tait EOS)
- Pressure + viscosity acceleration
- Velocity + position integration (symplectic Euler)
- Boundary reflection
Sourcepub fn kinetic_energy(&self) -> f64
pub fn kinetic_energy(&self) -> f64
Compute total kinetic energy (J) across all particles.
Sourcepub fn mean_density(&self) -> f64
pub fn mean_density(&self) -> f64
Mean density across all particles.
Auto Trait Implementations§
impl Freeze for SphSimulation
impl RefUnwindSafe for SphSimulation
impl Send for SphSimulation
impl Sync for SphSimulation
impl Unpin for SphSimulation
impl UnsafeUnpin for SphSimulation
impl UnwindSafe for SphSimulation
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> 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