flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
mac_cutcell_mg.hpp File Reference

flow — portable (Kokkos) geometric multigrid for the cut-cell (variable-openness) pressure Poisson. More...

#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdlib>
#include <Kokkos_Core.hpp>
#include <limits>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
#include "ghost_projection.hpp"
#include "mac_bc.hpp"
#include "mac_pressure.hpp"
#include "mg_bottom_direct.hpp"
#include "peclet/core/solver/graph_amg.hpp"
#include "star_elimination.hpp"

Go to the source code of this file.

Classes

struct  peclet::flow::CcNbrs
 
struct  peclet::flow::BottomLevel
 
struct  peclet::flow::BottomLabelKernel
 
struct  peclet::flow::BottomKernel< FacReal >
 
class  peclet::flow::CutcellMG
 
struct  peclet::flow::CutcellMG::Level
 
struct  peclet::flow::CutcellMG::OverlayScope
 

Namespaces

namespace  peclet
 
namespace  peclet::flow
 

Typedefs

using peclet::flow::MReal = float
 
using peclet::flow::FPV = Kokkos::View< MReal *, CCMem >
 
using peclet::flow::FPC = Kokkos::View< const MReal *, CCMem >
 

Enumerations

enum  : int { peclet::flow::kCaMomentum = 1 , peclet::flow::kCaMg = 2 , peclet::flow::kCaBoth = kCaMomentum | kCaMg }
 

Functions

template<class CV , class FV >
void peclet::flow::coarsenOpenAvgCell (const CV &oxc, const CV &oyc, const CV &ozc, const FV &oxf, const FV &oyf, const FV &ozf, C3 cext, C3 fext, int gc, int gf, C3 ratio, int icx, int icy, int icz)
 
void peclet::flow::coarsenOpenAvg (CCField oxc, CCField oyc, CCField ozc, CCConst oxf, CCConst oyf, CCConst ozf, C3 cext, C3 fext, int gc, int gf, C3 cinner, C3 ratio)
 
void peclet::flow::mgSaveFacePlane (CCField dst, CCConst src, C3 e, int g, int a, int s)
 
void peclet::flow::mgRestoreFacePlane (CCField dst, CCConst src, C3 e, int g, int a, int s)
 
void peclet::flow::mgCoarsenFacePlane (CCField oc, CCConst of, C3 cext, C3 fext, int gc, int gf, C3 cinner, C3 ratio, int a, int s)
 
template<class RV , class XV , class BV , class OpV >
void peclet::flow::cutcellResidualCell (const RV &r, const XV &x, const BV &b, const OpV &AC, const OpV &AW, const OpV &AE, const OpV &AS, const OpV &AN, const OpV &AB, const OpV &AT, long i, long xp, long xm, long yp, long ym, long zp, long zm)
 
void peclet::flow::residualCutcell (CCField r, CCConst x, CCConst b, FPC AC, FPC AW, FPC AE, FPC AS, FPC AN, FPC AB, FPC AT, C3 e, int g)
 
void peclet::flow::residualCutcellBox (CCField r, CCConst x, CCConst b, FPC AC, FPC AW, FPC AE, FPC AS, FPC AN, FPC AB, FPC AT, C3 e, C3 rlo, C3 rhi, C3 slo, C3 shi)
 
void peclet::flow::residualCutcellFace (CCField r, CCConst x, CCConst b, FPC AC, FPC AFX, FPC AFY, FPC AFZ, C3 e, int g)
 
void peclet::flow::residualCutcellBoxFace (CCField r, CCConst x, CCConst b, FPC AC, FPC AFX, FPC AFY, FPC AFZ, C3 e, C3 rlo, C3 rhi, C3 slo, C3 shi)
 
CcNbrs peclet::flow::ccWrapNbrs (int lx, int ly, int lz, C3 n, int g, long i, long sy, long sz)
 
void peclet::flow::cutcellSmoothColorFaceWrap (CCField phi, CCConst b, FPC AC, FPC AFX, FPC AFY, FPC AFZ, C3 e, C3 n, C3 og, int g, int color)
 
void peclet::flow::residualCutcellFaceWrap (CCField r, CCConst x, CCConst b, FPC AC, FPC AFX, FPC AFY, FPC AFZ, C3 e, C3 n, int g)
 
void peclet::flow::applyCutcellOpFaceWrap (CCField y, CCConst x, FPC AC, FPC AFX, FPC AFY, FPC AFZ, C3 e, C3 n, int g)
 
void peclet::flow::applyCutcellOpExactWrap (CCField y, CCConst x, CCConst ox, CCConst oy, CCConst oz, C3 e, C3 n, int g, double gfx, double gfy, double gfz)
 
template<class CV , class FV >
void peclet::flow::restrictAvgCell (const CV &coarse, const FV &fine, C3 cext, C3 fext, int gc, int gf, C3 ratio, int icx, int icy, int icz)
 
template<class FV , class CV >
void peclet::flow::prolongAddCell (const FV &fine, const CV &coarse, C3 fext, C3 cext, int gf, int gc, C3 ratio, int ifx, int ify, int ifz)
 
template<class FV , class AV >
void peclet::flow::meanSubtractCell (const FV &f, const AV &ac, long i, double mean)
 
void peclet::flow::restrictAvg (CCField coarse, CCConst fine, C3 cext, C3 fext, int gc, int gf, C3 cinner, C3 ratio)
 
void peclet::flow::restrictAvgZeroX (CCField coarse, CCField coarseX, CCConst fine, C3 cext, C3 fext, int gc, int gf, C3 cinner, C3 ratio)
 
void peclet::flow::prolongAdd (CCField fine, CCConst coarse, C3 fext, C3 cext, int gf, int gc, C3 finner, C3 ratio)
 
int peclet::flow::mgDebugLevel ()
 
int peclet::flow::mgDebugSolves ()
 

Variables

constexpr long peclet::flow::kBottomMaxCells = 8192
 
constexpr double peclet::flow::kBottomTau = 1e-5
 
constexpr int peclet::flow::kBottomMaxComponents = 64
 
constexpr int peclet::flow::kBottomCap = 100
 
constexpr int peclet::flow::kBottomHostTeam = 8
 
constexpr int peclet::flow::kBottomHostFactorTeam = 2
 

Detailed Description

flow — portable (Kokkos) geometric multigrid for the cut-cell (variable-openness) pressure Poisson.

Single-GPU (periodic) port of CUDA's DistributedPoissonMG (mac_multigrid.cuh): a level hierarchy with the rediscretized cut-cell operator (average-coarsen the face openness per level + re-assemble the operator at the coarse spacing, mg_coarsen_open_avg_k), a V-cycle with red-black Gauss-Seidel smoothing + average restriction + trilinear prolongation + constant-null-space (mean) removal, and an MG-PCG outer driver (CG preconditioned by one symmetric V-cycle). Operator stored single-precision (mreal=float) + double iterate, exactly as CUDA. Reuses buildCutcellOp / cutcellSmoothColor / applyCutcellOp (mac_pressure). Not yet ported (noted for later): Galerkin coarse op, Chebyshev smoother, semi-coarsening, domain-BC MG, MPI. Runs on any Kokkos backend.

Definition in file mac_cutcell_mg.hpp.