30#define NODE_EDGES(X_RO, X_RW) \
32 X_RO(shamrock::solvergraph::ScalarEdge<std::vector<Tscal>>, t_j_0) \
35 X_RO(shamrock::solvergraph::Indexes<u32>, part_counts) \
38 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, t_j)
45 using Tscal = shambase::VecComponent<Tvec>;
48 std::unique_ptr<sham::DeviceBuffer<Tscal>> t_j_0;
51 SetDustStoppingTimeConstant(
u32 ndust) : ndust(ndust) {}
53 EXPAND_NODE_EDGES(NODE_EDGES)
59 auto edges = get_edges();
61 auto &part_counts = edges.part_counts.indexes;
62 const std::vector<Tscal> &inputs_tj = edges.t_j_0.value;
66 edges.t_j.ensure_sizes(part_counts);
69 t_j_0 = std::make_unique<sham::DeviceBuffer<Tscal>>(
70 ndust, shamsys::instance::get_compute_scheduler_ptr());
73 t_j_0->copy_from_stdvec(inputs_tj);
75 auto &q = shamsys::instance::get_compute_scheduler().get_queue();
77 part_counts.for_each([&](
u64 id,
u32 count) {
86 = ndust](
u32 thread_id,
const Tscal *__restrict t_j_0, Tscal *__restrict t_j) {
87 u32 jdust = thread_id % ndust;
88 t_j[thread_id] = t_j_0[jdust];
94 return "SetDustStoppingTimeConstant";
103 std::string tex = R
"tex(
104 SetDustStoppingTimeConstant
107 {t_j}_{i,j} &= {t_j_0}_j \\
108 i &\in [0,{part_counts}) \\
Header file describing a Node Instance.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
#define SHAM_ASSERT(x)
Shorthand for SHAM_ASSERT_NAMED without a message.
void _impl_evaluate_internal()
evaluate the node
virtual std::string _impl_get_label() const
get the label of the node
virtual std::string _impl_get_tex() const
get the tex of the node
Inode is node between data edges, takes multiple inputs, multiple outputs.
IEdge & get_rw_edge_base(int slot)
Get a reference to a read write edge and cast it to the type IEdge.
const IEdge & get_ro_edge_base(int slot)
Get a reference to a read only edge.
void kernel_call(sham::DeviceQueue &q, RefIn in, RefOut in_out, u32 n, Functor &&func, SourceLocation &&callsite=SourceLocation{})
Submit a kernel to a SYCL queue.
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 sph model modules
#define __shamrock_stack_entry()
Macro to create a stack entry.
A class that references multiple buffers or similar objects.