Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
IterateSmoothingLengthDensityNeighLim.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"
24#include <memory>
25
27
28 template<class Tvec, class SPHKernel>
30
31 using Tscal = shambase::VecComponent<Tvec>;
32
33 Tscal gpart_mass;
34 Tscal h_evol_max;
35 Tscal h_evol_iter_max;
36
37 u32 trigger_threshold;
38
39 public:
41 Tscal gpart_mass, Tscal h_evol_max, Tscal h_evol_iter_max, u32 trigger_threshold)
42 : gpart_mass(gpart_mass), h_evol_max(h_evol_max), h_evol_iter_max(h_evol_iter_max),
43 trigger_threshold(trigger_threshold) {}
44
54
55 inline void set_edges(
56 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> sizes,
57 std::shared_ptr<shammodels::sph::solvergraph::NeighCache> neigh_cache,
58 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tvec>> positions,
59 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tscal>> old_h,
60 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tscal>> new_h,
61 std::shared_ptr<shamrock::solvergraph::IFieldSpan<Tscal>> eps_h,
62 std::shared_ptr<shamrock::solvergraph::IFieldSpan<u32>> was_limited) {
63 __internal_set_ro_edges({sizes, neigh_cache, positions, old_h});
64 __internal_set_rw_edges({new_h, eps_h, was_limited});
65 }
66
67 inline Edges get_edges() {
68 return Edges{
69 get_ro_edge<shamrock::solvergraph::Indexes<u32>>(0),
70 get_ro_edge<shammodels::sph::solvergraph::NeighCache>(1),
71 get_ro_edge<shamrock::solvergraph::IFieldSpan<Tvec>>(2),
73 get_rw_edge<shamrock::solvergraph::IFieldSpan<Tscal>>(0),
75 get_rw_edge<shamrock::solvergraph::IFieldSpan<u32>>(2)};
76 }
77
79
80 inline virtual std::string _impl_get_label() const {
81 return "IterateSmoothingLengthDensityNeighLim";
82 };
83
84 virtual std::string _impl_get_tex() const;
85 };
86} // namespace shammodels::sph::modules
std::uint32_t u32
32 bit unsigned integer
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 sph model modules