core
Shared MPI block decomposition + asynchronous ghost-layer exchange (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::amr::MomentumSolver< Bits > Class Template Reference

#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.
 

Detailed Description

template<unsigned Bits = 21u>
class peclet::core::amr::MomentumSolver< Bits >

Definition at line 442 of file momentum.hpp.

Member Function Documentation

◆ setJacobi()

template<unsigned Bits = 21u>
void peclet::core::amr::MomentumSolver< Bits >::setJacobi ( int  preSweeps,
double  omega 
)
inline

Definition at line 444 of file momentum.hpp.

◆ setPreconditioner()

template<unsigned Bits = 21u>
void peclet::core::amr::MomentumSolver< Bits >::setPreconditioner ( std::function< void(View< const double >, View< double >)>  fn)
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.

◆ solveJacobi()

template<unsigned Bits = 21u>
double peclet::core::amr::MomentumSolver< Bits >::solveJacobi ( const MomentumOp op,
View< double u,
View< const double b,
int  sweeps 
)
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().

◆ solveDefectCorrection()

template<unsigned Bits = 21u>
Result peclet::core::amr::MomentumSolver< Bits >::solveDefectCorrection ( const MomentumOp op,
View< double u,
View< const double b,
int  maxIters = 200,
double  tol = 1e-8 
)
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().

◆ solveBiCGStab()

template<unsigned Bits = 21u>
Result peclet::core::amr::MomentumSolver< Bits >::solveBiCGStab ( const MomentumOp op,
View< double u,
View< const double b,
int  maxIters = 500,
double  tol = 1e-10 
)
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().


The documentation for this class was generated from the following file: