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

flow — portable (Kokkos) global reductions over a MAC grid's inner (owned) cells. More...

#include <cstddef>
#include <Kokkos_Core.hpp>
#include <Kokkos_MathematicalFunctions.hpp>

Go to the source code of this file.

Classes

struct  peclet::flow::Ext3
 
struct  peclet::flow::SumMax
 {sum, max|.|} reduction value. More...
 

Namespaces

namespace  peclet
 
namespace  peclet::flow
 

Typedefs

using peclet::flow::Exec = Kokkos::DefaultExecutionSpace
 
using peclet::flow::Mem = Exec::memory_space
 
using peclet::flow::DField = Kokkos::View< double *, Mem >
 
using peclet::flow::DConst = Kokkos::View< const double *, Mem >
 

Functions

std::size_t peclet::flow::innerToExt (long c, Ext3 ext, int ghost, Ext3 inner)
 
SumMax peclet::flow::localSumMax (DConst f, Ext3 ext, int ghost, Ext3 inner)
 Local sum and max|.| over the inner cells.
 
double peclet::flow::localDot (DConst a, DConst b, Ext3 ext, int ghost, Ext3 inner)
 Local inner product <a,b> over the inner cells.
 
void peclet::flow::subtractAll (DField f, double m)
 Subtract a constant from EVERY cell of the extended block (the mean-removal scatter).
 

Detailed Description

flow — portable (Kokkos) global reductions over a MAC grid's inner (owned) cells.

Kokkos port of the local reduction kernels in mac_reductions.cuh (reduce_block_k / dot_block_k / subtract_k): sum, max|.|, inner-product, and mean-subtraction over the INNER cells of an extended (inner+ghost) block, x-fastest layout. The block-shared-memory + per-block-atomic CUDA reduction becomes a single Kokkos::parallel_reduce. The MPI_Allreduce that turns these local results global is unchanged (host MPI) and lives in the caller. Runs on any Kokkos backend.

Definition in file mac_reductions.hpp.