Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ComputeOmega.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
20#include "shambackends/vec.hpp"
25
26#define NODE_EDGES(X_RO, X_RW) \
27 X_RO(shamrock::solvergraph::Indexes<u32>, part_counts) \
28 X_RO(shammodels::sph::solvergraph::NeighCache, neigh_cache) \
29 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, xyz) \
30 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, hpart) \
31 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, omega)
32
34
35 template<class Tvec, template<class> class SPHKernel>
36 class NodeComputeOmega : public shamrock::solvergraph::INode {
37
38 using Tscal = shambase::VecComponent<Tvec>;
39
40 static constexpr Tscal kernel_radius = SPHKernel<Tscal>::Rkern;
41 Tscal part_mass;
42
43 public:
44 NodeComputeOmega(Tscal part_mass) : part_mass(part_mass) {}
45
46 EXPAND_NODE_EDGES(NODE_EDGES)
47
49
50 inline virtual std::string _impl_get_label() const { return "ComputeOmega"; };
51
52 virtual std::string _impl_get_tex() const;
53 };
54
55} // namespace shammodels::sph::modules
56
57#undef NODE_EDGES
58
59#define NODE_EDGES(X_RO, X_RW) \
60 X_RO(shamrock::solvergraph::Indexes<u32>, part_counts) \
61 X_RO(shamrock::solvergraph::IFieldSpan<u32>, mask) \
62 X_RW(shamrock::solvergraph::IFieldSpan<T>, field_to_set)
63
65
66 template<class T>
67 class SetWhenMask : public shamrock::solvergraph::INode {
68
69 T val_to_set;
70
71 public:
72 SetWhenMask(T val_to_set) : val_to_set(val_to_set) {}
73
74 EXPAND_NODE_EDGES(NODE_EDGES)
75
77
78 inline virtual std::string _impl_get_label() const { return "SetWhenMask"; };
79
80 virtual std::string _impl_get_tex() const;
81 };
82
83} // namespace shammodels::sph::modules
84
85#undef NODE_EDGES
virtual std::string _impl_get_tex() const
get the tex of the node
void _impl_evaluate_internal()
evaluate the node
virtual std::string _impl_get_label() const
get the label of the node
virtual std::string _impl_get_label() const
get the label of the node
void _impl_evaluate_internal()
evaluate 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