Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
LoopSmoothingLengthIter.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#include <memory>
24
26
27 template<class Tvec>
29
30 std::shared_ptr<INode> iterate_smth_length_once_ptr;
31
32 using Tscal = shambase::VecComponent<Tvec>;
33
34 Tscal epsilon_h;
35 u32 h_iter_per_subcycles;
36 bool print_info;
37
38 public:
40 std::shared_ptr<INode> iterate_smth_length_once_ptr,
41 Tscal epsilon_h,
42 u32 h_iter_per_subcycles,
43 bool print_info)
44 : iterate_smth_length_once_ptr(std::move(iterate_smth_length_once_ptr)),
45 epsilon_h(epsilon_h), h_iter_per_subcycles(h_iter_per_subcycles),
46 print_info(print_info) {}
47
52
53 inline void set_edges(
54 std::shared_ptr<shamrock::solvergraph::IFieldRefs<Tscal>> eps_h,
55 std::shared_ptr<shamrock::solvergraph::ScalarEdge<bool>> is_converged) {
57 __internal_set_rw_edges({is_converged});
58 }
59
60 inline Edges get_edges() {
61 return Edges{
62 get_ro_edge<shamrock::solvergraph::IFieldRefs<Tscal>>(0),
64 };
65 }
66
68
69 inline virtual std::string _impl_get_label() const { return "LoopSmoothingLengthIter"; };
70
71 virtual std::string _impl_get_tex() const;
72 };
73} // namespace shammodels::sph::modules
74
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 references to the underlying patch fields.
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
namespace for the sph model modules