Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamrock
include
shamrock
solvergraph
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
20
#include "
shambase/DistributedData.hpp
"
21
#include "
shamrock/patch/PatchDataLayer.hpp
"
22
#include "
shamrock/solvergraph/IPatchDataLayerRefs.hpp
"
23
24
namespace
shamrock::solvergraph {
25
26
class
PatchDataLayerRefs
:
public
IPatchDataLayerRefs
{
27
28
public
:
29
shambase::DistributedData<PatchDataLayerRef>
patchdatas;
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
DistributedData.hpp
IPatchDataLayerRefs.hpp
Defines the PatchDataLayerRefs class for managing distributed references to patch data layers.
PatchDataLayer.hpp
u64
std::uint64_t u64
64 bit unsigned integer
Definition
aliases_int.hpp:26
shambase::DistributedData
Represents a collection of objects distributed across patches identified by a u64 id.
Definition
DistributedData.hpp:43
shambase::DistributedData::get
T & get(u64 id)
Returns a reference to an object in the collection.
Definition
DistributedData.hpp:145
shamrock::patch::PatchDataLayer
PatchDataLayer container class, the layout is described in patchdata_layout.
Definition
PatchDataLayer.hpp:35
shamrock::solvergraph::IPatchDataLayerRefs
Definition
IPatchDataLayerRefs.hpp:29
shamrock::solvergraph::PatchDataLayerRefs
Definition
PatchDataLayerRefs.hpp:26
shamrock::solvergraph::PatchDataLayerRefs::free_alloc
virtual void free_alloc() override
Free allocated memory.
Definition
PatchDataLayerRefs.hpp:50
Generated on Wed May 13 2026 13:21:49 for Shamrock by
1.9.8