Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
IterateSmoothingLengthDensity.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"
24#include <memory>
25
26#define NODE_EDGES(X_RO, X_RW) \
27 X_RO(shamrock::solvergraph::Indexes<u32>, sizes) \
28 X_RO(shammodels::sph::solvergraph::NeighCache, neigh_cache) \
29 X_RO(shamrock::solvergraph::IFieldSpan<Tvec>, positions) \
30 X_RO(shamrock::solvergraph::IFieldSpan<Tscal>, old_h) \
31 \
32 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, new_h) \
33 X_RW(shamrock::solvergraph::IFieldSpan<Tscal>, eps_h)
34
36
37 template<class Tvec, class SPHKernel>
38 class IterateSmoothingLengthDensity : public shamrock::solvergraph::INode {
39
40 using Tscal = shambase::VecComponent<Tvec>;
41
42 Tscal gpart_mass;
43 Tscal h_evol_max;
44 Tscal h_evol_iter_max;
45 Tscal epsilon_h;
46
47 public:
48 IterateSmoothingLengthDensity(
49 Tscal gpart_mass, Tscal h_evol_max, Tscal h_evol_iter_max, Tscal epsilon_h)
50 : gpart_mass(gpart_mass), h_evol_max(h_evol_max), h_evol_iter_max(h_evol_iter_max),
51 epsilon_h(epsilon_h) {}
52
53 EXPAND_NODE_EDGES(NODE_EDGES)
54
56
57 inline virtual std::string _impl_get_label() const {
58 return "IterateSmoothingLengthDensity";
59 };
60
61 virtual std::string _impl_get_tex() const;
62 };
63} // namespace shammodels::sph::modules
64
65#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