Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
FindBlockNeigh.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"
25
27
28 template<class Tvec, class TgridVec, class Tmorton>
30 using Tscal = shambase::VecComponent<Tvec>;
32 using OrientedAMRGraph = OrientedAMRGraph<Tvec, TgridVec>;
33
34 class AMRBlockFinder;
35
36 public:
38
46
47 inline void set_edges(
48 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> sizes,
49 std::shared_ptr<shamrock::solvergraph::IFieldRefs<TgridVec>> spans_block_min,
50 std::shared_ptr<shamrock::solvergraph::IFieldRefs<TgridVec>> spans_block_max,
51 std::shared_ptr<solvergraph::TreeEdge<Tmorton, TgridVec>> trees,
52 std::shared_ptr<solvergraph::OrientedAMRGraphEdge<Tvec, TgridVec>> block_neigh_graph) {
53 __internal_set_ro_edges({sizes, spans_block_min, spans_block_max, trees});
54 __internal_set_rw_edges({block_neigh_graph});
55 }
56
57 inline Edges get_edges() {
58 return Edges{
59 get_ro_edge<shamrock::solvergraph::Indexes<u32>>(0),
61 get_ro_edge<shamrock::solvergraph::IFieldRefs<TgridVec>>(2),
62 get_ro_edge<solvergraph::TreeEdge<Tmorton, TgridVec>>(3),
63 get_rw_edge<solvergraph::OrientedAMRGraphEdge<Tvec, TgridVec>>(0)};
64 }
65
67
68 inline virtual std::string _impl_get_label() const { return "FindBlockNeigh"; };
69
70 virtual std::string _impl_get_tex() const;
71 };
72} // namespace shammodels::basegodunov::modules
The radix tree.
Definition RadixTree.hpp:50
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
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