Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
CopyPatchDataLayerFields.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
18
25#include <memory>
26
27namespace shamrock::solvergraph {
28
29 class CopyPatchDataLayerFields : public INode {
30
31 public:
32 CopyPatchDataLayerFields(
33 std::shared_ptr<patch::PatchDataLayerLayout> layout_source,
34 std::shared_ptr<patch::PatchDataLayerLayout> layout_target)
35 : layout_source(layout_source), layout_target(layout_target) {}
36
37 std::shared_ptr<patch::PatchDataLayerLayout> layout_source;
38 std::shared_ptr<patch::PatchDataLayerLayout> layout_target;
39
40 struct Edges {
41 const IPatchDataLayerRefs &original;
42 PatchDataLayerEdge &target;
43 };
44
45 void set_edges(
46 std::shared_ptr<IPatchDataLayerRefs> original,
47 std::shared_ptr<PatchDataLayerEdge> target) {
48 __internal_set_ro_edges({original});
50 }
51
52 Edges get_edges() {
53 return Edges{
56 }
57
59
60 std::string _impl_get_label() const { return "CopyPatchDataLayerFields"; }
61
62 std::string _impl_get_tex() const { return "TODO"; }
63 };
64} // namespace shamrock::solvergraph
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
Defines the PatchDataLayerEdge class for managing patch data layer edges.
std::string _impl_get_label() const
get the label of the node
std::string _impl_get_tex() const
get the tex of the node
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
const T & get_ro_edge(int slot)
Get a read only edge and cast it to the type T.
Definition INode.hpp:80
This header file contains utility functions related to exception handling in the code.