32#define NODE_EDGES(X_RO, X_RW) \
33 X_RO(shamrock::solvergraph::IPatchDataLayerRefs, original) \
34 X_RW(shamrock::solvergraph::IFieldRefs<T>, target)
36namespace shamrock::solvergraph {
39 class CopyPatchDataFieldFromLayer :
public INode {
44 CopyPatchDataFieldFromLayer(
u32 field_idx) : field_idx(field_idx) {}
46 CopyPatchDataFieldFromLayer(
48 : CopyPatchDataFieldFromLayer(layout.
get_field_idx<T>(field_name)) {}
50 CopyPatchDataFieldFromLayer(
51 const std::shared_ptr<shamrock::patch::PatchDataLayerLayout> &layout,
52 const std::string &field_name)
55 EXPAND_NODE_EDGES(NODE_EDGES)
61 auto edges = get_edges();
63 auto source_refs = edges.original.get_const_refs();
72 edges.target.ensure_sizes(sizes);
75 auto target_refs = edges.target.get_refs();
79 dest.overwrite(source.get_field<T>(field_idx), source.
get_obj_cnt());
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
Defines the PatchDataLayerEdge class for managing patch data layer edges.
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.
u32 get_field_idx(const std::string &field_name) const
Get the field id if matching name & type.
PatchDataLayer container class, the layout is described in patchdata_layout.
u32 get_obj_cnt() const
get the number of objects (particles) stored in this layer
void _impl_evaluate_internal()
evaluate the node
std::string _impl_get_tex() const
get the tex of the node
std::string _impl_get_label() const
get the label of the node
This header file contains utility functions related to exception handling in the code.
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...
#define __shamrock_stack_entry()
Macro to create a stack entry.