Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
GhostZoneData.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 "shambackends/sycl.hpp"
22#include "shammath/AABB.hpp"
23
25
32 template<class Tvec, class TgridVec>
34 public:
35 using Tscal = shambase::VecComponent<Tvec>;
36 using Tgridscal = shambase::VecComponent<TgridVec>;
38
40 TgridVec offset;
41 sycl::vec<i32, dim> periodicity_index;
42 shammath::AABB<TgridVec> volume_target;
43 };
44
46 InterfaceBuildInfos build_infos;
47 std::unique_ptr<sycl::buffer<u32>> ids_interf;
48 f64 cell_count_ratio;
49 };
50
52 GeneratorMap ghost_gen_infos;
53
55
56 template<class T>
57 shambase::DistributedDataShared<T> build_interface_native(
58 std::function<T(u64, u64, InterfaceBuildInfos, sycl::buffer<u32> &, u32)> fct) {
59 StackEntry stack_loc{};
60
61 // clang-format off
62 return ghost_id_build_map.template map<T>([&](u64 sender, u64 receiver, InterfaceIdTable &build_table) {
63 if (!bool(build_table.ids_interf)) {
64 throw shambase::make_except_with_loc<std::runtime_error>(
65 "their is an empty id table in the interface, it should have been removed");
66 }
67
68 return fct(
69 sender,
70 receiver,
71 build_table.build_infos,
72 *build_table.ids_interf,
73 build_table.ids_interf->size());
74
75 });
76 // clang-format on
77 }
78 };
79
80} // namespace shammodels::zeus
Container for objects shared between two distributed data patches.
double f64
Alias for double.
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
Class to hold information related to ghost zones.
namespace for the zeus model
Axis-Aligned bounding box.
Definition AABB.hpp:99