Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ConsToPrimGas.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#include "shambackends/vec.hpp"
23
25 template<class Tvec>
27 using Tscal = shambase::VecComponent<Tvec>;
28 u32 block_size;
29 Tscal gamma;
30
31 public:
32 NodeConsToPrimGas(u32 block_size, Tscal gamma) : block_size(block_size), gamma(gamma) {}
33
42
43 inline void set_edges(
44 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> sizes,
45 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tscal>> spans_rho,
46 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tvec>> spans_rhov,
47 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tscal>> spans_rhoe,
48 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tvec>> spans_vel,
49 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tscal>> spans_P) {
50 __internal_set_ro_edges({sizes, spans_rho, spans_rhov, spans_rhoe});
51 __internal_set_rw_edges({spans_vel, spans_P});
52 }
53
54 inline Edges get_edges() {
55 return Edges{
56 get_ro_edge<shamrock::solvergraph::Indexes<u32>>(0),
58 get_ro_edge<shamrock::solvergraph::IFieldSpan<Tvec>>(2),
60 get_rw_edge<shamrock::solvergraph::IFieldSpan<Tvec>>(0),
62 };
63 }
64
66
67 inline virtual std::string _impl_get_label() const { return "ConsToPrimGas"; };
68
69 virtual std::string _impl_get_tex() const;
70 };
71} // namespace shammodels::basegodunov::modules
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
Interface for a solver graph edge representing a field as spans.
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition INode.hpp:30
T & get_rw_edge(int slot)
Get a read write edge and cast it to the type T.
Definition INode.hpp:86
void __internal_set_rw_edges(std::vector< std::shared_ptr< IEdge > > new_rw_edges)
Set the read write edges.
Definition INode.hpp:181
void __internal_set_ro_edges(std::vector< std::shared_ptr< IEdge > > new_ro_edges)
Set the read only edges.
Definition INode.hpp:171
const T & get_ro_edge(int slot)
Get a read only edge and cast it to the type T.
Definition INode.hpp:80
namespace for the basegodunov model modules