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
22#include "shambackends/sycl.hpp"
23#include "shammath/AABB.hpp"
24
26
33 template<class Tvec, class TgridVec>
35 public:
36 using Tscal = shambase::VecComponent<Tvec>;
37 using Tgridscal = shambase::VecComponent<TgridVec>;
39
41 TgridVec offset;
42 sycl::vec<i32, dim> periodicity_index;
43 shammath::AABB<TgridVec> volume_target;
44 };
45
47 InterfaceBuildInfos build_infos;
48 std::unique_ptr<sycl::buffer<u32>> ids_interf;
49 f64 cell_count_ratio;
50 };
51
53 GeneratorMap ghost_gen_infos;
54
56
57 template<class T>
58 shambase::DistributedDataShared<T> build_interface_native(
59 std::function<T(u64, u64, InterfaceBuildInfos, sycl::buffer<u32> &, u32)> fct) {
60 StackEntry stack_loc{};
61
62 // clang-format off
63 return ghost_id_build_map.template map<T>([&](u64 sender, u64 receiver, InterfaceIdTable &build_table) {
64 if (!bool(build_table.ids_interf)) {
65 shambase::throw_with_loc<std::runtime_error>(
66 "their is an empty id table in the interface, it should have been removed");
67 }
68
69 return fct(
70 sender,
71 receiver,
72 build_table.build_infos,
73 *build_table.ids_interf,
74 build_table.ids_interf->size());
75
76 });
77 // clang-format on
78 }
79 };
80
81} // namespace shammodels::basegodunov
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 basegodunov model
This file contains the definition for the stacktrace related functionality.
Axis-Aligned bounding box.
Definition AABB.hpp:99