Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ConsToPrimGasBarotropic.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
17
18#include "shambackends/vec.hpp"
22
23// The barotropic pressure only depends on rho, hence no rhoe input
24#define NODE_EDGES(X_RO, X_RW) \
25 /* ------------------- inputs ------------------- */ \
26 X_RO(shamrock::solvergraph::Indexes<u32>, sizes) \
27 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, spans_rho) \
28 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, spans_rhov) \
29 \
30 /* ------------------- outputs ------------------- */ \
31 X_RW(shamrock::solvergraph::IFieldSpan<Tvec>, spans_vel) \
32 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, spans_P)
33
35
40 template<class Tvec>
41 class NodeConsToPrimGasBarotropic : public shamrock::solvergraph::INode {
42 using Tscal = shambase::VecComponent<Tvec>;
43 u32 block_size;
44 Tscal rho_crit;
45 Tscal cs0;
46 Tscal gamma;
47
48 public:
49 NodeConsToPrimGasBarotropic(u32 block_size, Tscal rho_crit, Tscal cs0, Tscal gamma)
50 : block_size(block_size), rho_crit(rho_crit), cs0(cs0), gamma(gamma) {}
51
52 EXPAND_NODE_EDGES(NODE_EDGES)
53
55
56 inline virtual std::string _impl_get_label() const { return "ConsToPrimGasBarotropic"; };
57
58 virtual std::string _impl_get_tex() const;
59 };
60} // namespace shammodels::basegodunov::modules
61
62#undef NODE_EDGES
std::uint32_t u32
32 bit unsigned integer
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 basegodunov model modules