|
core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
|
#include <momentum.hpp>
Classes | |
| struct | Result |
Public Member Functions | |
| void | setJacobi (int preSweeps, double omega) |
| void | setPreconditioner (std::function< void(View< const double >, View< double >)> fn) |
Set a generic preconditioner z = M⁻¹ r (a host callable that launches device kernels) — the multigrid V-cycle gives the smooth-mode coverage Jacobi lacks, so the momentum iteration count stops growing with N. | |
| double | solveJacobi (const MomentumOp &op, View< double > u, View< const double > b, int sweeps) |
Plain weighted-Jacobi solve (the simple parallel mirror of the host GS smoother): sweeps damped-Jacobi sweeps of A u = b in place. | |
| Result | solveDefectCorrection (const MomentumOp &op, View< double > u, View< const double > b, int maxIters=200, double tol=1e-8) |
| MG-preconditioned defect-correction (Richardson) solve of A u = b in place: u ← u + M⁻¹(b − A u), M = the preconditioner (velocity-MG if set, else Jacobi sweeps). | |
| Result | solveBiCGStab (const MomentumOp &op, View< double > u, View< const double > b, int maxIters=500, double tol=1e-10) |
| Jacobi-preconditioned BiCGStab solve of A u = b in place. | |
Definition at line 442 of file momentum.hpp.
|
inline |
Definition at line 444 of file momentum.hpp.
|
inline |
Set a generic preconditioner z = M⁻¹ r (a host callable that launches device kernels) — the multigrid V-cycle gives the smooth-mode coverage Jacobi lacks, so the momentum iteration count stops growing with N.
Decoupled from the MG type (Galerkin MomentumMG or rediscretized VelocityMG) via std::function, so the two coarse-operator strategies are interchangeable (and the solver carries no MG type). Pass an empty function to revert to damped-Jacobi. The preconditioner never changes the converged solution (the matvec is the exact operator).
Definition at line 455 of file momentum.hpp.
|
inline |
Plain weighted-Jacobi solve (the simple parallel mirror of the host GS smoother): sweeps damped-Jacobi sweeps of A u = b in place.
Returns the final residual L2.
Definition at line 461 of file momentum.hpp.
References peclet::core::amr::dotPlain(), peclet::core::amr::jacobiMom(), peclet::core::amr::MomentumOp::n, and peclet::core::amr::residualMom().
|
inline |
MG-preconditioned defect-correction (Richardson) solve of A u = b in place: u ← u + M⁻¹(b − A u), M = the preconditioner (velocity-MG if set, else Jacobi sweeps).
Unlike BiCGStab it cannot break down — robust for the strongly non-symmetric momentum operator with implicit-FOU advection, where the velocity-MG (built from the viscous base) is only an approximate inverse. Converges when the advection is a perturbation of the viscous+reaction operator (low–moderate cell Reynolds number). maxIters caps the iterations; tol is relative to ||b−Au₀||.
Definition at line 482 of file momentum.hpp.
References peclet::core::amr::axpy(), peclet::core::amr::dotPlain(), peclet::core::amr::MomentumOp::n, and peclet::core::amr::residualMom().
|
inline |
Jacobi-preconditioned BiCGStab solve of A u = b in place.
maxIters caps the outer iterations; tol is relative to ||b−Au0||. Returns {iters, final residual L2}.
Definition at line 510 of file momentum.hpp.
References peclet::core::amr::applyMom(), peclet::core::amr::axpy(), peclet::core::amr::bicgPUpdate(), peclet::core::amr::dotPlain(), peclet::core::amr::MomentumOp::n, and peclet::core::amr::residualMom().