Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shammodels
ramses
include
shammodels
ramses
solvegraph
OrientedAMRGraphEdge.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 "
shambase/DistributedData.hpp
"
20
#include "
shambase/memory.hpp
"
21
#include "
shammodels/common/amr/NeighGraph.hpp
"
22
#include "
shamrock/solvergraph/IEdgeNamed.hpp
"
23
24
namespace
shammodels::basegodunov::solvergraph {
25
26
template
<
class
Tvec,
class
Tgr
id
Vec>
27
class
OrientedAMRGraphEdge
:
public
shamrock::solvergraph::IEdgeNamed
{
28
public
:
29
using
IEdgeNamed::IEdgeNamed;
30
using
OrientedAMRGraph
=
modules::OrientedAMRGraph<Tvec, TgridVec>
;
31
32
shambase::DistributedData<OrientedAMRGraph>
graph;
33
34
inline
virtual
void
free_alloc
() { graph = {}; }
35
36
inline
shambase::DistributedData<std::reference_wrapper<modules::AMRGraph>
> get_refs_dir(
37
modules::Direction dir) {
38
return
graph.template map<std::reference_wrapper<modules::AMRGraph>>(
39
[&](
u64
id,
40
OrientedAMRGraph &neigh_graph) -> std::reference_wrapper<modules::AMRGraph> {
41
return
std::ref(
shambase::get_check_ref
(neigh_graph.graph_links[dir]));
42
});
43
}
44
inline
shambase::DistributedData<std::reference_wrapper<modules::AMRGraph>
> get_refs_dir(
45
modules::Direction dir)
const
{
46
return
graph.template map<std::reference_wrapper<modules::AMRGraph>>(
47
[&](
u64
id,
const
OrientedAMRGraph &neigh_graph)
48
-> std::reference_wrapper<modules::AMRGraph> {
49
return
std::ref(
shambase::get_check_ref
(neigh_graph.graph_links[dir]));
50
});
51
}
52
};
53
54
}
// namespace shammodels::basegodunov::solvergraph
DistributedData.hpp
IEdgeNamed.hpp
NeighGraph.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
shammodels::basegodunov::solvergraph::OrientedAMRGraphEdge
Definition
OrientedAMRGraphEdge.hpp:27
shammodels::basegodunov::solvergraph::OrientedAMRGraphEdge::free_alloc
virtual void free_alloc()
Free allocated memory.
Definition
OrientedAMRGraphEdge.hpp:34
shamrock::solvergraph::IEdgeNamed
Definition
IEdgeNamed.hpp:23
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
memory.hpp
shammodels::basegodunov::modules::OrientedAMRGraph
Definition
NeighGraph.hpp:126
Generated on Wed May 13 2026 13:21:49 for Shamrock by
1.9.8