Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ComputeLevel0CellSize.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
21#include "shammath/AABB.hpp"
26#include <memory>
27
29 template<class TgridVec>
31 public:
33#define NODE_ComputeLevel0CellSize_EDGES(X_RO, X_RW) \
34 /* inputs */ \
35 X_RO(shamrock::solvergraph::ScalarsEdge<shammath::AABB<TgridVec>>, patch_boxes) \
36 X_RO(shamrock::solvergraph::IPatchDataLayerRefs, refs) \
37 /* outputs */ \
38 X_RW(shamrock::solvergraph::ScalarsEdge<TgridVec>, level0_size)
39
40 EXPAND_NODE_EDGES(NODE_ComputeLevel0CellSize_EDGES)
41#undef NODE_ComputeLevel0CellSize_EDGES
42
44 auto edges = get_edges();
45 edges.level0_size.values = edges.refs.get_const_refs().template map<TgridVec>(
46 [&](u64 id_patch, const shamrock::patch::PatchDataLayer &pdat) {
47 shammath::AABB<TgridVec> patch_box = edges.patch_boxes.values.get(id_patch);
48 return patch_box.delt();
49 });
50 }
51
52 inline virtual std::string _impl_get_label() const { return "ComputeLevel0CellSize"; };
53
54 virtual std::string _impl_get_tex() const { return "ComputeLevel0CellSize"; };
55 };
56
57} // namespace shammodels::basegodunov::modules
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
std::uint64_t u64
64 bit unsigned integer
virtual std::string _impl_get_tex() const
get the tex of the node
virtual std::string _impl_get_label() const
get the label of the node
PatchDataLayer container class, the layout is described in patchdata_layout.
Inode is node between data edges, takes multiple inputs, multiple outputs.
Definition INode.hpp:30
namespace for the basegodunov model modules
Axis-Aligned bounding box.
Definition AABB.hpp:99
T delt() const
Returns the delta of the AABB.
Definition AABB.hpp:152