Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
PatchDataLayerRefs.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
23
24namespace shamrock::solvergraph {
25
27
28 public:
30
31 using IPatchDataLayerRefs::IPatchDataLayerRefs;
32
33 inline virtual patch::PatchDataLayer &get(u64 id_patch) override {
34 return patchdatas.get(id_patch);
35 }
36
37 inline virtual const patch::PatchDataLayer &get(u64 id_patch) const override {
38 return patchdatas.get(id_patch);
39 }
40
41 inline virtual shambase::DistributedData<PatchDataLayerRef> &get_refs() override {
42 return patchdatas;
43 }
44
45 inline virtual const shambase::DistributedData<PatchDataLayerRef> &get_const_refs()
46 const override {
47 return patchdatas;
48 }
49
50 inline virtual void free_alloc() override { patchdatas = {}; }
51 };
52
53} // namespace shamrock::solvergraph
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
std::uint64_t u64
64 bit unsigned integer
Represents a collection of objects distributed across patches identified by a u64 id.
T & get(u64 id)
Returns a reference to an object in the collection.
PatchDataLayer container class, the layout is described in patchdata_layout.
virtual void free_alloc() override
Free allocated memory.