pub struct PoissonSolver2D { /* private fields */ }Expand description
Poisson’s equation solver for 2D problems
Solves ∇²u = f(x, y), or in expanded form: ∂²u/∂x² + ∂²u/∂y² = f(x, y)
Implementations§
Source§impl PoissonSolver2D
impl PoissonSolver2D
Sourcepub fn new(
domain: Domain,
source_term: impl Fn(f64, f64) -> f64 + Send + Sync + 'static,
boundary_conditions: Vec<BoundaryCondition<f64>>,
options: Option<EllipticOptions>,
) -> PDEResult<Self>
pub fn new( domain: Domain, source_term: impl Fn(f64, f64) -> f64 + Send + Sync + 'static, boundary_conditions: Vec<BoundaryCondition<f64>>, options: Option<EllipticOptions>, ) -> PDEResult<Self>
Create a new Poisson equation solver for 2D problems
Sourcepub fn solve_sor(&self) -> PDEResult<EllipticResult>
pub fn solve_sor(&self) -> PDEResult<EllipticResult>
Solve the Poisson equation using Successive Over-Relaxation (SOR)
Sourcepub fn solve_direct(&self) -> PDEResult<EllipticResult>
pub fn solve_direct(&self) -> PDEResult<EllipticResult>
Solve the Poisson equation using direct sparse solver
This method sets up the linear system Au = b and solves it directly. It creates a sparse matrix for the Laplacian operator and applies boundary conditions to the system.
Auto Trait Implementations§
impl Freeze for PoissonSolver2D
impl !RefUnwindSafe for PoissonSolver2D
impl Send for PoissonSolver2D
impl Sync for PoissonSolver2D
impl Unpin for PoissonSolver2D
impl !UnwindSafe for PoissonSolver2D
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