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"
40#include <memory>
41
42namespace shammodels::sph {
43
44 template<class T>
45 using Component = shambase::StorageComponent<T>;
46
47 template<class Tvec, class Tmorton>
49 public:
50 using Tscal = shambase::VecComponent<Tvec>;
51 static constexpr u32 dim = shambase::VectorProperties<Tvec>::dimension;
52
53 using GhostHandle = BasicSPHGhostHandler<Tvec>;
54 using GhostHandleCache = typename GhostHandle::CacheMap;
55
57
58 std::shared_ptr<shamrock::solvergraph::ExchangeGhostLayer> exchange_gz_node;
59 std::shared_ptr<shamrock::solvergraph::ExchangeGhostField<Tscal>> exchange_gz_alpha;
60 std::shared_ptr<shamrock::solvergraph::ExchangeGhostLayer> exchange_gz_positions;
61
63 std::shared_ptr<shamrock::solvergraph::OperationSequence> solver_sequence;
64
65 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> part_counts;
66 std::shared_ptr<shamrock::solvergraph::Indexes<u32>> part_counts_with_ghost;
67
68 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tvec>> positions_with_ghosts;
69 std::shared_ptr<shamrock::solvergraph::FieldRefs<Tscal>> hpart_with_ghosts;
70
71 std::shared_ptr<shammodels::sph::solvergraph::NeighCache> neigh_cache;
72
73 std::shared_ptr<shamrock::solvergraph::RankGetter> patch_rank_owner;
74
75 Component<SerialPatchTree<Tvec>> serial_patch_tree;
76
77 Component<GhostHandle> ghost_handler;
78
79 Component<GhostHandleCache> ghost_patch_cache;
80
81 Component<shambase::DistributedData<shamrock::patch::PatchDataLayer>> merged_xyzh;
82
83 Component<shambase::DistributedData<RTree>> merged_pos_trees;
84
85 Component<shambase::DistributedData<shamtree::KarrasRadixTreeField<Tscal>>>
86 rtree_rint_field;
87
88 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> omega;
89
90 std::shared_ptr<shamrock::patch::PatchDataLayerLayout> ghost_layout;
91 std::shared_ptr<shamrock::patch::PatchDataLayerLayout> xyzh_ghost_layout;
92
93 Component<shambase::DistributedData<shamrock::patch::PatchDataLayer>>
94 merged_patchdata_ghost;
95
96 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> alpha_av_updated;
97 Component<shambase::DistributedData<PatchDataField<Tscal>>> alpha_av_ghost;
98
99 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> pressure;
100 std::shared_ptr<shamrock::solvergraph::Field<Tscal>> soundspeed;
101
102 Component<shamrock::ComputeField<Tvec>> old_axyz;
103 Component<shamrock::ComputeField<Tscal>> old_duint;
104
105 Component<shamrock::ComputeField<Tvec>> old_dB_on_rho;
106 Component<shamrock::ComputeField<Tscal>> old_dpsi_on_ch;
107
108 Component<shamrock::ComputeField<Tscal>> old_dtepsilon;
109 Component<shamrock::ComputeField<Tvec>> old_dtdeltav;
110 Component<shamrock::ComputeField<Tscal>> old_ds_j_dt;
111
112 Component<std::vector<SinkParticle<Tvec>>> sinks;
113
114 struct Timings {
115 f64 interface = 0;
116 f64 neighbors = 0;
117 f64 io = 0;
118
120 void reset() { *this = {}; }
121 } timings_details;
122 };
123
124} // 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.