Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
reconstruction.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
12#include "shambackends/math.hpp"
13
34
35namespace shammodels::gsph {
36
42 template<class Tscal>
44 Tscal V2;
45 Tscal s_ast;
46 };
47
62 template<class Tscal>
64 Tscal vol_a, Tscal vol_b, Tscal h_a, Tscal h_b, Tscal rab_inv) {
65
66 const Tscal C = (vol_a - vol_b) * rab_inv;
67 const Tscal D = Tscal{0.5} * (vol_a + vol_b);
68 const Tscal h2 = Tscal{0.5} * (h_a * h_a + h_b * h_b);
69
70 const Tscal V2 = Tscal{0.25} * h2 * C * C + D * D;
71 const Tscal s_ast = Tscal{0.5} * h2 * C * D * sham::inv_sat_zero(V2);
72
73 return EffectiveFace<Tscal>{V2, s_ast};
74 }
75
76} // namespace shammodels::gsph
T inv_sat_zero(T v, T satval=T{0.}) noexcept
inverse saturated (zero version)
Definition math.hpp:870
EffectiveFace< Tscal > lin_v2_sast_ij(Tscal vol_a, Tscal vol_b, Tscal h_a, Tscal h_b, Tscal rab_inv)
Linear (1st order) interpolation of the effective face between a pair.
Result of the effective face interpolation.
Tscal V2
Effective squared volume element for the pair.
Tscal s_ast
Effective face location (signed distance from particle a).