Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ComputeAMRLevel.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#include "shambackends/vec.hpp"
23
25
26 template<class TgridVec>
28 using Tgridscal = shambase::VecComponent<TgridVec>;
29 using TgridUint = typename std::make_unsigned<shambase::VecComponent<TgridVec>>::type;
30
31 public:
33
41
42 inline void set_edges(
43 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> sizes,
44 std::shared_ptr<shamrock::solvergraph::ScalarsEdge<TgridVec>> level0_size,
45 std::shared_ptr<shamrock::solvergraph::IFieldSpan<TgridVec>> block_min,
46 std::shared_ptr<shamrock::solvergraph::IFieldSpan<TgridVec>> block_max,
47 std::shared_ptr<shamrock::solvergraph::IFieldSpan<TgridUint>> block_level) {
48 __internal_set_ro_edges({sizes, level0_size, block_min, block_max});
49 __internal_set_rw_edges({block_level});
50 }
51
52 inline Edges get_edges() {
53 return Edges{
54 get_ro_edge<shamrock::solvergraph::Indexes<u32>>(0),
56 get_ro_edge<shamrock::solvergraph::IFieldSpan<TgridVec>>(2),
58 get_rw_edge<shamrock::solvergraph::IFieldSpan<TgridUint>>(0)};
59 }
60
62
63 void _impl_reset_internal() {};
64
65 inline virtual std::string _impl_get_label() const { return "ComputeAMRLevel"; };
66
67 virtual std::string _impl_get_tex() const;
68 };
69
70} // namespace shammodels::basegodunov::modules
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
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