Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
SolverStorage.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
18
21#include "shambackends/vec.hpp"
39#include <memory>
40
41namespace shammodels::sph {
42
43 template<class T>
44 using Component = shambase::StorageComponent<T>;
45
46 template<class Tvec, class Tmorton>
48 public:
49 using Tscal = shambase::VecComponent<Tvec>;
50 static constexpr u32 dim = shambase::VectorProperties<Tvec>::dimension;
51
52 using GhostHandle = BasicSPHGhostHandler<Tvec>;
53 using GhostHandleCache = typename GhostHandle::CacheMap;
54
56
57 std::shared_ptr<shamrock::solvergraph::ExchangeGhostLayer> exchange_gz_node;
58 std::shared_ptr<shamrock::solvergraph::ExchangeGhostField<Tscal>> exchange_gz_alpha;
59 std::shared_ptr<shamrock::solvergraph::ExchangeGhostLayer> exchange_gz_positions;
60
62 std::shared_ptr<shamrock::solvergraph::OperationSequence> solver_sequence;
63
64 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> part_counts;
65 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> part_counts_with_ghost;
66
67 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tvec>> positions_with_ghosts;
68 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tscal>> hpart_with_ghosts;
69
70 std::shared_ptr<shammodels::sph::solvergraph::NeighCache> neigh_cache;
71
72 std::shared_ptr<shamrock::solvergraph::RankGetter> patch_rank_owner;
73
74 Component<SerialPatchTree<Tvec>> serial_patch_tree;
75
76 Component<GhostHandle> ghost_handler;
77
78 Component<GhostHandleCache> ghost_patch_cache;
79
80 Component<shambase::DistributedData<shamrock::patch::PatchDataLayer>> merged_xyzh;
81
82 Component<shambase::DistributedData<RTree>> merged_pos_trees;
83
84 Component<shambase::DistributedData<shamtree::KarrasRadixTreeField<Tscal>>>
85 rtree_rint_field;
86
87 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> omega;
88
89 std::shared_ptr<shamrock::patch::PatchDataLayerLayout> ghost_layout;
90 std::shared_ptr<shamrock::patch::PatchDataLayerLayout> xyzh_ghost_layout;
91
92 Component<shambase::DistributedData<shamrock::patch::PatchDataLayer>>
93 merged_patchdata_ghost;
94
95 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> alpha_av_updated;
96 Component<shambase::DistributedData<PatchDataField<Tscal>>> alpha_av_ghost;
97
98 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> pressure;
99 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> soundspeed;
100
101 Component<shamrock::ComputeField<Tvec>> old_axyz;
102 Component<shamrock::ComputeField<Tscal>> old_duint;
103
104 Component<shamrock::ComputeField<Tvec>> old_dB_on_rho;
105 Component<shamrock::ComputeField<Tscal>> old_dpsi_on_ch;
106
107 Component<shamrock::ComputeField<Tscal>> old_dtepsilon;
108 Component<shamrock::ComputeField<Tvec>> old_dtdeltav;
109 Component<shamrock::ComputeField<Tscal>> old_ds_j_dt;
110
111 struct Timings {
112 f64 interface = 0;
113 f64 neighbors = 0;
114 f64 io = 0;
115
117 void reset() { *this = {}; }
118 } timings_details;
119 };
120
121} // namespace shammodels::sph
Declare a class to register and retrieve nodes and edges from a unique container.
double f64
Alias for double.
std::uint32_t u32
32 bit unsigned integer
A graph container for managing solver nodes and edges with type-safe access.
A Compressed Leaf Bounding Volume Hierarchy (CLBVH) for neighborhood queries.
namespace for the sph model
This file contains the definition for the stacktrace related functionality.
void reset()
Reset the timings logged in the storage.