Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
BarotropicEnergyReset.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
19#include "shambackends/vec.hpp"
22
24
36 template<class Tvec, class TgridVec>
37 class BarotropicEnergyReset {
38
39 public:
40 using Tscal = shambase::VecComponent<Tvec>;
41
42 using Config = SolverConfig<Tvec, TgridVec>;
44 using AMRBlock = typename Config::AMRBlock;
45
46 ShamrockCtx &context;
47 Config &solver_config;
48 Storage &storage;
49
50 BarotropicEnergyReset(ShamrockCtx &context, Config &solver_config, Storage &storage)
51 : context(context), solver_config(solver_config), storage(storage) {}
52
54 void reset_energy();
55
56 private:
57 inline PatchScheduler &scheduler() { return shambase::get_check_ref(context.sched); }
58 };
59
60} // namespace shammodels::basegodunov::modules
The MPI scheduler.
void reset_energy()
Apply the reset, does nothing if the cooling is not CoolingConfig::InstantBarotropic.
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:112
namespace for the basegodunov model modules