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"
22#include "shamphys/SodTube.hpp"
24
26
27 template<class Tvec, class TgridVec>
29 public:
30 using Tscal = shambase::VecComponent<Tvec>;
31 using Tgridscal = shambase::VecComponent<TgridVec>;
33 static constexpr u32 split_count = shambase::pow_constexpr<dim>(2);
34
37 using u_morton = u64;
38 using AMRBlock = typename Config::AMRBlock;
39
40 ShamrockCtx &context;
41 Config &solver_config;
42 Storage &storage;
43
44 shamphys::SodTube solution;
45 Tvec direction;
46 Tscal time_val;
47 Tscal x_ref; // shock centered on x_ref
48 Tscal x_min, x_max; // check only between [x_min, x_max ]
49
51 ShamrockCtx &context,
52 Config &solver_config,
53 Storage &storage,
54 shamphys::SodTube &solution,
55 Tvec direction,
56 Tscal time_val,
57 Tscal x_ref,
58 Tscal x_min,
59 Tscal x_max)
60 : context(context), solver_config(solver_config), storage(storage), solution(solution),
61 direction(direction), time_val(time_val), x_ref(x_ref), x_min(x_min), x_max(x_max) {}
62
63 struct field_val {
64 Tscal rho;
65 Tvec v;
66 Tscal P;
67 };
68
69 field_val compute_L2_dist();
70
71 private:
72 inline PatchScheduler &scheduler() { return shambase::get_check_ref(context.sched); }
73 };
74
75} // namespace shammodels::basegodunov::modules
std::uint32_t u32
32 bit unsigned integer
std::uint64_t u64
64 bit unsigned integer
The MPI scheduler.
void throw_with_loc(std::string message, SourceLocation loc=SourceLocation{})
Throw an exception and append the source location to it.
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 basegodunov model modules
utility class to handle AMR blocks
Definition AMRBlock.hpp:35