Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
ExtractGhostLayer.cpp
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
19
21 StackEntry stack_loc{};
22
23 auto edges = get_edges();
24
25 // inputs
26 auto &patch_data_layers = edges.patch_data_layers;
27 auto &idx_in_ghost = edges.idx_in_ghost;
28
29 // outputs
30 auto &ghost_layer = edges.ghost_layer;
31
32 // iterate on buffer storing indexes in ghost layer
33 for (const auto &[key, sender_idx_in_ghost] : idx_in_ghost.buffers) {
34 auto [sender, receiver] = key;
35
36 shamrock::patch::PatchDataLayer ghost_zone(ghost_layer_layout);
37
38 // extract the actual data
39 patch_data_layers.get(sender).append_subset_to(
40 sender_idx_in_ghost, u32(sender_idx_in_ghost.get_size()), ghost_zone);
41
42 ghost_layer.patchdatas.add_obj(sender, receiver, std::move(ghost_zone));
43 }
44}
45
Extract the ghost layer from the patch data layers.
std::uint32_t u32
32 bit unsigned integer
virtual std::string _impl_get_tex() const
get the tex of the node
PatchDataLayer container class, the layout is described in patchdata_layout.