Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
RankGetter.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
20#include <functional>
21#include <utility>
22
23namespace shamrock::solvergraph {
24
27 class RankGetter : public IEdgeNamed {
28
30 std::function<u32(u64)> rank_getter_func;
31
32 public:
33 RankGetter(std::function<u32(u64)> getter_func, std::string label, std::string tex_symbol)
34 : rank_getter_func(std::move(getter_func)),
35 IEdgeNamed(std::move(label), std::move(tex_symbol)) {}
36
37 inline u32 get_rank_owner(u64 patch_id) const { return rank_getter_func(patch_id); }
38
39 inline void free_alloc() {};
40 };
41
42} // namespace shamrock::solvergraph
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
void free_alloc()
Free allocated memory.