Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
UpdateDerivs.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
20#include "shambackends/vec.hpp"
24
26
27 template<class Tvec, template<class> class SPHKernel>
29 public:
30 using Tscal = shambase::VecComponent<Tvec>;
32 using Kernel = SPHKernel<Tscal>;
33
36
37 ShamrockCtx &context;
38 Config &solver_config;
39 Storage &storage;
40
41 UpdateDerivs(ShamrockCtx &context, Config &solver_config, Storage &storage)
42 : context(context), solver_config(solver_config), storage(storage) {}
43
44 void update_derivs();
45
46 private:
47 inline PatchScheduler &scheduler() { return shambase::get_check_ref(context.sched); }
48
49 using Cfg_AV = typename Config::AVConfig;
50
51 using None = typename Cfg_AV::None;
52 using Constant = typename Cfg_AV::Constant;
53 using VaryingMM97 = typename Cfg_AV::VaryingMM97;
54 using VaryingCD10 = typename Cfg_AV::VaryingCD10;
55 using ConstantDisc = typename Cfg_AV::ConstantDisc;
56
57 void update_derivs_noAV(None cfg);
58 void update_derivs_constantAV(Constant cfg);
59 void update_derivs_mm97(VaryingMM97 cfg);
60 void update_derivs_cd10(VaryingCD10 cfg);
61 void update_derivs_disc_visco(ConstantDisc cfg);
62
63 using Cfg_MHD = typename Config::MHDConfig;
64
65 using NoneMHD = typename Cfg_MHD::None;
66 using IdealMHD = typename Cfg_MHD::IdealMHD_constrained_hyper_para;
67 using NonIdealMHD = typename Cfg_MHD::NonIdealMHD;
68
69 void update_derivs_MHD(IdealMHD cfg);
70 };
71
72} // namespace shammodels::sph::modules
std::uint32_t u32
32 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 sph model modules
The configuration for a sph solver.
AVConfig< Tvec > AVConfig
Configuration for the Artificial Viscosity (AV)