Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamrock
include
shamrock
solvergraph
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
20
#include "
shamrock/solvergraph/IPatchDataLayerRefs.hpp
"
21
#include "
shamrock/solvergraph/Indexes.hpp
"
22
#include "
shamsolvergraph/node/INode.hpp
"
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
31
namespace
shamrock::solvergraph {
32
33
class
ExtractCounts :
public
INode {
34
35
public
:
36
ExtractCounts() {}
37
38
EXPAND_NODE_EDGES(NODE_EDGES)
39
40
void
_impl_evaluate_internal
() {
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
INode.hpp
IPatchDataLayerRefs.hpp
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
Indexes.hpp
u32
std::uint32_t u32
32 bit unsigned integer
Definition
aliases_int.hpp:27
u64
std::uint64_t u64
64 bit unsigned integer
Definition
aliases_int.hpp:26
shamrock::patch::PatchDataLayer
PatchDataLayer container class, the layout is described in patchdata_layout.
Definition
PatchDataLayer.hpp:35
shamrock::solvergraph::ExtractCounts::_impl_get_label
std::string _impl_get_label() const
get the label of the node
Definition
ExtractCounts.hpp:48
shamrock::solvergraph::ExtractCounts::_impl_get_tex
std::string _impl_get_tex() const
get the tex of the node
Definition
ExtractCounts.hpp:50
shamrock::solvergraph::ExtractCounts::_impl_evaluate_internal
void _impl_evaluate_internal()
evaluate the node
Definition
ExtractCounts.hpp:40
Generated on
for Shamrock by
1.15.0