pub struct LBMGpuKernels {
pub f: FluidGpuBuffer,
pub collision: LBMCollisionKernelSpec,
pub streaming: LBMStreamingSpec,
pub boundary: LBMBoundaryKernelSpec,
}Expand description
GPU kernel manager for a Lattice Boltzmann Method simulation.
Stores distribution functions for all cells in a ping-pong buffer and exposes collision, streaming, and boundary dispatch methods.
Fields§
§f: FluidGpuBufferDouble-buffered distribution functions: Q components per cell.
collision: LBMCollisionKernelSpecCollision kernel specification.
streaming: LBMStreamingSpecStreaming kernel specification.
boundary: LBMBoundaryKernelSpecBoundary kernel specification.
Implementations§
Source§impl LBMGpuKernels
impl LBMGpuKernels
Sourcepub fn new(
nx: usize,
ny: usize,
nz: usize,
tau: f64,
periodic: bool,
solid_cells: Vec<usize>,
) -> Self
pub fn new( nx: usize, ny: usize, nz: usize, tau: f64, periodic: bool, solid_cells: Vec<usize>, ) -> Self
Create a new LBM kernel manager.
Initialises distribution functions to the equilibrium for ρ = 1, u = 0.
Sourcepub fn dispatch_collision(&mut self)
pub fn dispatch_collision(&mut self)
Execute one BGK collision step (CPU mock).
Updates each cell’s distribution functions toward local equilibrium.
Sourcepub fn dispatch_streaming(&mut self)
pub fn dispatch_streaming(&mut self)
Execute one streaming step (CPU mock).
Propagates distribution functions to neighbouring cells.
Sourcepub fn dispatch_boundary(&mut self)
pub fn dispatch_boundary(&mut self)
Apply bounce-back boundary conditions on solid cells.
Trait Implementations§
Source§impl Clone for LBMGpuKernels
impl Clone for LBMGpuKernels
Source§fn clone(&self) -> LBMGpuKernels
fn clone(&self) -> LBMGpuKernels
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LBMGpuKernels
impl RefUnwindSafe for LBMGpuKernels
impl Send for LBMGpuKernels
impl Sync for LBMGpuKernels
impl Unpin for LBMGpuKernels
impl UnsafeUnpin for LBMGpuKernels
impl UnwindSafe for LBMGpuKernels
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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