24#ifndef PECLET_FLOW_MAC_CHEB_MOMENTUM_HPP
25#define PECLET_FLOW_MAC_CHEB_MOMENTUM_HPP
27#include <Kokkos_Core.hpp>
46 const MD pol(
space, {g, g, g}, {e.x - g, e.y - g, e.z - g});
47 double rlo = 0.0,
rhi = 0.0;
48 Kokkos::parallel_reduce(
49 "peclet::flow::cheb_bounds_lo",
pol,
51 const long i = (
long)
lx + (
long)
ly * e.x + (
long)
lz * (
long)e.x * e.y;
55 if (Kokkos::fabs(
ac) < 1e-30)
59 const double v = (
ac + off) /
ac;
63 Kokkos::Min<double>(
rlo));
64 Kokkos::parallel_reduce(
65 "peclet::flow::cheb_bounds_hi",
pol,
67 const long i = (
long)
lx + (
long)
ly * e.x + (
long)
lz * (
long)e.x * e.y;
71 if (Kokkos::fabs(
ac) < 1e-30)
75 const double v = (
ac - off) /
ac;
79 Kokkos::Max<double>(
rhi));
89 double alpha,
double beta) {
94 "peclet::flow::cheb_update",
MD(
space, {g, g, g}, {e.x - g, e.y - g, e.z - g}),
96 const long i = (
long)
lx + (
long)
ly * e.x + (
long)
lz * (
long)e.x * e.y;
103 if (Kokkos::fabs(
ac) < 1e-30)
105 const double dn = beta * d(i) + alpha * r(i) /
ac;
120 void next(
int it,
double& alpha,
double& beta) {
flow — portable (Kokkos) geometric multigrid for the cut-cell (variable-openness) pressure Poisson.
flow — portable (Kokkos) IBM geometric fields + variable-coefficient RB-GS smoother.
void ibmChebUpdate(CCField x, CCField d, CCConst r, FPC AC, CCConst solidmask, C3 e, int g, double alpha, double beta)
One Chebyshev update on the Jacobi-preconditioned system: d <- beta*d + alpha*r/AC ; x += d.
Kokkos::View< const MReal *, CCMem > FPC
void ibmStencilJacobiBounds(MC AC, MC AW, MC AE, MC AS, MC AN, MC AB, MC AT, CCConst solidmask, C3 e, int g, double &lo, double &hi)
Gershgorin bounds [lo, hi] on the spectrum of the Jacobi-preconditioned cut-cell Helmholtz diag(AC)^-...
Kokkos::View< double *, CCMem > CCField
Kokkos::DefaultExecutionSpace CCExec
Kokkos::View< const double *, CCMem > CCConst
flow — the multidimensional iteration policies: iteration order follows storage.
The Chebyshev coefficient recurrence (Golub-Varga; the form multigrid Chebyshev smoothers use).
void next(int it, double &alpha, double &beta)
Coefficients for iteration it (0-based). Advances the recurrence.
ChebCoeffs(double lo, double hi)
static constexpr double AC