Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ComputeLuminosity.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
19
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(shamrock::solvergraph::Indexes<u32>, part_counts_with_ghosts) \
29 X_RO(shammodels::sph::solvergraph::NeighCache, neigh_cache) \
30 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, xyz) \
31 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, hpart) \
32 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, omega) \
33 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, u) \
34 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, pressure) \
35 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, luminosity)
36
38
39 template<class Tvec, template<class> class SPHKernel>
40 class NodeComputeLuminosity : public shamrock::solvergraph::INode {
41
42 using Tscal = shambase::VecComponent<Tvec>;
43
44 Tscal part_mass;
45 Tscal alpha_u;
46
47 public:
48 NodeComputeLuminosity(Tscal part_mass, Tscal alpha_u)
49 : part_mass(part_mass), alpha_u(alpha_u) {}
50
51 EXPAND_NODE_EDGES(NODE_EDGES)
52
54
55 inline virtual std::string _impl_get_label() const { return "ComputeLuminosity"; };
56
57 virtual std::string _impl_get_tex() const;
58 };
59
60} // namespace shammodels::sph::modules
61
62#undef NODE_EDGES
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