57 const TessGrid<Real>& grid,
const Kokkos::View<int*, peclet::core::MemSpace>& indices,
58 int nSubset,
const Kokkos::View<int*, peclet::core::MemSpace>& outNp,
59 const Kokkos::View<int*, peclet::core::MemSpace>& outNt,
60 const Kokkos::View<int*, peclet::core::MemSpace>& outPnbr,
61 const Kokkos::View<unsigned*, peclet::core::MemSpace>& outTri,
62 const Kokkos::View<Real*, peclet::core::MemSpace>& cellVol,
63 const Kokkos::View<unsigned char*, peclet::core::MemSpace>& outPoke4 = {}, Sdf sdf = {},
64 bool withForceGeom =
false, WallStore<Real> outWall = {},
65 Kokkos::View<int*, peclet::core::MemSpace> outNear = {},
66 Kokkos::View<int*, peclet::core::MemSpace> outNearCnt = {},
int nearCap = 0,
67 Real nearMargin = Real(0)) {
68 using peclet::core::MemSpace;
69 using Exec = peclet::core::ExecSpace;
70 using Builder = CellBuilder<Real, Weighted, Sdf, TrackAdj>;
72 using Kokkos::view_alloc;
73 using Kokkos::WithoutInitializing;
77 Real wMaxAll = Real(0);
78 if constexpr (Weighted) {
79 if (grid.
wSorted.extent(0) ==
static_cast<size_t>(N)) {
81 Kokkos::parallel_reduce(
82 "subset.wmax", Kokkos::RangePolicy<Exec>(0, N),
83 KOKKOS_LAMBDA(
int idx, Real& m) { m = ws(idx) > m ? ws(idx) : m; },
84 Kokkos::Max<Real>(wMaxAll));
88 SubsetGatherResult<Real> res;
89 res.status = Kokkos::View<int*, MemSpace>(
"subset.status", N);
95 Kokkos::View<int*, MemSpace> facetCount(
"subset.facetCount", N);
96 Kokkos::View<int*, MemSpace> cellFacetBase(
"subset.cellFacetBase", N);
99 const size_t facetCap = (size_t)(nSubset > 0 ? nSubset : 1) * (size_t)Builder::MAXF_TMP;
100 Kokkos::View<int*, MemSpace> oNbr(view_alloc(std::string(
"subset.oNbr"), WithoutInitializing),
102 Kokkos::View<Real*, MemSpace> oArea(view_alloc(std::string(
"subset.oArea"), WithoutInitializing),
104 Kokkos::View<Real*, MemSpace> oDV(view_alloc(std::string(
"subset.oDV"), WithoutInitializing),
106 Kokkos::View<Real*, MemSpace> oConn(view_alloc(std::string(
"subset.oConn"), WithoutInitializing),
108 Kokkos::View<int*, MemSpace> facetCursor(
"subset.facetCursor", 1);
111 Kokkos::View<int*, MemSpace> noCand, noCandCnt;
175 auto slotOf = grid.
slotOf;
177 Kokkos::parallel_for(
178 "subset.build", Kokkos::RangePolicy<Exec>(0, nSubset), KOKKOS_LAMBDA(
const int s) {
179 const int i = idx(s);
SubsetGatherResult< Real > subsetGather(const TessGrid< Real > &grid, const Kokkos::View< int *, peclet::core::MemSpace > &indices, int nSubset, const Kokkos::View< int *, peclet::core::MemSpace > &outNp, const Kokkos::View< int *, peclet::core::MemSpace > &outNt, const Kokkos::View< int *, peclet::core::MemSpace > &outPnbr, const Kokkos::View< unsigned *, peclet::core::MemSpace > &outTri, const Kokkos::View< Real *, peclet::core::MemSpace > &cellVol, const Kokkos::View< unsigned char *, peclet::core::MemSpace > &outPoke4={}, Sdf sdf={}, bool withForceGeom=false, WallStore< Real > outWall={}, Kokkos::View< int *, peclet::core::MemSpace > outNear={}, Kokkos::View< int *, peclet::core::MemSpace > outNearCnt={}, int nearCap=0, Real nearMargin=Real(0))
Definition subset_gather.hpp:56