Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
CopyPatchDataField.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
23#include <memory>
24
25namespace shamrock::solvergraph {
26
57 template<class T>
58 class CopyPatchDataField : public INode {
59
60 public:
63
69
76 void set_edges(std::shared_ptr<IFieldRefs<T>> original, std::shared_ptr<Field<T>> target) {
77 __internal_set_ro_edges({original});
79 }
80
86 Edges get_edges() { return Edges{get_ro_edge<IFieldRefs<T>>(0), get_rw_edge<Field<T>>(0)}; }
87
97
103 std::string _impl_get_label() const { return "CopyPatchDataField"; }
104
110 std::string _impl_get_tex() const;
111 };
112} // namespace shamrock::solvergraph
A solver graph node that copies field data from source field references to target fields.
std::string _impl_get_label() const
Returns the human-readable label for this node.
Edges get_edges()
Retrieves the current edges of the node.
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 set_edges(std::shared_ptr< IFieldRefs< T > > original, std::shared_ptr< Field< T > > target)
Sets the input and output edges for the copy operation.
Interface for a solver graph edge representing a field as references to the underlying patch fields.
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition INode.hpp:30
T & get_rw_edge(int slot)
Get a read write edge and cast it to the type T.
Definition INode.hpp:86
void __internal_set_rw_edges(std::vector< std::shared_ptr< IEdge > > new_rw_edges)
Set the read write edges.
Definition INode.hpp:181
void __internal_set_ro_edges(std::vector< std::shared_ptr< IEdge > > new_ro_edges)
Set the read only edges.
Definition INode.hpp:171
Structure containing references to the node's input and output edges.
Field< T > & target
Reference to the target field for copying.
const IFieldRefs< T > & original
Reference to the source field data.