26 struct KernelComputeMass {
28 inline static void kernel(
29 const shambase::DistributedData<shamrock::PatchDataFieldSpanPointer<Tscal>>
31 const shambase::DistributedData<shamrock::PatchDataFieldSpanPointer<Tscal>> &spans_rho,
32 shambase::DistributedData<shamrock::PatchDataFieldSpanPointer<Tscal>> &spans_mass,
33 const shambase::DistributedData<u32> &sizes,
36 shambase::DistributedData<u32> cell_counts
38 u32 cell_count = block_count * block_size;
43 shamsys::instance::get_compute_scheduler_ptr(),
44 sham::DDMultiRef{spans_cell_sizes, spans_rho},
45 sham::DDMultiRef{spans_mass},
49 const Tscal *__restrict csize,
50 const Tscal *__restrict rho,
51 Tscal *__restrict mass) {
52 u32 block_id = i / block_size;
53 Tscal dV = csize[block_id];
56 mass[i] = rho[i] * dV;
65 template<
class Tvec,
class Tgr
idVec>
67 auto edges = get_edges();
69 edges.spans_block_cell_sizes.check_sizes(edges.sizes.indexes);
70 edges.spans_rhos.check_sizes(edges.sizes.indexes);
72 edges.spans_mass.ensure_sizes(edges.sizes.indexes);
74 KernelComputeMass<Tscal>::kernel(
75 edges.spans_block_cell_sizes.get_spans(),
76 edges.spans_rhos.get_spans(),
77 edges.spans_mass.get_spans(),
82 template<
class Tvec,
class Tgr
idVec>
84 std::string tex = R
"tex(
88 {spans_mass}_i &= {spans_rhos}_i {spans_block_cell_sizes}_i^3 \\
89 i &\in [0,{sizes} * N_{\rm cell/block}) \\
90 N_{\rm cell/block} & = {block_size}
94 replace_edges_tex_symbols(tex);
constexpr const char * sizes
Temporary sizes for h-iteration.
Header file describing a Node Instance.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
void _impl_evaluate_internal()
evaluate the node
virtual std::string _impl_get_tex() const
get the tex of the node
void distributed_data_kernel_call(sham::DeviceScheduler_ptr dev_sched, RefIn in, RefOut in_out, const shambase::DistributedData< index_t > &thread_counts, Functor &&func)
A variant of sham::kernel_call for distributed data.
void replace_all(std::string &inout, std::string_view what, std::string_view with)
replace all occurence of a search string with another
namespace for the basegodunov model modules
Umbrella header pulling in the gas states and all gas Riemann solvers (Rusanov, HLL,...