16#ifndef PECLET_CORE_SOLVER_CSR_OPERATOR_HPP
17#define PECLET_CORE_SOLVER_CSR_OPERATOR_HPP
77 "amr::mom_residual", op.
n,
87 "amr::mom_jacobi_compute", op.
n, KOKKOS_LAMBDA(
const Index i) {
90 tmp(i) = (d != 0.0) ? (b(i) - off) / d : u(i);
93 "amr::mom_jacobi_update", op.
n,
94 KOKKOS_LAMBDA(
const Index i) { u(i) = (1.0 - omega) * u(i) + omega * tmp(i); });
108 const Coloring& col,
double omega) {
111 auto colorPass = [&](
int c) {
112 const Index a0 = col.
hStart[
static_cast<std::size_t
>(c)];
113 const Index a1 = col.
hStart[
static_cast<std::size_t
>(c) + 1];
114 Kokkos::parallel_for(
115 "amr::gs_mom", Kokkos::RangePolicy<ExecSpace>(a0, a1), KOKKOS_LAMBDA(
const Index k) {
116 const Index i = idx(k);
122 for (
int c = 0; c < col.
nColors; ++c)
124 for (
int c = col.
nColors - 2; c >= 0; --c)
PECLET_HD void faceCsrOffDiag(const Op &op, Index i, const U &u, double &off, double &d)
Off-diagonal sum and the (advection-inclusive) diagonal for the point smoothers: out off = Σ coef·u[n...
PECLET_HD double faceCsrPointUpdate(double b_i, double off, double d, double uOld, double omega)
The damped point update used by both Jacobi and (multicolour) Gauss–Seidel: returns the new u_i given...
void applyMom(const MomentumOp &op, View< const double > u, View< double > Au)
Au = A u (cut-cell operator + optional implicit-FOU advection).
void multicolorGSMom(const MomentumOp &op, View< double > u, View< const double > b, const Coloring &col, double omega)
One symmetric multicolour Gauss–Seidel sweep of A u = b in place (momentum operator: diag + face CSR ...
FaceCsrOpT< View< const double >, View< const Index > > momView(const MomentumOp &op)
View the assembled momentum operator through the shared, backend-agnostic FaceCsrOpT,...
void residualMom(const MomentumOp &op, View< const double > u, View< const double > b, View< double > res)
res = b − A u.
void jacobiMom(const MomentumOp &op, View< double > u, View< const double > b, View< double > tmp, double omega)
One weighted-Jacobi sweep of A u = b (in place).
PECLET_HD double faceCsrApplyRow(const Op &op, Index i, const U &u)
(A u)_i — one assembled-operator row.
std::int64_t Index
Signed index type for grids and particles (supersedes block_decomposer's long int IndxT).
Kokkos::View< T *, MemSpace > View
1D device array.
A graph colouring of a face CSR: cells grouped by colour.
std::vector< Index > hStart
A backend-agnostic view of an assembled face-CSR operator.
Assembled momentum operator on the device: (A u)_i = diag_i u_i + Σ coef·u[nbr], with an optional imp...
View< double > advDiag
per-cell outflow (diagonal) advection weight, size n
View< double > faceCoef
off-diagonal coefficient, size nnz
View< double > diag
size n
View< Index > faceNbr
neighbour leaf per off-diagonal, size nnz
View< Index > faceStart
CSR row offsets, size n+1.
View< Index > advStart
face-geom CSR row offsets, size n+1
View< double > advCoef
per-face inflow advection coefficient (0 on outflow/solid faces)
View< Index > advNbr
face-geom neighbour per face, size nFaces