Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamphys
include
shamphys
Planets.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
#include "
shambackends/sycl.hpp
"
19
#include "
shamunits/Constants.hpp
"
20
#include "
shamunits/UnitSystem.hpp
"
21
22
namespace
shamphys {
23
24
template
<
class
T>
25
T hill_radius(T R, T m, T M) {
26
return
R * sycl::cbrt(m / (3 * M));
27
}
28
29
template
<
class
T>
30
T keplerian_speed(T G, T M, T R) {
31
return
sycl::sqrt(G * M / R);
32
}
33
34
template
<
class
T,
class
Tu>
35
T keplerian_speed(T M, T R,
const
shamunits::UnitSystem<Tu>
usys = {}) {
36
return
keplerian_speed(
shamunits::Constants
{usys}.
G
(), M, R);
37
}
38
39
}
// namespace shamphys
Constants.hpp
UnitSystem.hpp
shamunits::UnitSystem
Defines a unit system.
Definition
UnitSystem.hpp:77
shamunits::Constants
Physical constants.
Definition
Constants.hpp:112
shamunits::Constants::G
constexpr T G()
get the value of G in the current unit system units
Definition
Constants.hpp:175
sycl.hpp
Generated on Wed May 13 2026 13:21:49 for Shamrock by
1.9.8