31 auto edges = get_edges();
33 auto dev_sched = shamsys::instance::get_compute_scheduler_ptr();
35 edges.mask.check_sizes(edges.part_counts.indexes);
36 edges.field_to_set.ensure_sizes(edges.part_counts.indexes);
38 auto var_counts = edges.part_counts.indexes.template map<u32>([&](
u64,
u32 count) {
47 [val_to_set = this->val_to_set,
48 nvar = this->nvar](
u32 id_var,
const u32 *mask, T *field_to_set) {
49 if (mask[id_var / nvar] != 0) {
50 field_to_set[id_var] = val_to_set;
60 std::string tex = R
"tex(
61 Set the field to a constant value \(c\) where the mask is non-zero
63 {field}_{i,k} &= c \quad \text{if } {mask}_i \neq 0, \quad k = 0, \dots, {nvar} - 1
Header file describing a Node Instance.
Solver graph node overwriting a field with a constant value where a mask is set.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
Overwrite every variable of a field with a constant where the per-object mask is non-zero.
void _impl_evaluate_internal()
evaluate the node
virtual std::string _impl_get_tex() const
get the tex of the node
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 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 sph model modules
This file contains the definition for the stacktrace related functionality.
#define __shamrock_stack_entry()
Macro to create a stack entry.
A variant of sham::MultiRef for distributed data.