Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
MortonCodeSet.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/vec.hpp"
22#include "shammath/AABB.hpp"
23
24namespace shamtree {
25
34 template<class Tmorton, class Tvec, u32 dim = shambase::VectorProperties<Tvec>::dimension>
58
78 template<class Tmorton, class Tvec, u32 dim>
79 MortonCodeSet<Tmorton, Tvec, dim> morton_code_set_from_positions(
80 const sham::DeviceScheduler_ptr &dev_sched,
81 shammath::AABB<Tvec> bounding_box,
83 u32 cnt_obj,
84 u32 morton_count,
85 sham::DeviceBuffer<Tmorton> &&cache_buf_morton_codes);
86
105 template<class Tmorton, class Tvec, u32 dim>
106 MortonCodeSet<Tmorton, Tvec, dim> morton_code_set_from_positions(
107 const sham::DeviceScheduler_ptr &dev_sched,
108 shammath::AABB<Tvec> bounding_box,
110 u32 cnt_obj,
111 u32 morton_count);
112
113} // namespace shamtree
std::uint32_t u32
32 bit unsigned integer
A buffer allocated in USM (Unified Shared Memory)
Class representing a set of Morton codes with associated bounding box and position data.
MortonCodeSet(shammath::AABB< Tvec > &&bounding_box, u32 &&cnt_obj, u32 &&morton_count, sham::DeviceBuffer< Tmorton > &&morton_codes)
Move constructor from each members.
u32 morton_count
The count of Morton codes in the set (every code after cnt_obj is err_code)
shammath::AABB< Tvec > bounding_box
The axis-aligned bounding box for the set of positions.
sham::DeviceBuffer< Tmorton > morton_codes
Device buffer holding the Morton codes.
u32 cnt_obj
The count of objects represented in the set.
STL namespace.
Axis-Aligned bounding box.
Definition AABB.hpp:99