pub struct SphDispatchConfig {
pub n_particles: usize,
pub h: f64,
pub mu: f64,
pub k_eos: f64,
pub rho0: f64,
pub workgroup_size: u32,
}Expand description
Configuration for dispatching SPH compute kernels.
Fields§
§n_particles: usizeNumber of particles.
h: f64Smoothing length.
mu: f64Viscosity coefficient.
k_eos: f64Equation of state stiffness (for pressure from density).
rho0: f64Rest density.
workgroup_size: u32Workgroup size for GPU dispatch.
Implementations§
Source§impl SphDispatchConfig
impl SphDispatchConfig
Sourcepub fn new(n_particles: usize, h: f64) -> Self
pub fn new(n_particles: usize, h: f64) -> Self
Create a new dispatch config with default viscosity and EOS parameters.
Sourcepub fn pressure_from_density(&self, rho: f64) -> f64
pub fn pressure_from_density(&self, rho: f64) -> f64
Compute pressure from density using a simple EOS: p = k * (rho - rho0).
Sourcepub fn num_workgroups(&self) -> u32
pub fn num_workgroups(&self) -> u32
Number of workgroups needed.
Auto Trait Implementations§
impl Freeze for SphDispatchConfig
impl RefUnwindSafe for SphDispatchConfig
impl Send for SphDispatchConfig
impl Sync for SphDispatchConfig
impl Unpin for SphDispatchConfig
impl UnsafeUnpin for SphDispatchConfig
impl UnwindSafe for SphDispatchConfig
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