Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ApplyDragIRK1.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
20
21#include "shambackends/vec.hpp"
26#include <vector>
27
28#define NODE_EDGES(X_RO, X_RW) \
29 /* ------------------- inputs ------------------- */ \
30 X_RO(shamrock::solvergraph::ScalarEdge<Tscal>, dt) \
31 X_RO(shamrock::solvergraph::Indexes<u32>, sizes) \
32 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, spans_rho_next) \
33 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, spans_rhov_next) \
34 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, spans_rhoe_next) \
35 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, spans_rho_d_next) \
36 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, spans_rhov_d_next) \
37 \
38 /* ------------------- outputs ------------------- */ \
39 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, spans_rho) \
40 X_RW(shamrock::solvergraph::IFieldSpan<Tvec>, spans_rhov) \
41 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, spans_rhoe) \
42 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, spans_rho_d) \
43 X_RW(shamrock::solvergraph::IFieldSpan<Tvec>, spans_rhov_d)
44
46
54 template<class Tvec>
55 class ApplyDragIRK1 : public shamrock::solvergraph::INode {
56 using Tscal = shambase::VecComponent<Tvec>;
57
58 u32 block_size;
59 u32 ndust;
61 std::vector<Tscal> alphas;
62 bool enable_frictional_heating;
63
64 public:
65 ApplyDragIRK1(
66 u32 block_size, u32 ndust, std::vector<Tscal> alphas, bool enable_frictional_heating)
67 : block_size(block_size), ndust(ndust), alphas(std::move(alphas)),
68 enable_frictional_heating(enable_frictional_heating) {}
69
70 EXPAND_NODE_EDGES(NODE_EDGES)
71
73
74 inline virtual std::string _impl_get_label() const { return "ApplyDragIRK1"; }
75
76 virtual std::string _impl_get_tex() const;
77 };
78
79} // namespace shammodels::basegodunov::modules
80
81#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