pub struct NavierStokesKernelDispatcher { /* private fields */ }Expand description
GPU-accelerated Navier-Stokes pressure-Poisson dispatcher.
Implementations§
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Returns true when a usable GPU backend is available.
Sourcepub fn dispatch_pressure_jacobi(
&self,
grid: &PressureGrid,
) -> GpuResult<Vec<f64>>
pub fn dispatch_pressure_jacobi( &self, grid: &PressureGrid, ) -> GpuResult<Vec<f64>>
Run a single Jacobi sweep of the pressure-Poisson equation.
Returns the updated pressure field. Boundary cells are held fixed
(Dirichlet). The CPU reference path can be re-used for validation by
calling Self::cpu_reference_jacobi.
§Errors
Returns GpuError::BackendUnavailable when compiled without the
gpu feature, or GpuError::InvalidInput when the grid is
degenerate.
Sourcepub fn dispatch_pressure_solve(
&self,
grid: &PressureGrid,
n_sweeps: usize,
) -> GpuResult<PressureSolveOutput>
pub fn dispatch_pressure_solve( &self, grid: &PressureGrid, n_sweeps: usize, ) -> GpuResult<PressureSolveOutput>
Run n_sweeps Jacobi sweeps and return the final pressure field
alongside the L2 residual after the last sweep.
§Errors
Returns GpuError::BackendUnavailable when the backend is not
ready.
Sourcepub fn cpu_reference_jacobi(grid: &PressureGrid) -> Vec<f64>
pub fn cpu_reference_jacobi(grid: &PressureGrid) -> Vec<f64>
CPU reference implementation of one Jacobi pressure sweep — public for fallback and validation. Boundary cells are held fixed.
Sourcepub fn residual_l2(grid: &PressureGrid) -> f64
pub fn residual_l2(grid: &PressureGrid) -> f64
L2 residual of the Poisson operator on the interior of grid.
Trait Implementations§
Source§fn default() -> NavierStokesKernelDispatcher
fn default() -> NavierStokesKernelDispatcher
Auto Trait Implementations§
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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