Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
OperationSequence.cpp
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
18#include <sstream>
19
20namespace shamrock::solvergraph {
21
23 for (auto &node : nodes) {
24 node->evaluate();
25 }
26 }
27
29
30 std::stringstream ss;
31
32 ss << "subgraph cluster_" + std::to_string(get_uuid()) + " {\n";
33 for (auto &node : nodes) {
34 ss << node->get_dot_graph_partial();
35 }
36
37 for (int i = 0; i < nodes.size() - 1; i++) {
38 ss << nodes[i]->get_dot_graph_node_end() << " -> "
39 << nodes[i + 1]->get_dot_graph_node_start() << " [weight=3];\n";
40 }
41
42 ss << shambase::format("label = \"{}\";\n", _impl_get_label());
43 ss << "}\n";
44
45 return ss.str();
46 }
47
49 std::stringstream ss;
50 ss << "Start : " << _impl_get_label() << "\n";
51 for (auto &node : nodes) {
52 ss << node->get_tex_partial() << "\n";
53 }
54 ss << "End : " << _impl_get_label() << "\n";
55 return ss.str();
56 }
57
58} // namespace shamrock::solvergraph
u64 get_uuid() const
Get the uuid of the class.
Definition WithUUID.hpp:51
std::string _impl_get_tex() const
get the tex of the node
std::string _impl_get_label() const
get the label of the node
std::string _impl_get_dot_graph_partial() const
get the dot graph of the node partial