Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SerialPatchTreeEdge.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#include <optional>
24#include <stdexcept>
25
26namespace shamrock::solvergraph {
27
28 template<class Tvec>
30 public:
31 using IEdgeNamed::IEdgeNamed;
32
37 std::optional<std::reference_wrapper<SerialPatchTree<Tvec>>> patch_tree;
38
39 inline SerialPatchTree<Tvec> &get_patch_tree() const {
40 if (!patch_tree.has_value()) {
42 }
43 return patch_tree.value().get();
44 }
45
46 inline void free_alloc() { patch_tree = std::nullopt; };
47 };
48
49} // namespace shamrock::solvergraph
std::optional< std::reference_wrapper< SerialPatchTree< Tvec > > > patch_tree
The patch tree.
This header file contains utility functions related to exception handling in the code.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.