26 struct KernelConsToPrimDust {
27 using Tscal = shambase::VecComponent<Tvec>;
29 inline static void kernel(
42 u32 cell_count = block_count * block_size * ndust;
47 shamsys::instance::get_compute_scheduler_ptr(),
52 const Tscal *__restrict rho_dust,
53 const Tvec *__restrict rhov_dust,
54 Tvec *__restrict vel_dust) {
56 auto d_prim_state = shammath::d_cons_to_prim(d_conststate);
58 vel_dust[i] = d_prim_state.vel;
69 auto edges = get_edges();
71 edges.spans_rho_dust.check_sizes(edges.sizes.indexes);
72 edges.spans_rhov_dust.check_sizes(edges.sizes.indexes);
74 edges.spans_vel_dust.ensure_sizes(edges.sizes.indexes);
76 KernelConsToPrimDust<Tvec>::kernel(
77 edges.spans_rho_dust.get_spans(),
78 edges.spans_rhov_dust.get_spans(),
79 edges.spans_vel_dust.get_spans(),
88 auto block_count = get_ro_edge_base(0).get_tex_symbol();
89 auto rho = get_ro_edge_base(1).get_tex_symbol();
90 auto rhov = get_ro_edge_base(2).get_tex_symbol();
91 auto vel = get_rw_edge_base(0).get_tex_symbol();
93 std::string tex = R
"tex(
94 Conservative to primitive variable (dust)
97 {vel}_{i,j} &= \frac{ {rhov}_{i,j} }{ {rho}_{i,j} } \\
98 i &\in [0,{block_count} * N_{\rm cell/block}) \\
99 j &\in [0,n_{\rm dust}) \\
100 n_{\rm dust} & = {ndust} \\
101 N_{\rm cell/block} & = {block_size}
Field variant object to instanciate a variant on the patch types.
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
Represents a collection of objects distributed across patches identified by a u64 id.
virtual std::string _impl_get_tex() const
get the tex of the node
void _impl_evaluate_internal()
evaluate the node
Represents a span of data within a PatchDataField.
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
This file contain states and Riemann solvers for dust.
A variant of sham::MultiRef for distributed data.