117#ifndef PECLET_CORE_VOF_CURVATURE_HPP
118#define PECLET_CORE_VOF_CURVATURE_HPP
120#include <Kokkos_Core.hpp>
121#include <Kokkos_MathematicalFunctions.hpp>
237 const int R =
nh / 2;
238 double lo = 0.0,
hi = 0.0;
239 for (
int k = 0;
k <
R; ++
k) {
252 for (
int k =
R;
k >= 0; --
k)
257 for (
int k =
R;
k <
nh; ++
k)
263 for (
int k =
R;
k >= 0; --
k)
268 for (
int k =
R;
k <
nh; ++
k)
278 for (
int k = a;
k <= b; ++
k) {
284 h = (
orient == 1) ? (s +
static_cast<double>(a -
R) - 0.5)
285 : (s -
static_cast<double>(b -
R) - 0.5);
297 const double hx = 0.5 * (h[2 + 3 * 1] - h[0 + 3 * 1]);
298 const double hy = 0.5 * (h[1 + 3 * 2] - h[1 + 3 * 0]);
299 const double hxx = h[2 + 3 * 1] - 2.0 * h[1 + 3 * 1] + h[0 + 3 * 1];
300 const double hyy = h[1 + 3 * 2] - 2.0 * h[1 + 3 * 1] + h[1 + 3 * 0];
301 const double hxy = 0.25 * (h[2 + 3 * 2] - h[0 + 3 * 2] - h[2 + 3 * 0] + h[0 + 3 * 0]);
302 const double q = 1.0 + hx * hx + hy * hy;
305 return -
num / (
q * Kokkos::sqrt(
q));
328 const int d1 = (
d + 1) % 3,
d2 = (
d + 2) % 3;
330 const double hx = 0.5 * (h[2 + 3 * 1] - h[0 + 3 * 1]) *
r1;
331 const double hy = 0.5 * (h[1 + 3 * 2] - h[1 + 3 * 0]) *
r2;
332 const double hxx = (h[2 + 3 * 1] - 2.0 * h[1 + 3 * 1] + h[0 + 3 * 1]) *
r1 / g.
h[
d1];
333 const double hyy = (h[1 + 3 * 2] - 2.0 * h[1 + 3 * 1] + h[1 + 3 * 0]) *
r2 / g.
h[
d2];
335 0.25 * (h[2 + 3 * 2] - h[0 + 3 * 2] - h[2 + 3 * 0] + h[0 + 3 * 0]) *
r1 / g.
h[
d2];
336 const double q = 1.0 + hx * hx + hy * hy;
338 return -
num / (
q * Kokkos::sqrt(
q));
350 double m = Kokkos::fabs(n[0]);
351 if (Kokkos::fabs(n[1]) <
m) {
352 m = Kokkos::fabs(n[1]);
355 if (Kokkos::fabs(n[2]) <
m)
357 double e[3] = {0.0, 0.0, 0.0};
360 t1[0] = e[1] * n[2] - e[2] * n[1];
361 t1[1] = e[2] * n[0] - e[0] * n[2];
362 t1[2] = e[0] * n[1] - e[1] * n[0];
363 const double s = Kokkos::sqrt(t1[0] * t1[0] + t1[1] * t1[1] + t1[2] * t1[2]);
364 const double inv = (s > 0.0) ? 1.0 / s : 0.0;
369 t2[0] = n[1] * t1[2] - n[2] * t1[1];
370 t2[1] = n[2] * t1[0] - n[0] * t1[2];
371 t2[2] = n[0] * t1[1] - n[1] * t1[0];
379 const double q = r /
d;
382 const double t = 1.0 -
q;
383 const double t2 =
t *
t;
384 return (1.0 + 4.0 *
q) *
t2 *
t2;
391 const double q = 1.0 + a[1] * a[1] + a[2] * a[2];
392 const double num = a[5] * a[1] * a[1] - a[4] * a[1] * a[2] + a[3] * a[2] * a[2] + a[3] + a[5];
393 return -2.0 *
num / (
q * Kokkos::sqrt(
q));
403 double x[6],
double pivTol) {
405 for (
int i = 0;
i < n; ++
i) {
406 if (!(
Ain[
i][
i] > 0.0))
408 d[
i] = 1.0 / Kokkos::sqrt(
Ain[
i][
i]);
410 double A[6][6], b[6];
411 for (
int i = 0;
i < n; ++
i) {
413 for (
int j = 0;
j < n; ++
j)
417 for (
int i = 0;
i < n; ++
i) {
419 for (
int k = 0;
k <
i; ++
k)
420 s -= A[
i][
k] * A[
i][
k] * A[
k][
k];
424 for (
int j =
i + 1;
j < n; ++
j) {
426 for (
int k = 0;
k <
i; ++
k)
427 t -= A[
j][
k] * A[
i][
k] * A[
k][
k];
433 for (
int i = 0;
i < n; ++
i) {
435 for (
int k = 0;
k <
i; ++
k)
439 for (
int i = 0;
i < n; ++
i)
441 for (
int i = n - 1;
i >= 0; --
i) {
443 for (
int k =
i + 1;
k < n; ++
k)
447 for (
int i = 0;
i < n; ++
i)
467 const double m[3] = {
mx,
my,
mz};
468 const double nrm2 =
m[0] *
m[0] +
m[1] *
m[1] +
m[2] *
m[2];
473 for (
int q = 0;
q < 8 && nv < 8; ++
q) {
474 const double A[3] = {
static_cast<double>(
q & 1),
static_cast<double>((
q >> 1) & 1),
475 static_cast<double>((
q >> 2) & 1)};
476 const double fA =
m[0] * A[0] +
m[1] * A[1] +
m[2] * A[2] -
alpha;
477 for (
int a = 0; a < 3 && nv < 8; ++a) {
480 double B[3] = {A[0], A[1], A[2]};
482 const double fB =
fA +
m[a];
489 const double t = (
den != 0.0) ?
fA /
den : 0.0;
490 double p[3] = {A[0], A[1], A[2]};
491 p[a] = A[a] +
t * (B[a] - A[a]);
494 for (
int k = 0;
k < nv; ++
k) {
495 const double dx = p[0] - v[
k][0],
dy = p[1] - v[
k][1],
dz = p[2] - v[
k][2];
513 const double invn = 1.0 / Kokkos::sqrt(
nrm2);
517 double cx = 0.0, cy = 0.0, cz = 0.0;
518 for (
int k = 0;
k < nv; ++
k) {
523 const double inv = 1.0 /
static_cast<double>(nv);
528 for (
int k = 0;
k < nv; ++
k) {
529 const double dx = v[
k][0] - cx,
dy = v[
k][1] - cy,
dz = v[
k][2] - cz;
533 for (
int i = 1;
i < nv; ++
i) {
534 const double a0 = ang[
i];
535 const double p0 = v[
i][0],
p1 = v[
i][1],
p2 = v[
i][2];
537 while (
j >= 0 && ang[
j] >
a0) {
539 v[
j + 1][0] = v[
j][0];
540 v[
j + 1][1] = v[
j][1];
541 v[
j + 1][2] = v[
j][2];
559 for (
int k = 1;
k + 1 < nv; ++
k) {
560 const double a1[3] = {v[
k][0] - v[0][0], v[
k][1] - v[0][1], v[
k][2] - v[0][2]};
561 const double a2[3] = {v[
k + 1][0] - v[0][0], v[
k + 1][1] - v[0][1], v[
k + 1][2] - v[0][2]};
562 const double cx =
a1[1] *
a2[2] -
a1[2] *
a2[1];
563 const double cy =
a1[2] *
a2[0] -
a1[0] *
a2[2];
564 const double cz =
a1[0] *
a2[1] -
a1[1] *
a2[0];
565 const double t = 0.5 * Kokkos::sqrt(cx * cx + cy * cy + cz * cz);
567 ctr[0] +=
t * (v[0][0] + v[
k][0] + v[
k + 1][0]) / 3.0;
568 ctr[1] +=
t * (v[0][1] + v[
k][1] + v[
k + 1][1]) / 3.0;
569 ctr[2] +=
t * (v[0][2] + v[
k][2] + v[
k + 1][2]) / 3.0;
594 for (
int i = 0;
i < 6; ++
i)
598 for (
int k = 0;
k < nv; ++
k) {
599 const int k1 = (
k + 1 == nv) ? 0 :
k + 1;
605 s[0] +=
dy * 0.5 * (
x0 +
x1);
644 for (
int i = 0;
i < 6; ++
i) {
646 for (
int j = 0;
j < 6; ++
j)
657 const double t1[3],
const double t2[3],
const double nn[3],
659 const double di[3] = {
X[0] -
org[0],
X[1] -
org[1],
X[2] -
org[2]};
664 const double x =
d[0] * t1[0] +
d[1] * t1[1] +
d[2] * t1[2];
665 const double y =
d[0] *
t2[0] +
d[1] *
t2[1] +
d[2] *
t2[2];
666 const double z =
d[0] *
nn[0] +
d[1] *
nn[1] +
d[2] *
nn[2];
670 const double phi[6] = {1.0, x, y, x * x, x * y, y * y};
671 for (
int i = 0;
i < 6; ++
i) {
673 for (
int j = 0;
j < 6; ++
j)
681 const double t1[3],
const double t2[3],
const double nn[3],
689 for (
int i = 0;
i < 6; ++
i)
695 const int id[3] = {0, 3, 5};
696 double Ar[6][6],
br[6],
ar[6];
697 for (
int i = 0;
i < 3; ++
i) {
699 for (
int j = 0;
j < 3; ++
j)
724 for (
int i = 0;
i < 6; ++
i) {
726 for (
int j = 0;
j < 6; ++
j)
763 const double t2[3],
const double nn[3],
double cosMin,
771 const double mi[3] = {
mx / g.
h[0],
my / g.
h[1],
mz / g.
h[2]};
772 const double invn = 1.0 / Kokkos::sqrt(
mi[0] *
mi[0] +
mi[1] *
mi[1] +
mi[2] *
mi[2]);
773 np[0] = (
mi[0] * t1[0] +
mi[1] * t1[1] +
mi[2] * t1[2]) *
invn;
792 int nv,
const double off[3],
const double org[3],
793 const double t1[3],
const double t2[3],
799 double px = 0.0,
py = 0.0;
800 for (
int k = 0;
k < nv; ++
k) {
801 const double Xi[3] = {off[0] + v[
k][0] - 0.5 -
org[0], off[1] + v[
k][1] - 0.5 -
org[1],
802 off[2] + v[
k][2] - 0.5 -
org[2]};
805 xy[
k][0] =
X[0] * t1[0] +
X[1] * t1[1] +
X[2] * t1[2];
807 const double z =
X[0] *
nn[0] +
X[1] *
nn[1] +
X[2] *
nn[2];
812 const double invv = 1.0 /
static_cast<double>(nv);
819 if (!(Kokkos::fabs(s[0]) > 1e-14))
826 const double r = Kokkos::sqrt(
px *
px +
py *
py +
zc *
zc);
831 const double B =
b0 * s[0] +
b1 * s[1] +
b2 * s[2];
834 for (
int i = 0;
i < 6; ++
i)
848 const double off[3],
const double org[3],
const double t1[3],
849 const double t2[3],
const double nn[3],
double dW,
859 return pvTermPolygon(
t,
np, v, nv, off,
org, t1,
t2,
nn,
dW, g);
865 const double w =
t.w, B =
t.B;
866 const double* s =
t.s;
867 for (
int i = 0;
i < 6; ++
i) {
868 f.b[
i] += w * s[
i] * B;
869 for (
int j = 0;
j < 6; ++
j)
870 f.A[
i][
j] += w * s[
i] * s[
j];
879 const double off[3],
const double org[3],
const double t1[3],
880 const double t2[3],
const double nn[3],
double dW,
883 if (!
pvFitTerm(
t,
mx,
my,
mz,
alpha, off,
org, t1,
t2,
nn,
dW,
cosMin, g))
891 const double off[3],
const double org[3],
const double t1[3],
892 const double t2[3],
const double nn[3],
double dW,
894 return pvFitAdd(
f,
mx,
my,
mz,
alpha, off,
org, t1,
t2,
nn,
dW,
cosMin,
VofMetric{});
910 for (
int i = 0;
i < 6; ++
i)
917 const int id[3] = {0, 3, 5};
918 double Ar[6][6],
br[6],
ar[6];
919 for (
int i = 0;
i < 3; ++
i) {
921 for (
int j = 0;
j < 3; ++
j)
951 const double w =
t.w, B =
t.B;
952 const double* s =
t.s;
953 for (
int i = 0;
i < 6; ++
i) {
954 f.b[
i] += w * s[
i] * B;
955 for (
int j = 0;
j <=
i; ++
j)
956 f.A[
i][
j] += w * s[
i] * s[
j];
971 const double w =
t.w;
973 const int i = e - 21;
974 a += w *
t.s[
i] *
t.B;
978 while ((
i + 1) * (
i + 2) / 2 <= e)
980 const int j = e -
i * (
i + 1) / 2;
981 a += w *
t.s[
i] *
t.s[
j];
986 for (
int i = 0;
i < 6; ++
i) {
988 for (
int j = 0;
j < 6; ++
j)
989 f.A[
i][
j] = (
j <=
i) ?
ent[
i * (
i + 1) / 2 +
j] : 0.0;
1007 P.vbar[0] =
P.vbar[1] =
P.vbar[2] = 0.0;
1010 double sx = 0.0,
sy = 0.0,
sz = 0.0;
1011 for (
int k = 0;
k <
P.nv; ++
k) {
1016 const double inv = 1.0 /
static_cast<double>(
P.nv);
1017 P.vbar[0] =
sx *
inv - 0.5;
1018 P.vbar[1] =
sy *
inv - 0.5;
1019 P.vbar[2] =
sz *
inv - 0.5;
1039 const double Xi[3] = {
P.vbar[0] + off[0] -
org[0],
P.vbar[1] + off[1] -
org[1],
1040 P.vbar[2] + off[2] -
org[2]};
1043 return X[0] *
X[0] +
X[1] *
X[1] +
X[2] *
X[2] >
dW *
dW * (1.0 + 1e-9);
1065 for (
int a = 0; a < 3; ++a) {
1071 for (
int q = 0;
q < 6; ++
q)
1073 const double m[3] = {
mx,
my,
mz};
1081 double sc[3] = {0.0, 0.0, 0.0};
1082 for (
int k = 0;
k < nv; ++
k) {
1083 const double Xi[3] = {v[
k][0] - 0.5, v[
k][1] - 0.5, v[
k][2] - 0.5};
1089 const double inv = 1.0 /
static_cast<double>(nv);
1093 constexpr int ip[6] = {0, 1, 2, 0, 0, 1},
iq[6] = {0, 1, 2, 1, 2, 2};
1094 for (
int k = 1;
k + 1 < nv; ++
k) {
1095 const double* A =
Y[0];
1096 const double* B =
Y[
k];
1097 const double*
C =
Y[
k + 1];
1098 const double u[3] = {B[0] - A[0], B[1] - A[1], B[2] - A[2]};
1099 const double w[3] = {
C[0] - A[0],
C[1] - A[1],
C[2] - A[2]};
1100 const double cx = u[1] * w[2] - u[2] * w[1];
1101 const double cy = u[2] * w[0] - u[0] * w[2];
1102 const double cz = u[0] * w[1] - u[1] * w[0];
1103 const double At = 0.5 * Kokkos::sqrt(cx * cx + cy * cy + cz * cz);
1104 const double S[3] = {A[0] + B[0] +
C[0], A[1] + B[1] +
C[1], A[2] + B[2] +
C[2]};
1106 for (
int a = 0; a < 3; ++a)
1107 P.m1[a] +=
At *
S[a] / 3.0;
1108 for (
int q = 0;
q < 6; ++
q) {
1122 double t1[3],
double t2[3],
double org[3]) {
1123 if (!(
P.n[0] *
P.n[0] +
P.n[1] *
P.n[1] +
P.n[2] *
P.n[2] > 0.0))
1130 org[0] =
P.m1[0] /
P.a;
1131 org[1] =
P.m1[1] /
P.a;
1132 org[2] =
P.m1[2] /
P.a;
1134 const double h[3] = {-0.5, -0.5, -0.5};
1155 const double org[3],
const double t1[3],
1156 const double t2[3],
const double nn[3],
double dW,
1159 const double cj =
P.n[0] *
nn[0] +
P.n[1] *
nn[1] +
P.n[2] *
nn[2];
1169 const double rc[3] = {
P.c[0] +
d[0],
P.c[1] +
d[1],
P.c[2] +
d[2]};
1170 const double r = Kokkos::sqrt(
rc[0] *
rc[0] +
rc[1] *
rc[1] +
rc[2] *
rc[2]);
1174 const double a =
P.a;
1175 const double* m1 =
P.m1;
1176 const double* m2 =
P.m2;
1177 const double Q1[3] = {m1[0] +
d[0] * a, m1[1] +
d[1] * a, m1[2] +
d[2] * a};
1179 const double Qxx = m2[0] + 2.0 *
d[0] * m1[0] +
d[0] *
d[0] * a;
1180 const double Qyy = m2[1] + 2.0 *
d[1] * m1[1] +
d[1] *
d[1] * a;
1181 const double Qzz = m2[2] + 2.0 *
d[2] * m1[2] +
d[2] *
d[2] * a;
1182 const double Qxy = m2[3] +
d[0] * m1[1] + m1[0] *
d[1] +
d[0] *
d[1] * a;
1183 const double Qxz = m2[4] +
d[0] * m1[2] + m1[0] *
d[2] +
d[0] *
d[2] * a;
1184 const double Qyz = m2[5] +
d[1] * m1[2] + m1[1] *
d[2] +
d[1] *
d[2] * a;
1185 const double u[3] = {
Qxx * t1[0] +
Qxy * t1[1] +
Qxz * t1[2],
1186 Qxy * t1[0] +
Qyy * t1[1] +
Qyz * t1[2],
1187 Qxz * t1[0] +
Qyz * t1[1] +
Qzz * t1[2]};
1193 s[1] =
cj * (t1[0] *
Q1[0] + t1[1] *
Q1[1] + t1[2] *
Q1[2]);
1195 s[3] =
cj * (t1[0] * u[0] + t1[1] * u[1] + t1[2] * u[2]);
1196 s[4] =
cj * (
t2[0] * u[0] +
t2[1] * u[1] +
t2[2] * u[2]);
1197 s[5] =
cj * (
t2[0] * v[0] +
t2[1] * v[1] +
t2[2] * v[2]);
1198 if (!(Kokkos::fabs(s[0]) > 1e-14))
1202 for (
int i = 0;
i < 6; ++
i)
bool hfIsFull(double c, double eps)
Colour thresholds for "this cell is pure", at a caller-supplied tolerance.
constexpr int kPvEntries
Number of independent entries of the PV normal equations: the 21 of the lower triangle (with the diag...
void pvFitAccumLower(PvFit &f, const PvTerm &t)
Lower-triangle accumulation: pvFitAccum restricted to j <= i (design G §5.1c).
void pvPolygonBuild(double mx, double my, double mz, double alpha, PvPolygon &P)
Build a PvPolygon from a cell's PLIC plane: nv = plicPolygon(m, alpha, v), then vbar.
constexpr int kHfColumn
Column length of the height function, NH in Han et al.
bool pvOutsideSupport(const PvPolygon &P, const double off[3], const double org[3], double dW, const VofMetric &g)
true iff the cached polygon is CERTAINLY outside the Wendland support of a target with origin org (in...
void curvFrame(const double n[3], double t1[3], double t2[3])
Right-handed orthonormal frame (t1, t2, n) from a unit vector n.
bool pvFitTerm(PvTerm &t, double mx, double my, double mz, double alpha, const double off[3], const double org[3], const double t1[3], const double t2[3], const double nn[3], double dW, double cosMin, const VofMetric &g)
One stencil polygon's contribution to the PV fit: everything pvFitAdd computes before the accumulatio...
bool pvFrameMoments(const PvMoments &P, const VofMetric &g, double nn[3], double t1[3], double t2[3], double org[3])
Tier 3's fit frame from the TARGET's cached moments: nn = P.n, curvFrame(nn, t1, t2),...
bool ptFitSolve(const PtFit &f, double a[6], bool &red)
Solve the point fit, with the same rank cascade as pvFitSolve.
bool pvTermPolygon(PvTerm &t, const double np[3], const double v[8][3], int nv, const double off[3], const double org[3], const double t1[3], const double t2[3], const double nn[3], double dW, const VofMetric &g)
The POLYGON half of pvFitTerm (design G §5.1a): everything pvFitTerm does after if (nv < 3) return fa...
void pvMomentsBuild(double mx, double my, double mz, double alpha, const VofMetric &g, PvMoments &P)
Build a PvMoments from a cell's PLIC plane (index-space m, alpha) and the cell metric: the physical u...
constexpr double kHfPureEps
The FLOOR of the "this cell is pure" thresholds.
double paraboloidKappa(const double a[6])
Mean curvature (times two) of the paraboloid z = a0 + a1 x + a2 y + a3 x^2 + a4 x y + a5 y^2 at the o...
bool pvTermMoments(PvTerm &t, const PvMoments &P, const double off[3], const double org[3], const double t1[3], const double t2[3], const double nn[3], double dW, double cosMin, const VofMetric &g)
One stencil polygon's PV term from its cached moments (design G §5.1d, "V6"): the same integrals as p...
void pvFitAccum(PvFit &f, const PvTerm &t)
Fold one accepted term (t.ok) into the fit — the accumulation half of pvFitAdd, with its expressions ...
constexpr int kPvHalf
Half-width of the PV fit stencil: S = 2*kPvHalf + 1 = 5, Han et al.'s recommended S.
constexpr double kPtWeightWidth
Wendland support width for the tier-2b height-position fit.
CurvatureBranch
Which branch of the cascade produced a cell's curvature.
@ kCurvHfMixed
tier 2a: standard HF in one of the two remaining directions
@ kCurvNoEstimate
NO estimate: fewer than 3 usable PLIC polygons in the stencil.
@ kCurvPvReduced
tier 3 with the rank-deficient 3-parameter model (a1 = a2 = a4 = 0)
@ kCurvNone
not an interfacial cell — kappa is 0 because there is no interface
@ kCurvHfFit
tier 2b: paraboloid fit to the interface positions of whichever columns ARE consistent,...
@ kCurvPv
tier 3: PLIC-volumetric paraboloid fit, 5^3 Wendland-weighted
@ kCurvHf
tier 1: standard HF in the preferred (largest |n_d|) direction
int plicPolygon(double mx, double my, double mz, double alpha, double v[8][3])
Vertices of the polygon {x in [0,1]^3 : m .
bool pvTermNormal(double mx, double my, double mz, const double t1[3], const double t2[3], const double nn[3], double cosMin, const VofMetric &g, double np[3])
The NORMAL half of pvFitTerm (design G, flow doc/vof_curvature_cost_design.md §5.1a): the n2 > 0 chec...
bool pvFitSolve(const PvFit &f, double a[6], bool &red)
Solve the accumulated PV system.
double hfPatchKappa(const double h[9])
Mean-curvature-times-two from a 3x3 patch of heights, Han et al.
bool hfIsEmpty(double c, double eps)
void pvFitAccumEntry(double &a, const PvTerm &t, int e)
ONE entry e in [0, 27) of the accumulation, for an entry-parallel fold (design G §5....
constexpr double kPvWeightWidth
Wendland support width d in cell units.
void ptFitAdd(PtFit &f, const double X[3], const double org[3], const double t1[3], const double t2[3], const double nn[3], double dW, const VofMetric &g)
Fold one interface point into the fit.
double vofPhysNormalInv(const double m[3], const VofMetric &g, double n[3])
vofPhysNormal in the RECIPROCAL-MULTIPLY form — n = (H^-1 m) * (1/|H^-1 m|), which is what the curvat...
void polygonMoments2d(const double xy[8][2], int nv, double s[6])
The six monomial integrals s = ( |G|, int x, int y, int x^2, int xy, int y^2 ) over the planar polygo...
bool curvSolveSym(const double Ain[6][6], const double bin[6], int n, double x[6], double pivTol)
Solve the symmetric positive-semidefinite n x n system A x = b (n <= 6) by LDL^T with Jacobi (diagona...
bool pvFitAdd(PvFit &f, double mx, double my, double mz, double alpha, const double off[3], const double org[3], const double t1[3], const double t2[3], const double nn[3], double dW, double cosMin, const VofMetric &g)
Fold one stencil cell's PLIC polygon into the fit: pvFitTerm, then pvFitAccum if the polygon is accep...
bool hfColumnHeight(const double *col, int nh, double &h, int &orient, double monoTol, double pureEps=kHfPureEps)
One height from one column of colour values.
void polygonAreaCentroid(const double v[8][3], int nv, double ctr[3], double &area)
Area and centroid of a planar polygon in 3-D (fan triangulation from v[0]).
double wendlandWeight(double r, double d)
Wendland C2 radial basis function, Han et al.
void pvFitFromEntries(PvFit &f, const double ent[kPvEntries], int npoly)
A PvFit from the 27 entries of pvFitAccumEntry (+ npoly); the upper triangle is zero.
Kokkos::View< T *, MemSpace > View
1D device array.
PECLET_HD Vec3< Real > cross(Vec3< Real > a, Vec3< Real > b)
core — PLIC (piecewise-linear interface construction) geometric toolbox: the analytic plane<->volume ...
Accumulator for an ordinary weighted linear least-squares paraboloid through points.
Accumulator for the PV normal equations, Han et al.
The per-cell MOMENT cache entry (design G §5.1d, "V6"): the 3-D area moments of a cell's PLIC polygon...
double m2[6]
int_P Y Y^T dA, in the order xx, yy, zz, xy, xz, yz
double n[3]
unit PHYSICAL normal (vofPhysNormalInv); (0,0,0) if degenerate
double c[3]
physical vertex average (1/nv) sum_k Y_k — the Wendland point
double a
area (physical); 0 when nv < 3 or the normal is degenerate
The per-cell POLYGON cache entry (design G §5.1b, "V5"): plicPolygon's output for one cell's PLIC pla...
double v[8][3]
cell-local [0,1]^3 vertices; slots >= nv unused
int nv
plicPolygon's return value (0 if the normal is degenerate)
double vbar[3]
(sum_k v[k]) * (1/nv) - 0.5; 0 when nv == 0
One stencil cell's PLIC polygon in the PV fit: the parameters of pvFitTerm and pvFitAdd.
The per-axis cell size, in the solver's reference length (hRef), of the cell these kernels map to the...
void toPhys(const double X[3], double out[3]) const
Index displacement -> physical displacement (in hRef): ‘X’_a = h[a] X_a`.