20#ifndef PECLET_VORO_SDF_HPP
21#define PECLET_VORO_SDF_HPP
23#include <Kokkos_Core.hpp>
27#include "peclet/core/common/view.hpp"
28#include "peclet/core/geom/primitives.hpp"
29#include "peclet/core/geom/scene.hpp"
49template <
class T,
class =
void>
53 : std::bool_constant<T::kTangentOnly> {};
64 KOKKOS_INLINE_FUNCTION Real
eval(Real x, Real y, Real z)
const {
65 return peclet::core::geom::prim::Sphere<Real>{
radius}.eval(
66 peclet::core::Vec3<Real>{x -
cx, y -
cy, z -
cz});
68 KOKKOS_INLINE_FUNCTION Real
gradH()
const {
return Real(1e-4); }
77 Real
cx = 0,
cy = 0,
cz = 0,
hx = Real(0.5),
hy = Real(0.5),
hz = Real(0.5);
78 KOKKOS_INLINE_FUNCTION Real
eval(Real x, Real y, Real z)
const {
79 return peclet::core::geom::prim::Box<Real>{
hx,
hy,
hz}.eval(
80 peclet::core::Vec3<Real>{x -
cx, y -
cy, z -
cz});
82 KOKKOS_INLINE_FUNCTION Real
gradH()
const {
return Real(1e-4); }
95 KOKKOS_INLINE_FUNCTION Real
eval(Real x, Real y, Real z)
const {
96 Real d[3] = {x -
cx, y -
cy, z -
cz};
97 int a0 = (
axis + 1) % 3, a1 = (
axis + 2) % 3;
98 Real r = Kokkos::sqrt(d[a0] * d[a0] + d[a1] * d[a1]);
99 return peclet::core::geom::prim::HollowCylinderShell<Real>{
rOuter,
rInner,
height}.evalRZ(
102 KOKKOS_INLINE_FUNCTION Real
gradH()
const {
return Real(1e-4); }
120 Kokkos::View<const float*, peclet::core::MemSpace>
values;
121 peclet::core::geom::GridDesc<Real>
desc{};
131 Kokkos::View<const float*, peclet::core::MemSpace> v,
int nx,
int ny,
int nz, Real ox,
132 Real oy, Real oz, Real sx, Real sy, Real sz) {
139 g.
desc.origin = peclet::core::Vec3<Real>{ox, oy, oz};
140 g.
desc.invSpacing = peclet::core::Vec3<Real>{sx != Real(0) ? Real(1) / sx : Real(0),
141 sy != Real(0) ? Real(1) / sy : Real(0),
142 sz != Real(0) ? Real(1) / sz : Real(0)};
143 g.
desc.extension = peclet::core::geom::GridExtension::kClamp;
147 KOKKOS_INLINE_FUNCTION Real
eval(Real x, Real y, Real z)
const {
148 return peclet::core::geom::sampleGrid(peclet::core::Vec3<Real>{x, y, z},
desc,
values);
150 KOKKOS_INLINE_FUNCTION Real
gradH()
const {
152 const Real ix =
desc.invSpacing.x, iy =
desc.invSpacing.y, iz =
desc.invSpacing.z;
153 Real mx = ix > iy ? ix : iy;
154 mx = mx > iz ? mx : iz;
155 return mx > Real(0) ? Real(0.25) / mx : Real(1e-4);
170 Kokkos::View<const peclet::core::geom::ShapeNode<Real>*, peclet::core::MemSpace>
nodes;
171 Kokkos::View<const peclet::core::geom::GridDesc<Real>*, peclet::core::MemSpace>
grids;
172 Kokkos::View<const float*, peclet::core::MemSpace>
samples;
177 KOKKOS_INLINE_FUNCTION Real
eval(Real x, Real y, Real z)
const {
181 KOKKOS_INLINE_FUNCTION Real
gradH()
const {
return h; }
190template <
class Real,
class Mem = peclet::core::MemSpace>
192 Kokkos::View<const Real*, Mem>
cen;
193 Kokkos::View<const Real*, Mem>
rad;
196 KOKKOS_INLINE_FUNCTION Real
eval(Real x, Real y, Real z)
const {
198 for (
int i = 0; i <
n; ++i) {
199 Real dx = x -
cen(3 * i), dy = y -
cen(3 * i + 1), dz = z -
cen(3 * i + 2);
201 dx -=
L * Kokkos::round(dx /
L);
202 dy -=
L * Kokkos::round(dy /
L);
203 dz -=
L * Kokkos::round(dz /
L);
205 const Real d = Kokkos::sqrt(dx * dx + dy * dy + dz * dz) -
rad(i);
211 KOKKOS_INLINE_FUNCTION Real
gradH()
const {
return Real(1e-4); }
215template <
class Real,
class Sdf>
216KOKKOS_INLINE_FUNCTION
void sdfGradient(
const Sdf& s, Real x, Real y, Real z, Real g[3]) {
217 const Real h = s.gradH();
218 g[0] = (s.eval(x + h, y, z) - s.eval(x - h, y, z)) / (2 * h);
219 g[1] = (s.eval(x, y + h, z) - s.eval(x, y - h, z)) / (2 * h);
220 g[2] = (s.eval(x, y, z + h) - s.eval(x, y, z - h)) / (2 * h);
225template <
class Real,
class Sdf>
226KOKKOS_INLINE_FUNCTION
void sdfHessian(
const Sdf& s, Real x, Real y, Real z, Real H[3][3]) {
227 const Real h = s.gradH();
229 sdfGradient<Real>(s, x + h, y, z, gp);
230 sdfGradient<Real>(s, x - h, y, z, gm);
231 for (
int r = 0; r < 3; ++r)
232 H[r][0] = (gp[r] - gm[r]) / (2 * h);
233 sdfGradient<Real>(s, x, y + h, z, gp);
234 sdfGradient<Real>(s, x, y - h, z, gm);
235 for (
int r = 0; r < 3; ++r)
236 H[r][1] = (gp[r] - gm[r]) / (2 * h);
237 sdfGradient<Real>(s, x, y, z + h, gp);
238 sdfGradient<Real>(s, x, y, z - h, gm);
239 for (
int r = 0; r < 3; ++r)
240 H[r][2] = (gp[r] - gm[r]) / (2 * h);
241 for (
int a = 0; a < 3; ++a)
242 for (
int b = a + 1; b < 3; ++b) {
243 const Real m = Real(0.5) * (H[a][b] + H[b][a]);
244 H[a][b] = H[b][a] = m;
252template <
class Real,
class Sdf>
253KOKKOS_INLINE_FUNCTION
void sdfWallChain(
const Sdf& sdf, Real x, Real y, Real z,
const double gw[3],
255 if constexpr (std::is_same_v<Sdf, NoSdf>) {
264 if (gw[0] == 0.0 && gw[1] == 0.0 && gw[2] == 0.0)
267 sdfGradient<Real>(sdf, x, y, z, gg);
269 Kokkos::sqrt((
double)gg[0] * gg[0] + (
double)gg[1] * gg[1] + (
double)gg[2] * gg[2]);
272 const double u0 = gg[0] / gn, u1 = gg[1] / gn, u2 = gg[2] / gn;
273 const double ug = u0 * gw[0] + u1 * gw[1] + u2 * gw[2];
274 const double p0 = gw[0] - ug * u0, p1 = gw[1] - ug * u1, p2 = gw[2] - ug * u2;
276 sdfHessian<Real>(sdf, x, y, z, Hm);
277 const double Hp0 = Hm[0][0] * p0 + Hm[0][1] * p1 + Hm[0][2] * p2;
278 const double Hp1 = Hm[1][0] * p0 + Hm[1][1] * p1 + Hm[1][2] * p2;
279 const double Hp2 = Hm[2][0] * p0 + Hm[2][1] * p1 + Hm[2][2] * p2;
280 const double cH = (double)sdf.eval(x, y, z) / gn;
281 fSelf[0] += -ug * u0 - cH * Hp0;
282 fSelf[1] += -ug * u1 - cH * Hp1;
283 fSelf[2] += -ug * u2 - cH * Hp2;
296template <
class Real,
int MAXP,
int MAXT,
bool TrackAdj,
class Sdf>
298 const Real seed[3],
const Sdf& sdf,
const Real* gx,
299 const Real* gy,
const Real* gz, Real fSelf[3]) {
300 if constexpr (std::is_same_v<Sdf, NoSdf>) {
311 Real gw[3] = {Real(0), Real(0), Real(0)};
313 for (
int k = 0; k < c.
np; ++k)
325 const double gwd[3] = {(double)gw[0], (
double)gw[1], (double)gw[2]};
326 double fw[3] = {0.0, 0.0, 0.0};
327 sdfWallChain<Real>(sdf, seed[0], seed[1], seed[2], gwd, fw);
328 for (
int d = 0; d < 3; ++d)
329 fSelf[d] += (Real)fw[d];
355 Kokkos::View<Real*, MemSpace>
rec;
356 Kokkos::View<int*, MemSpace>
cnt;
359 rec = Kokkos::View<Real*, MemSpace>(
360 Kokkos::view_alloc(std::string(
"wall.rec"), Kokkos::WithoutInitializing),
361 (
size_t)n *
kMax * 4);
362 cnt = Kokkos::View<int*, MemSpace>(
"wall.cnt", n);
364 KOKKOS_INLINE_FUNCTION
bool active()
const {
return cnt.extent(0) > 0; }
368 template <
class Cell>
369 KOKKOS_INLINE_FUNCTION
int save(
int i,
const Cell& c)
const {
373 for (
int k = 6; k < c.np && r <
kMax; ++k) {
376 const Real h = Kokkos::sqrt(c.nn[k]);
377 const Real ih = h > Real(0) ? Real(1) / h : Real(0);
378 const size_t o = ((size_t)i *
kMax + r) * 4;
379 rec(o + 0) = c.n[k][0] * ih;
380 rec(o + 1) = c.n[k][1] * ih;
381 rec(o + 2) = c.n[k][2] * ih;
392 template <
class Cell>
393 KOKKOS_INLINE_FUNCTION
bool load(
int i, Cell& c, Real dx, Real dy, Real dz)
const {
398 const int nrec =
cnt(i);
399 for (
int k = 6; k < c.np; ++k) {
406 const size_t o = ((size_t)i *
kMax + r) * 4;
407 const Real ux =
rec(o + 0), uy =
rec(o + 1), uz =
rec(o + 2);
408 const Real h =
rec(o + 3) - (ux * dx + uy * dy + uz * dz);
437template <
class Real,
int MAXP,
int MAXT,
bool TrackAdj,
class Sdf>
439 const Real seed[3],
const Sdf& sdf,
const int* planes,
440 const Real* tangency,
int nPlanes, Real* delta) {
443 for (
int q = 0; q < nPlanes; ++q) {
445 const int k = planes[q];
448 Real fx[Cell::MAXFV], fy[Cell::MAXFV], fz[Cell::MAXFV];
452 const Real hk = Kokkos::sqrt(c.
nn[k]);
455 const Real u[3] = {c.
n[k][0] / hk, c.
n[k][1] / hk, c.
n[k][2] / hk};
456 const Real* surf = tangency + 3 * q;
457 const Real p0[3] = {surf[0] - seed[0], surf[1] - seed[1], surf[2] - seed[2]};
458 Real A = 0, M[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
459 for (
int i = 0; i < m; ++i) {
460 const int j = (i + 1) % m;
461 const Real a[3] = {fx[i] - p0[0], fy[i] - p0[1], fz[i] - p0[2]};
462 const Real b[3] = {fx[j] - p0[0], fy[j] - p0[1], fz[j] - p0[2]};
463 const Real cr[3] = {a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2],
464 a[0] * b[1] - a[1] * b[0]};
465 const Real At = Real(0.5) * (cr[0] * u[0] + cr[1] * u[1] + cr[2] * u[2]);
467 const Real sm[3] = {a[0] + b[0], a[1] + b[1], a[2] + b[2]};
468 const Real w = At / Real(12);
469 for (
int r = 0; r < 3; ++r)
470 for (
int qq = 0; qq < 3; ++qq)
471 M[r][qq] += w * (a[r] * a[qq] + b[r] * b[qq] + sm[r] * sm[qq]);
475 for (
int r = 0; r < 3; ++r)
476 for (
int qq = 0; qq < 3; ++qq)
477 M[r][qq] = -M[r][qq];
482 sdfGradient<Real>(sdf, surf[0], surf[1], surf[2], g);
483 const Real gn = Kokkos::sqrt(g[0] * g[0] + g[1] * g[1] + g[2] * g[2]);
487 sdfHessian<Real>(sdf, surf[0], surf[1], surf[2], H);
489 for (
int r = 0; r < 3; ++r)
490 for (
int qq = 0; qq < 3; ++qq)
491 tr += H[r][qq] * M[r][qq];
492 Real d = Real(0.5) * tr / gn / A;
493 if (d < Real(-0.5) * hk)
495 if (Kokkos::fabs(d) < Real(1e-8) * hk)
511template <
class Real,
int MAXP,
int MAXT,
bool TrackAdj,
class Sdf>
513 const Real seed[3],
const Sdf& sdf,
const Real probe[3],
514 Real radius, Real pv[3], Real& off, Real surf[3]) {
517 sdfGradient<Real>(sdf, probe[0], probe[1], probe[2], g);
518 const Real gsq = g[0] * g[0] + g[1] * g[1] + g[2] * g[2];
521 const Real phi = sdf.eval(probe[0], probe[1], probe[2]);
522 const Real invGsq = Real(1) / gsq, gn = Kokkos::sqrt(gsq), invG = Real(1) / gn;
524 for (
int k = 0; k < 3; ++k) {
525 surf[k] = probe[k] - phi * g[k] * invGsq;
526 normal[k] = g[k] * invG;
529 Real eps = Real(1e-3) * (radius + Real(1));
530 if (eps < Real(1e-6))
532 if (sdf.eval(surf[0] + eps * normal[0], surf[1] + eps * normal[1], surf[2] + eps * normal[2]) <=
534 for (
int k = 0; k < 3; ++k)
535 normal[k] = -normal[k];
539 off = pv[0] * (surf[0] - seed[0]) + pv[1] * (surf[1] - seed[1]) + pv[2] * (surf[2] - seed[2]);
551template <
class Real,
int MAXP,
int MAXT,
bool TrackAdj,
class Sdf>
553 const Real seed[3],
const Sdf& sdf) {
554 const Real tol = Real(1e-8);
555 const Real phiCenter = sdf.eval(seed[0], seed[1], seed[2]);
556 if (phiCenter <= Real(0))
559 const Real radius = Kokkos::sqrt(maxRsq > 0 ? maxRsq : Real(0));
560 if (phiCenter > radius + tol)
568 Real pv[3], off, surf[3];
569 if (
sdfCutPlane(c, seed, sdf, seed, radius, pv, off, surf) && off > Real(0))
570 for (
int t = 0; t < c.
nt; ++t) {
573 if (pv[0] * c.
vx[t] + pv[1] * c.
vy[t] + pv[2] * c.
vz[t] > off)
578 for (
int t = 0; t < c.
nt; ++t) {
581 if (sdf.eval(seed[0] + c.
vx[t], seed[1] + c.
vy[t], seed[2] + c.
vz[t]) < -tol)
598template <
class Real,
int MAXP,
int MAXT,
bool TrackAdj,
class Sdf>
600 const Real seed[3],
const Sdf& sdf) {
601 const Real tol = Real(1e-8);
602 const int maxCuts = 24;
603 const Real phiCenter = sdf.eval(seed[0], seed[1], seed[2]);
604 if (phiCenter <= Real(0)) {
605 for (
int t = 0; t < c.
nt; ++t)
611 const Real radius = Kokkos::sqrt(maxRsq > 0 ? maxRsq : Real(0));
612 if (phiCenter > radius + tol)
616 if (c.
np + maxCuts > MAXP)
624 if constexpr (kSagitta)
630 bool seedPlaneApplied =
false;
631 for (
int iter = 0; iter < maxCuts; ++iter) {
632 Real probe[3] = {seed[0], seed[1], seed[2]};
633 Real probePhi = phiCenter;
634 if (seedPlaneApplied) {
636 for (
int t = 0; t < c.
nt; ++t) {
639 Real x = seed[0] + c.
vx[t], y = seed[1] + c.
vy[t], z = seed[2] + c.
vz[t];
640 Real phi = sdf.eval(x, y, z);
641 if (!found || phi < probePhi) {
649 if (!found || probePhi >= -tol)
655 Real pv[3], off, surf[3];
656 if (!
sdfCutPlane(c, seed, sdf, probe, radius, pv, off, surf))
658 if (off <= Real(0)) {
668 if (!seedPlaneApplied) {
669 seedPlaneApplied =
true;
672 Real d[3] = {probe[0] - seed[0], probe[1] - seed[1], probe[2] - seed[2]};
673 const Real len = Kokkos::sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
676 for (
int k = 0; k < 3; ++k)
678 Real lo = Real(0), hi = len;
679 for (
int it2 = 0; it2 < 40; ++it2) {
680 const Real mid = Real(0.5) * (lo + hi);
681 const Real ph = sdf.eval(seed[0] + mid * d[0], seed[1] + mid * d[1], seed[2] + mid * d[2]);
687 const Real t = Real(0.5) * (lo + hi);
692 for (
int k = 0; k < 3; ++k) {
693 tpPv[3 * nTp + k] = d[k];
694 tpSurf[3 * nTp + k] = Real(0);
704 seedPlaneApplied =
true;
709 tpPlane[nTp] = c.
np - 1;
710 for (
int k = 0; k < 3; ++k) {
711 tpSurf[3 * nTp + k] = surf[k];
712 tpPv[3 * nTp + k] = pv[k];
717 }
else if (iter > 0) {
721 if constexpr (kSagitta) {
722 if (nTp > 0 && !c.
empty()) {
727 for (
int q = 0; q < nTp; ++q) {
728 const Real pv2[3] = {tpPv[3 * q], tpPv[3 * q + 1], tpPv[3 * q + 2]};
747template <
class Real,
int MAXP,
int MAXT,
bool TrackAdj,
class Sdf>
749 const Real seed[3],
const Sdf& sdf, Real h, Real dV[3],
751 for (
int d = 0; d < 3; ++d) {
753 for (
int s = 0; s < 2; ++s) {
755 Real sd[3] = {seed[0], seed[1], seed[2]};
756 sd[d] += (s == 0 ? h : -h);
757 clipCellAgainstSdf<Real, MAXP, MAXT, TrackAdj>(c, sd, sdf);
760 for (
int k = 0; k < c.
np; ++k)
765 for (
int k = 0; k < c.
np; ++k)
770 dV[d] = (vpm[0] - vpm[1]) / (Real(2) * h);
771 dA[d] = (apm[0] - apm[1]) / (Real(2) * h);
KOKKOS_INLINE_FUNCTION Dual< Real, K > dnum(Real c)
Definition convex_cell.hpp:53
constexpr bool tangentOnly_v
Definition sdf.hpp:55
Device-native Voronoi tessellation, geometry and finite-volume physics.
Definition convex_cell.hpp:41
KOKKOS_INLINE_FUNCTION void sdfHessian(const Sdf &s, Real x, Real y, Real z, Real H[3][3])
Definition sdf.hpp:226
KOKKOS_INLINE_FUNCTION bool sdfWouldClip(const ConvexCell< Real, MAXP, MAXT, TrackAdj > &c, const Real seed[3], const Sdf &sdf)
Definition sdf.hpp:552
KOKKOS_INLINE_FUNCTION void addSdfWallForce(const ConvexCell< Real, MAXP, MAXT, TrackAdj > &c, const Real seed[3], const Sdf &sdf, const Real *gx, const Real *gy, const Real *gz, Real fSelf[3])
Definition sdf.hpp:297
constexpr int kMaxWallPlanes
Definition sdf.hpp:335
KOKKOS_INLINE_FUNCTION void sdfWallFD(const ConvexCell< Real, MAXP, MAXT, TrackAdj > &unclipped, const Real seed[3], const Sdf &sdf, Real h, Real dV[3], Real dA[3])
Definition sdf.hpp:748
constexpr int kBoundaryFacet
Definition sdf.hpp:36
KOKKOS_INLINE_FUNCTION bool clipCellAgainstSdf(ConvexCell< Real, MAXP, MAXT, TrackAdj > &c, const Real seed[3], const Sdf &sdf)
Definition sdf.hpp:599
KOKKOS_INLINE_FUNCTION void sdfGradient(const Sdf &s, Real x, Real y, Real z, Real g[3])
Central-difference gradient of any provider with eval() (matches peclet::core::geom::gradient).
Definition sdf.hpp:216
KOKKOS_INLINE_FUNCTION int sdfSagittaShifts(const ConvexCell< Real, MAXP, MAXT, TrackAdj > &c, const Real seed[3], const Sdf &sdf, const int *planes, const Real *tangency, int nPlanes, Real *delta)
Definition sdf.hpp:438
KOKKOS_INLINE_FUNCTION void sdfWallChain(const Sdf &sdf, Real x, Real y, Real z, const double gw[3], double fSelf[3])
Definition sdf.hpp:253
KOKKOS_INLINE_FUNCTION bool sdfCutPlane(const ConvexCell< Real, MAXP, MAXT, TrackAdj > &c, const Real seed[3], const Sdf &sdf, const Real probe[3], Real radius, Real pv[3], Real &off, Real surf[3])
Definition sdf.hpp:512
Definition convex_cell.hpp:140
KOKKOS_INLINE_FUNCTION Real volumePerVertex() const
Definition convex_cell.hpp:1192
KOKKOS_INLINE_FUNCTION int compactPlanes()
Definition convex_cell.hpp:548
KOKKOS_INLINE_FUNCTION void facetAreasPerVertex(Real *area) const
Definition convex_cell.hpp:1241
bool overflow
set if MAXP/MAXT exceeded -> cell invalid, caller falls back
Definition convex_cell.hpp:157
int nt
triangle high-water mark
Definition convex_cell.hpp:156
Real nn[MAXP]
cached n·n, i.e. the half-space offset (so the cull test is n·x <= nn)
Definition convex_cell.hpp:150
Real n[MAXP][3]
Definition convex_cell.hpp:147
KOKKOS_INLINE_FUNCTION int faceOrdered(int k, Real fx[MAXFV], Real fy[MAXFV], Real fz[MAXFV]) const
Definition convex_cell.hpp:1004
Real vy[MAXT]
Definition convex_cell.hpp:154
KOKKOS_INLINE_FUNCTION bool empty() const
Definition convex_cell.hpp:896
int pnbr[MAXP]
neighbour seed id per plane (<0 => bounding box)
Definition convex_cell.hpp:151
KOKKOS_INLINE_FUNCTION Real maxVertexRsq() const
Largest squared dual-vertex radius over live triangles (drives the security radius).
Definition convex_cell.hpp:591
Real vx[MAXT]
Definition convex_cell.hpp:154
int np
number of planes
Definition convex_cell.hpp:152
KOKKOS_INLINE_FUNCTION bool clip(const Real pdir[3], Real d, int nbr, Real *gapOut=nullptr)
Definition convex_cell.hpp:688
bool alive[MAXT]
triangle live flag
Definition convex_cell.hpp:155
Real vz[MAXT]
cached dual-vertex position per triangle
Definition convex_cell.hpp:154
Sentinel "no geometry" provider — the default; the clip stage is skipped.
Definition sdf.hpp:39
Real hx
Definition sdf.hpp:77
KOKKOS_INLINE_FUNCTION Real gradH() const
Definition sdf.hpp:82
Real cz
Definition sdf.hpp:77
Real cy
Definition sdf.hpp:77
Real cx
Definition sdf.hpp:77
Real hz
Definition sdf.hpp:77
Real hy
Definition sdf.hpp:77
KOKKOS_INLINE_FUNCTION Real eval(Real x, Real y, Real z) const
Definition sdf.hpp:78
Kokkos::View< const float *, peclet::core::MemSpace > values
Definition sdf.hpp:120
static KOKKOS_INLINE_FUNCTION SdfGrid fromSpacing(Kokkos::View< const float *, peclet::core::MemSpace > v, int nx, int ny, int nz, Real ox, Real oy, Real oz, Real sx, Real sy, Real sz)
Definition sdf.hpp:130
peclet::core::geom::GridDesc< Real > desc
Definition sdf.hpp:121
KOKKOS_INLINE_FUNCTION Real gradH() const
Definition sdf.hpp:150
KOKKOS_INLINE_FUNCTION Real eval(Real x, Real y, Real z) const
Definition sdf.hpp:147
KOKKOS_INLINE_FUNCTION Real gradH() const
Definition sdf.hpp:102
Real cx
Definition sdf.hpp:93
Real rInner
Definition sdf.hpp:93
int axis
Definition sdf.hpp:94
Real height
Definition sdf.hpp:93
Real cy
Definition sdf.hpp:93
Real rOuter
Definition sdf.hpp:93
Real cz
Definition sdf.hpp:93
KOKKOS_INLINE_FUNCTION Real eval(Real x, Real y, Real z) const
Definition sdf.hpp:95
KOKKOS_INLINE_FUNCTION Real gradH() const
Definition sdf.hpp:181
int nodeCount
Definition sdf.hpp:173
int root
Definition sdf.hpp:174
KOKKOS_INLINE_FUNCTION Real eval(Real x, Real y, Real z) const
Definition sdf.hpp:177
Kokkos::View< const float *, peclet::core::MemSpace > samples
Definition sdf.hpp:172
Kokkos::View< const peclet::core::geom::GridDesc< Real > *, peclet::core::MemSpace > grids
Definition sdf.hpp:171
Kokkos::View< const peclet::core::geom::ShapeNode< Real > *, peclet::core::MemSpace > nodes
Definition sdf.hpp:170
Real h
Definition sdf.hpp:175
Real radius
Definition sdf.hpp:63
Real cy
Definition sdf.hpp:63
Real cz
Definition sdf.hpp:63
KOKKOS_INLINE_FUNCTION Real gradH() const
Definition sdf.hpp:68
KOKKOS_INLINE_FUNCTION Real eval(Real x, Real y, Real z) const
Definition sdf.hpp:64
Real cx
Definition sdf.hpp:63
int n
Definition sdf.hpp:194
Real L
Definition sdf.hpp:195
KOKKOS_INLINE_FUNCTION Real eval(Real x, Real y, Real z) const
Definition sdf.hpp:196
Kokkos::View< const Real *, Mem > cen
Definition sdf.hpp:192
KOKKOS_INLINE_FUNCTION Real gradH() const
Definition sdf.hpp:211
Kokkos::View< const Real *, Mem > rad
Definition sdf.hpp:193
static constexpr bool kTangentOnly
Definition sdf.hpp:46
peclet::core::MemSpace MemSpace
Definition sdf.hpp:353
void alloc(int n)
Definition sdf.hpp:358
KOKKOS_INLINE_FUNCTION bool active() const
Definition sdf.hpp:364
KOKKOS_INLINE_FUNCTION int save(int i, const Cell &c) const
Definition sdf.hpp:369
Kokkos::View< int *, MemSpace > cnt
Definition sdf.hpp:356
static constexpr int kMax
Definition sdf.hpp:354
Kokkos::View< Real *, MemSpace > rec
Definition sdf.hpp:355
KOKKOS_INLINE_FUNCTION bool load(int i, Cell &c, Real dx, Real dy, Real dz) const
Definition sdf.hpp:393