Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Solver.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 "shambackends/vec.hpp"
25
26namespace shammodels::zeus {
27
28 template<class Tvec, class TgridVec>
29 class Solver {
30 public:
31 using Tscal = shambase::VecComponent<Tvec>;
32 using Tgridscal = shambase::VecComponent<TgridVec>;
34
35 using u_morton = u64;
36
38
39 using AMRBlock = typename Config::AMRBlock;
40
41 ShamrockCtx &context;
42 inline PatchScheduler &scheduler() { return shambase::get_check_ref(context.sched); }
43
44 Config solver_config;
45
47
48 inline void init_required_fields() {
49 context.pdata_layout_add_field<TgridVec>("cell_min", 1);
50 context.pdata_layout_add_field<TgridVec>("cell_max", 1);
51 context.pdata_layout_add_field<Tscal>("rho", AMRBlock::block_size);
52 context.pdata_layout_add_field<Tscal>("eint", AMRBlock::block_size);
53 context.pdata_layout_add_field<Tvec>("vel", AMRBlock::block_size);
54 }
55
56 Solver(ShamrockCtx &context) : context(context) {}
57
58 Tscal evolve_once(Tscal t_current, Tscal dt_input);
59 };
60
61} // namespace shammodels::zeus
utility to manipulate AMR blocks
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
The MPI scheduler.
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
namespace for the zeus model
utility class to handle AMR blocks
Definition AMRBlock.hpp:35