Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SinkParticlesAccreteQuantities.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
19#include "shambackends/vec.hpp"
25#include <vector>
26
27#define NODE_EDGES(X_RO, X_RW) \
28 /* ------------------- (param) inputs ------------------- */ \
29 X_RO(shamrock::solvergraph::IDataEdge<Tscal>, gpart_mass) \
30 X_RO(shamrock::solvergraph::IDataEdge<Tscal>, dt) \
31 \
32 /* ------------------- (field) inputs ------------------- */ \
33 X_RO(shamrock::solvergraph::Indexes<u32>, part_counts) \
34 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, positions) \
35 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, velocities) \
36 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, accelerations) \
37 \
38 /* ------------------- (sink) accretion table ------------------- */ \
39 X_RW(shamrock::solvergraph::Field<u32>, sink_accretion_table) \
40 \
41 /* ------------------- (sink) in/out ------------------- */ \
42 X_RW(shamrock::solvergraph::IDataEdge<std::vector<Tvec>>, sink_positions) \
43 X_RW(shamrock::solvergraph::IDataEdge<std::vector<Tvec>>, sink_velocities) \
44 X_RW(shamrock::solvergraph::IDataEdge<std::vector<Tvec>>, sink_accelerations) \
45 X_RW(shamrock::solvergraph::IDataEdge<std::vector<Tvec>>, sink_angmom) \
46 X_RW(shamrock::solvergraph::IDataEdge<std::vector<Tscal>>, sink_mass)
47
49
50 template<class Tvec>
51 class SinkParticlesAccreteQuantities : public shamrock::solvergraph::INode {
52
53 using Tscal = shambase::VecComponent<Tvec>;
54
55 public:
56 SinkParticlesAccreteQuantities() = default;
57
58 EXPAND_NODE_EDGES(NODE_EDGES)
59
61
62 inline virtual std::string _impl_get_label() const {
63 return "SinkParticlesAccreteQuantities";
64 }
65
66 virtual std::string _impl_get_tex() const;
67 };
68
69} // namespace shammodels::sph::modules
70
71#undef NODE_EDGES
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
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition INode.hpp:31
namespace for the sph model modules