Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
NodeComputePressureGrad.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
26#define NODE_EDGES(X_RO, X_RW) \
27 /* scalars */ \
28 X_RO(shamrock::solvergraph::ScalarEdge<Tscal>, gpart_mass) \
29 \
30 /* counts */ \
31 X_RO(shamrock::solvergraph::Indexes<u32>, part_counts) \
32 X_RO(shamrock::solvergraph::Indexes<u32>, part_counts_with_ghost) \
33 \
34 /* fields */ \
35 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, xyz) \
36 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, hpart) \
37 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, omega) \
38 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, pressure) \
39 \
40 /* neigh */ \
41 X_RO(shammodels::sph::solvergraph::NeighCache, neigh_cache) \
42 \
43 /* outputs */ \
44 X_RW(shamrock::solvergraph::IFieldSpan<Tvec>, grad_P_on_rho)
45
47
48 template<class Tvec, template<class> class SPHKernel>
49 class NodeComputePressureGrad : public shamrock::solvergraph::INode {
50
51 using Tscal = shambase::VecComponent<Tvec>;
52
53 static constexpr Tscal kernel_radius = SPHKernel<Tscal>::Rkern;
54
55 public:
56 NodeComputePressureGrad() {}
57
58 EXPAND_NODE_EDGES(NODE_EDGES)
59
61
62 inline virtual std::string _impl_get_label() const { return "ComputePressureGrad"; };
63
64 inline virtual std::string _impl_get_tex() const { return "TODO"; };
65 };
66} // namespace shammodels::sph::modules
67
68#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:30
namespace for the sph model modules