22#ifndef PECLET_CORE_AMR_CSR_HPP
23#define PECLET_CORE_AMR_CSR_HPP
54template <
class CountFn>
56 View<Index> start(Kokkos::view_alloc(
"peclet::core::amr::csr_off", Kokkos::WithoutInitializing),
57 static_cast<std::size_t
>(n) + 1);
58 Kokkos::parallel_scan(
59 "peclet::core::amr::csr_off_scan", n + 1,
66 Kokkos::deep_copy(
nTotal, Kokkos::subview(start, n));
91 View<Index> start(Kokkos::view_alloc(
"peclet::core::amr::csr_start", Kokkos::WithoutInitializing),
92 static_cast<std::size_t
>(n) + 1);
93 Kokkos::parallel_scan(
94 "peclet::core::amr::csr_scan", n + 1,
106 Kokkos::deep_copy(
csr.nFaces, Kokkos::subview(start, n));
109 View<Index>(Kokkos::view_alloc(
"peclet::core::amr::csr_nbr", Kokkos::WithoutInitializing),
110 static_cast<std::size_t
>(
csr.nFaces));
112 View<double>(Kokkos::view_alloc(
"peclet::core::amr::csr_coef", Kokkos::WithoutInitializing),
113 static_cast<std::size_t
>(
csr.nFaces));
116 Kokkos::parallel_for(
Csr buildFaceCsr(Index n, const Emit &emit)
Build a face-CSR on device from a per-cell emit functor.
View< Index > scanOffsets(Index n, const CountFn &countFn, Index &nTotal)
CSR row offsets (size n+1) from a per-cell count functor, via one exclusive prefix scan,...
Kokkos::View< T *, MemSpace > View
1D device array.
std::int64_t Index
Signed index type for grids and particles (supersedes block_decomposer's long int IndxT).
Sink passed to the emit functor during the COUNT pass: just tallies faces.
void operator()(Index, double)
Sink passed to the emit functor during the FILL pass: writes each face into the cell's own slice [sta...
void operator()(Index j, double c)
An assembled face-CSR: row offsets (size n+1), neighbour index + coefficient per face (size nFaces).
View< double > coef
coefficient per face, size nFaces
View< Index > nbr
neighbour leaf per face, size nFaces
View< Index > start
CSR row offsets, size n+1; start(n) == nFaces.