Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
AnalysisSodTube.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"
23#include "shamphys/SodTube.hpp"
25
27
28 template<class Tvec, template<class> class SPHKernel>
30 public:
31 using Tscal = shambase::VecComponent<Tvec>;
33 using Kernel = SPHKernel<Tscal>;
34
37
38 ShamrockCtx &context;
39 Config &solver_config;
40 Storage &storage;
41
42 shamphys::SodTube solution;
43 Tvec direction;
44 Tscal time_val;
45 Tscal x_ref; // shock centered on x_ref
46 Tscal x_min, x_max; // check only between [x_min, x_max ]
47
49 ShamrockCtx &context,
50 Config &solver_config,
51 Storage &storage,
52 shamphys::SodTube &solution,
53 Tvec direction,
54 Tscal time_val,
55 Tscal x_ref,
56 Tscal x_min,
57 Tscal x_max)
58 : context(context), solver_config(solver_config), storage(storage), solution(solution),
59 direction(direction), time_val(time_val), x_ref(x_ref), x_min(x_min), x_max(x_max) {}
60
61 struct field_val {
62 Tscal rho;
63 Tvec v;
64 Tscal P;
65 };
66
67 field_val compute_L2_dist();
68
69 private:
70 inline PatchScheduler &scheduler() { return shambase::get_check_ref(context.sched); }
71 };
72
73} // 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.