Shamrock
2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamphys
include
shamphys
BlackHoles.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 "
shamunits/Constants.hpp
"
19
20
namespace
shamphys {
21
22
template
<
class
T>
23
inline
T schwarzschild_radius(T M, T G, T c) {
24
return
2 * G * M / (c * c);
25
}
26
27
template
<
class
T,
class
Tu>
28
T schwarzschild_radius(T M,
const
shamunits::UnitSystem<Tu>
usys = {}) {
29
return
schwarzschild_radius(
30
M,
shamunits::Constants
{usys}.
G
(),
shamunits::Constants
{usys}.
c
());
31
}
32
33
}
// namespace shamphys
Constants.hpp
shamunits::UnitSystem
Defines a unit system.
Definition
UnitSystem.hpp:77
shamunits::Constants
Physical constants.
Definition
Constants.hpp:112
shamunits::Constants::c
constexpr T c()
get c in the current unit system units (m.s-1)
Definition
Constants.hpp:175
shamunits::Constants::G
constexpr T G()
get the value of G in the current unit system units
Definition
Constants.hpp:175
Generated on Wed May 13 2026 13:21:49 for Shamrock by
1.9.8