Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
FindGhostInterfaces.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
21
22#include "shambackends/vec.hpp"
23#include "shammath/AABB.hpp"
33
35#define FIND_GHOST_INTERFACES_EDGES_IN(X_RO) \
36 X_RO(shamrock::solvergraph::ScalarEdge<shammath::AABB<Tvec>>, sim_box) \
37 X_RO(shamrock::solvergraph::SerialPatchTreeRefEdge<Tvec>, patch_tree) \
38 X_RO(shamrock::solvergraph::PatchtreeFieldEdge<Tscal>, interact_radius_tree) \
39 X_RO(shamrock::solvergraph::ScalarsEdge<Tscal>, interact_radius) \
40 X_RO(shamrock::solvergraph::ScalarsEdge<shammath::CoordRange<Tvec>>, local_patch_boxes)
41
42#define FIND_GHOST_INTERFACES_EDGES_OUT(X_RW) \
43 X_RW(shamrock::solvergraph::DDSharedScalar<InterfaceBuildInfos>, interface_infos)
44
46
60 template<class Tvec>
62 using Tscal = shambase::VecComponent<Tvec>;
63 using InterfaceBuildInfos = typename BasicSPHGhostHandler<Tvec>::InterfaceBuildInfos;
64 };
65
66#define NODE_EDGES(X_RO, X_RW) \
67 FIND_GHOST_INTERFACES_EDGES_IN(X_RO) \
68 FIND_GHOST_INTERFACES_EDGES_OUT(X_RW)
69
73 template<class Tvec>
74 class FindGhostInterfacesFree : public shamrock::solvergraph::INode {
75 using Tscal = typename FindGhostInterfacesTypes<Tvec>::Tscal;
76 using InterfaceBuildInfos = typename FindGhostInterfacesTypes<Tvec>::InterfaceBuildInfos;
77
78 public:
79 FindGhostInterfacesFree() = default;
80
81 EXPAND_NODE_EDGES(NODE_EDGES)
82
84
85 inline virtual std::string _impl_get_label() const { return "FindGhostInterfacesFree"; };
86
87 virtual std::string _impl_get_tex() const;
88 };
89
94 template<class Tvec>
95 class FindGhostInterfacesPeriodic : public shamrock::solvergraph::INode {
96 using Tscal = typename FindGhostInterfacesTypes<Tvec>::Tscal;
97 using InterfaceBuildInfos = typename FindGhostInterfacesTypes<Tvec>::InterfaceBuildInfos;
98
99 public:
100 FindGhostInterfacesPeriodic() = default;
101
102 EXPAND_NODE_EDGES(NODE_EDGES)
103
105
106 inline virtual std::string _impl_get_label() const {
107 return "FindGhostInterfacesPeriodic";
108 };
109
110 virtual std::string _impl_get_tex() const;
111 };
112
113#undef NODE_EDGES
114
115#define NODE_EDGES(X_RO, X_RW) \
116 FIND_GHOST_INTERFACES_EDGES_IN(X_RO) \
117 X_RO(shamrock::solvergraph::IDataEdge<Tscal>, shear_value) \
118 FIND_GHOST_INTERFACES_EDGES_OUT(X_RW)
119
126 template<class Tvec>
127 class FindGhostInterfacesShearingPeriodic : public shamrock::solvergraph::INode {
128 using Tscal = typename FindGhostInterfacesTypes<Tvec>::Tscal;
129 using InterfaceBuildInfos = typename FindGhostInterfacesTypes<Tvec>::InterfaceBuildInfos;
130
131 i32_3 shear_base;
132 i32_3 shear_dir;
133 Tscal shear_speed;
134
135 public:
136 FindGhostInterfacesShearingPeriodic(i32_3 shear_base, i32_3 shear_dir, Tscal shear_speed)
137 : shear_base(shear_base), shear_dir(shear_dir), shear_speed(shear_speed) {}
138
139 EXPAND_NODE_EDGES(NODE_EDGES)
140
142
143 inline virtual std::string _impl_get_label() const {
144 return "FindGhostInterfacesShearingPeriodic";
145 };
146
147 virtual std::string _impl_get_tex() const;
148 };
149
150#undef NODE_EDGES
151
152} // namespace shammodels::sph::modules
153
154#undef FIND_GHOST_INTERFACES_EDGES_IN
155#undef FIND_GHOST_INTERFACES_EDGES_OUT
Solvergraph edge holding a field defined on the nodes of the serial patch tree.
virtual std::string _impl_get_label() const
get the label of the node
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
virtual std::string _impl_get_tex() const
get the tex of the node
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
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition INode.hpp:31
namespace for the sph model modules
Types shared by the ghost interface finders.