Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
full_tree_field.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// plan for a tree that can combine both a radix tree field and a patch tree
12
19#include "patch_field.hpp"
20
21template<class T, class DeviceTree>
23 public:
24 using TreeField_t = typename DeviceTree::template RadixTreeField<T>;
25
26 legacy::PatchField<T> patch_field;
27 std::unordered_map<u64, std::unique_ptr<TreeField_t>> patch_tree_fields;
28
29 // inline FullTreeField(
30 // PatchField<T> && pf,
31 // std::unordered_map<u64, std::unique_ptr<TreeField_t>> && ptf) :
32 // patch_field(pf), patch_tree_fields(ptf)
33 //{}
34
36 public:
37 BufferedPField<T> patch_field;
38 std::unordered_map<u64, std::unique_ptr<TreeField_t>> &patch_tree_fields;
39 };
40
41 inline BufferedFullTreeField get_buffers() {
42 return BufferedFullTreeField{patch_field.get_buffers(), patch_tree_fields};
43 }
44};
Define a field attached to a patch (example: FMM multipoles, hmax in SPH)