Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
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
19
20namespace 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
Defines a unit system.
Physical constants.
constexpr T c()
get c in the current unit system units (m.s-1)
constexpr T G()
get the value of G in the current unit system units