56#ifndef PECLET_FLOW_VOF_COLOUR_BC_HPP
57#define PECLET_FLOW_VOF_COLOUR_BC_HPP
59#include <Kokkos_Core.hpp>
68KOKKOS_INLINE_FUNCTION
void axisDims(
I3 e,
int (&dims)[3],
long (&strides)[3]) {
74 strides[2] =
static_cast<long>(e.x) * e.y;
85 const bool p0 = px, p1 = py, p2 = pz;
86 const int q0 = gs.x, q1 = gs.y, q2 = gs.z;
89 KOKKOS_LAMBDA(
int x,
int y,
int z) {
90 const int gx = x - g + o.x, gy = y - g + o.y, gz = z - g + o.z;
91 const bool out = (!p0 && (gx < 0 || gx >= q0)) || (!p1 && (gy < 0 || gy >= q1)) ||
92 (!p2 && (gz < 0 || gz >= q2));
93 m(
L3(x, y, z, e)) = out ? 1u : 0u;
105 const int b = (a + 1) % 3, c = (a + 2) % 3;
106 const long sa = strides[a], sb = strides[b], sc = strides[c];
107 const int na = dims[a];
108 const int lo = (s == 0) ? 0 : (na - g);
109 Kokkos::parallel_for(
111 KOKKOS_LAMBDA(
int p0,
int p1) {
112 const long base =
static_cast<long>(p0) * sb +
static_cast<long>(p1) * sc;
113 for (
int k = 0; k < g; ++k)
114 f(base +
static_cast<long>(lo + k) * sa) =
value;
127 const int b = (a + 1) % 3, c = (a + 2) % 3;
128 const long sa = strides[a], sb = strides[b], sc = strides[c];
129 const int na = dims[a];
130 const int lo = (s == 0) ? 0 : (na - g);
131 Kokkos::parallel_for(
133 KOKKOS_LAMBDA(
int p0,
int p1) {
134 const long base =
static_cast<long>(p0) * sb +
static_cast<long>(p1) * sc;
135 const double v =
prof(
static_cast<long>(p0) * nc + p1);
136 for (
int k = 0; k < g; ++k)
137 f(base +
static_cast<long>(lo + k) * sa) = v;
156 const int b = (a + 1) % 3, c = (a + 2) % 3;
157 const long sa = strides[a], sb = strides[b], sc = strides[c];
158 const int na = dims[a];
159 const int lo = (s == 0) ? 0 : (na - g);
160 const int fa = (s == 0) ? (g - 1) : (na - g - 1);
161 const double sgn = (s == 0) ? 1.0 : -1.0;
162 Kokkos::parallel_for(
164 KOKKOS_LAMBDA(
int p0,
int p1) {
165 const long base =
static_cast<long>(p0) * sb +
static_cast<long>(p1) * sc;
166 if (sgn * un(base +
static_cast<long>(fa) * sa) <= 0.0)
168 for (
int k = 0; k < g; ++k)
169 f(base +
static_cast<long>(lo + k) * sa) = backflow;
flow — VoF rung V1: Weymouth & Yue (2010) directionally-split, exactly volume-conserving geometric ad...
flow — portable (Kokkos) MAC stencil operators: Red-Black Gauss-Seidel smoothers + divergence.
void axisDims(I3 e, int(&dims)[3], long(&strides)[3])
Kokkos::View< unsigned char *, SMem > UCField
void bcColourBackflow(SField f, I3 e, int g, int a, int s, SField un, double backflow)
inletOutlet on an outflow face: where the boundary face velocity points INTO the domain,...
void bcColourConst(SField f, I3 e, int g, int a, int s, double value)
Overwrite ALL g ghost layers of domain face (axis a, side s) with a constant colour.
void bcColourProfile(SField f, I3 e, int g, int a, int s, SField prof, int nc)
Same, with a per-position colour on the face's (b, c) plane.
void buildOutsideMask(UCField m, I3 e, int g, I3 o, I3 gs, bool px, bool py, bool pz)
1 for every ghost cell of the block that lies OUTSIDE the global domain on a non-periodic axis,...
Kokkos::MDRangePolicy< Exec, Kokkos::Rank< 3, Kokkos::Iterate::Left, Kokkos::Iterate::Left > > MDRange3
3-D range, x (the first index) fastest (both the tile order and the order within a tile).
Kokkos::View< double *, SMem > SField
long L3(int x, int y, int z, I3 e)
Kokkos::DefaultExecutionSpace SExec
Kokkos::MDRangePolicy< Exec, Kokkos::Rank< 2, Kokkos::Iterate::Left, Kokkos::Iterate::Left > > MDRange2
2-D range, first index fastest (both the tile order and the order within a tile).
flow — the multidimensional iteration policies: iteration order follows storage.
static double value(int gx, int gy, int gz)