Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ExtractGhostField.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
26
27namespace shamrock::solvergraph {
28
29 template<class T>
30 class ExtractGhostField : public INode {
31
32 public:
34
35 struct Edges {
36 const shamrock::solvergraph::IFieldRefs<T> &original_fields;
39 };
40
41 inline void set_edges(
42 std::shared_ptr<shamrock::solvergraph::IFieldRefs<T>> original_fields,
43 std::shared_ptr<shamrock::solvergraph::DDSharedBuffers<u32>> idx_in_ghosts,
44 std::shared_ptr<shamrock::solvergraph::PatchDataFieldDDShared<T>> ghost_fields) {
45 __internal_set_ro_edges({original_fields, idx_in_ghosts});
46 __internal_set_rw_edges({ghost_fields});
47 }
48
49 Edges get_edges() {
50 return Edges{
51 get_ro_edge<shamrock::solvergraph::IFieldRefs<T>>(0),
53 get_rw_edge<shamrock::solvergraph::PatchDataFieldDDShared<T>>(0)};
54 }
55
57
58 inline virtual std::string _impl_get_label() const { return "ExtractGhostField"; };
59
60 virtual std::string _impl_get_tex() const { return "TODO"; };
61 };
62} // namespace shamrock::solvergraph
Defines the CopyPatchDataField class for copying fields between patch data field references.
Defines the DDSharedBuffers class for managing buffers contained in a distributed data shared.
Shared distributed data field for patch data management in solver graphs.
Interface for a solver graph edge representing a buffer contained in a distributed data shared.
virtual std::string _impl_get_tex() const
get the tex of the node
virtual std::string _impl_get_label() const
get the label of the node
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
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
Shared distributed data field for patch data management.