Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ExtractCounts.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
23
24#define NODE_EDGES(X_RO, X_RW) \
25 /* ------------------- inputs ------------------- */ \
26 X_RO(shamrock::solvergraph::IPatchDataLayerRefs, refs) \
27 \
28 /* ------------------- outputs ------------------- */ \
29 X_RW(shamrock::solvergraph::Indexes<u32>, counts)
30
31namespace shamrock::solvergraph {
32
33 class ExtractCounts : public INode {
34
35 public:
36 ExtractCounts() {}
37
38 EXPAND_NODE_EDGES(NODE_EDGES)
39
41 auto edges = get_edges();
42 edges.counts.indexes = edges.refs.get_const_refs().map<u32>(
43 [](u64 id_patch, const patch::PatchDataLayer &pdat) {
44 return pdat.get_obj_cnt();
45 });
46 }
47
48 std::string _impl_get_label() const { return "ExtractCounts"; }
49
50 std::string _impl_get_tex() const { return "TODO"; }
51 };
52} // namespace shamrock::solvergraph
53
54#undef NODE_EDGES
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
PatchDataLayer container class, the layout is described in patchdata_layout.
std::string _impl_get_label() const
get the label of the node
std::string _impl_get_tex() const
get the tex of the node
void _impl_evaluate_internal()
evaluate the node