pub struct SphBufferLayout {
pub n_particles: usize,
pub position_size: usize,
pub velocity_size: usize,
pub mass_size: usize,
pub density_size: usize,
pub pressure_size: usize,
pub force_size: usize,
}Expand description
Describes the buffer layout for SPH simulation data.
Fields§
§n_particles: usizeNumber of particles.
position_size: usizeSize of position buffer (3 * n_particles).
velocity_size: usizeSize of velocity buffer (3 * n_particles).
mass_size: usizeSize of mass buffer (n_particles).
density_size: usizeSize of density buffer (n_particles).
pressure_size: usizeSize of pressure buffer (n_particles).
force_size: usizeSize of force buffer (3 * n_particles).
Implementations§
Source§impl SphBufferLayout
impl SphBufferLayout
Sourcepub fn new(n_particles: usize) -> Self
pub fn new(n_particles: usize) -> Self
Create a buffer layout for the given number of particles.
Sourcepub fn total_elements(&self) -> usize
pub fn total_elements(&self) -> usize
Total number of f64 elements needed across all buffers.
Sourcepub fn total_bytes(&self) -> usize
pub fn total_bytes(&self) -> usize
Total memory in bytes (f64 = 8 bytes).
Auto Trait Implementations§
impl Freeze for SphBufferLayout
impl RefUnwindSafe for SphBufferLayout
impl Send for SphBufferLayout
impl Sync for SphBufferLayout
impl Unpin for SphBufferLayout
impl UnsafeUnpin for SphBufferLayout
impl UnwindSafe for SphBufferLayout
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