Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shammodels
zeus
include
shammodels
zeus
modules
GhostZones.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
19
#include "
shambackends/vec.hpp
"
20
#include "
shammodels/zeus/Solver.hpp
"
21
#include "
shammodels/zeus/modules/SolverStorage.hpp
"
22
23
namespace
shammodels::zeus::modules
{
24
25
template
<
class
Tvec,
class
Tgr
id
Vec>
26
class
GhostZones
{
27
public
:
28
using
Tscal = shambase::VecComponent<Tvec>;
29
using
Tgridscal = shambase::VecComponent<TgridVec>;
30
static
constexpr
u32
dim =
shambase::VectorProperties<Tvec>::dimension
;
31
32
using
Config
=
SolverConfig<Tvec, TgridVec>
;
33
using
Storage
=
SolverStorage<Tvec, TgridVec, u64>
;
34
35
ShamrockCtx
&context;
36
Config
&solver_config;
37
Storage
&storage;
38
39
GhostZones
(
ShamrockCtx
&context,
Config
&solver_config,
Storage
&storage)
40
: context(context), solver_config(solver_config), storage(storage) {}
41
42
void
build_ghost_cache();
43
44
shambase::DistributedDataShared<shamrock::patch::PatchDataLayer>
communicate_pdat(
45
const
std::shared_ptr<shamrock::patch::PatchDataLayerLayout> &pdl_ptr,
46
shambase::DistributedDataShared<shamrock::patch::PatchDataLayer>
&&interf);
47
48
template
<
class
T>
49
shambase::DistributedDataShared<PatchDataField<T>
> communicate_pdat_field(
50
shambase::DistributedDataShared
<
PatchDataField<T>
> &&interf);
51
52
template
<
class
T,
class
Tmerged>
53
shambase::DistributedData<Tmerged>
merge_native(
54
shambase::DistributedDataShared<T>
&&interfs,
55
std::function<
56
Tmerged(
const
shamrock::patch::Patch
,
shamrock::patch::PatchDataLayer
&pdat)> init,
57
std::function<
void
(Tmerged &, T &)> appender);
58
59
void
exchange_ghost();
60
61
template
<
class
T>
62
shamrock::ComputeField<T>
exchange_compute_field(
shamrock::ComputeField<T>
&in);
63
64
private
:
65
inline
PatchScheduler
&scheduler() {
return
shambase::get_check_ref
(context.sched); }
66
};
67
}
// namespace shammodels::zeus::modules
u32
std::uint32_t u32
32 bit unsigned integer
Definition
aliases_int.hpp:27
PatchDataField
Definition
PatchDataField.hpp:43
PatchScheduler
The MPI scheduler.
Definition
PatchScheduler.hpp:85
ShamrockCtx
Definition
ShamrockCtx.hpp:42
shambase::DistributedDataShared
Container for objects shared between two distributed data elements.
Definition
DistributedDataShared.hpp:52
shambase::DistributedData
Represents a collection of objects distributed across patches identified by a u64 id.
Definition
DistributedData.hpp:43
shammodels::zeus::SolverStorage
Definition
SolverStorage.hpp:37
shammodels::zeus::modules::GhostZones
Definition
GhostZones.hpp:26
shamrock::ComputeField
Definition
ComputeField.hpp:31
shamrock::patch::PatchDataLayer
PatchDataLayer container class, the layout is described in patchdata_layout.
Definition
PatchDataLayer.hpp:35
shambase::get_check_ref
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...
Definition
memory.hpp:110
shammodels::zeus::modules
namespace for the zeus model modules
Definition
AMRTree.hpp:23
sham::VectorProperties
Definition
vec.hpp:25
shammodels::zeus::SolverConfig
Definition
SolverConfig.hpp:31
shamrock::patch::Patch
Patch object that contain generic patch information.
Definition
Patch.hpp:33
vec.hpp
Solver.hpp
SolverStorage.hpp
Generated on Wed May 13 2026 13:21:49 for Shamrock by
1.9.8