20namespace shamrock::solvergraph {
26 auto edges = get_edges();
32 sizes.add_obj(id_patch,
u32(field.get_obj_cnt()));
36 edges.target.ensure_sizes(sizes);
40 auto &source_field = edges.original.get_field(id_patch);
41 if (field.get_nvar() != source_field.get_nvar()) {
43 "nvar mismatch between source and target fields for patch "
44 + std::to_string(id_patch)
45 +
". Source nvar: " + std::to_string(source_field.get_nvar())
46 +
", Target nvar: " + std::to_string(field.get_nvar()));
48 field.overwrite(source_field, field.get_obj_cnt());
54 std::string tmp =
"Copy field ${original} to ${target}";
Defines the CopyPatchDataField class for copying fields between patch data field references.
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.
A solver graph node that copies field data from source field references to target fields.
void _impl_evaluate_internal()
Internal implementation of the field copying operation.
std::string _impl_get_tex() const
Returns the LaTeX representation of this node for documentation.
void replace_all(std::string &inout, std::string_view what, std::string_view with)
replace all occurence of a search string with another
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.