26namespace shamrock::solvergraph {
36 this->spans = field_refs.template map<shamrock::PatchDataFieldSpanPointer<T>>(
37 [&](
u64 id, std::reference_wrapper<PatchDataField<T>> &pdf) {
38 return pdf.get().get_pointer_span();
54 on_distributeddata_diff(
59 "Missing field ref in distributed data at id {}\n"
61 "Field texsymbol: {}",
64 this->get_tex_symbol()));
71 "Extra field ref in distributed data at id {}\n"
73 "Field texsymbol: {}",
76 this->get_tex_symbol()));
89 DDPatchDataFieldRef<T> extract() {
90 DDPatchDataFieldRef<T> refs = std::exchange(field_refs, {});
97 return field_refs.
get(id_patch);
102 static std::shared_ptr<FieldRefs<T>> make_shared(std::string name, std::string texsymbol) {
103 return std::make_shared<FieldRefs<T>>(name, texsymbol);
std::uint64_t u64
64 bit unsigned integer
Represents a collection of objects distributed across patches identified by a u64 id.
T & get(u64 id)
Returns a reference to an object in the collection.
virtual const DDPatchDataFieldSpanPointer< T > & get_spans() const
Const variant of get_spans.
virtual const DDPatchDataFieldRef< T > & get_refs() const
Const variant of get_refs.
virtual void ensure_sizes(const shambase::DistributedData< u32 > &sizes)
Ensure that the sizes of the patches in the field match the given sizes (Can resize the underlying fi...
virtual void free_alloc()
Free allocated memory.
virtual void check_sizes(const shambase::DistributedData< u32 > &sizes) const
Check that the sizes of the patches in the field match the given sizes.
virtual DDPatchDataFieldSpanPointer< T > & get_spans()
Get the DistributedData of spans attached to the underlying field.
virtual DDPatchDataFieldRef< T > & get_refs()
Get the DistributedData of PatchDataFieldRefs.
Interface for a solver graph edge representing a field as references to the underlying patch fields.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.