19#ifndef PECLET_CORE_AMR_FACE_CSR_HPP
20#define PECLET_CORE_AMR_FACE_CSR_HPP
28#if defined(PECLET_CORE_HAVE_MORTON)
29#include <morton/morton.hpp>
50template <
class D,
class I>
61template <
class Op,
class U>
63 double acc = op.diag(
i) *
u(
i);
64 for (
Index k = op.start(
i); k < op.start(
i + 1); ++k)
65 acc += op.coef(k) *
u(op.nbr(k));
67 acc += op.advDiag(
i) *
u(
i);
68 for (
Index k = op.advStart(
i); k < op.advStart(
i + 1); ++k)
69 acc += op.advCoef(k) *
u(op.advNbr(k));
77template <
class Op,
class U>
81 for (
Index k = op.start(
i); k < op.start(
i + 1); ++k)
82 off += op.coef(k) *
u(op.nbr(k));
84 for (
Index k = op.advStart(
i); k < op.advStart(
i + 1); ++k)
85 off += op.advCoef(k) *
u(op.advNbr(k));
95 const double nu = (d != 0.0) ? (
b_i - off) / d :
uOld;
109template <
class D,
class I>
119template <
class Op,
class U>
121 const double ui =
u(
i);
123 for (
Index k = op.start(
i); k < op.start(
i + 1); ++k)
124 acc += op.coef(k) * (
u(op.nbr(k)) -
ui);
125 return op.c0 *
ui + op.cD * (op.invVol(
i) * (
acc - op.bcDiag(
i) *
ui));
130template <
class Op,
class U>
133 for (
Index k = op.start(
i); k < op.start(
i + 1); ++k) {
134 sumOff += op.coef(k) *
u(op.nbr(k));
137 const double swbc =
sw + op.bcDiag(
i);
138 if (op.c0 == 0.0 && op.cD == 1.0)
140 const double Hii = op.c0 - op.cD * op.invVol(
i) *
swbc;
MORTON_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...
MORTON_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...
MORTON_HD double fvApplyRow(const Op &op, Index i, const U &u)
(H u)_i = c0·u_i + cD·( invVol_i·( Σ w·(u_nbr − u_i) − bcDiag_i·u_i ) ).
MORTON_HD double fvPointSolve(const Op &op, Index i, const U &u, double rhs_i, double uOld)
The point solve of H u = rhs for one row (raw value, before damping), matching the host point solve a...
MORTON_HD double faceCsrApplyRow(const Op &op, Index i, const U &u)
(A u)_i — one assembled-operator row.
Kokkos::View< T *, MemSpace > View
1D device array.
std::int64_t Index
Signed index type for grids and particles (supersedes block_decomposer's long int IndxT).
A backend-agnostic view of an assembled face-CSR operator.
A backend-agnostic view of an assembled FV (weight-CSR) operator.
A uniform accessor over a raw host array, giving it the operator()(i) that Kokkos::View has,...
MORTON_HD T operator()(Index i) const