Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
collapse.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/math.hpp"
19#include "shammath/matrix.hpp"
22
23namespace shamphys {
24
25 template<class T>
26 T free_fall_time(T rho, T G) {
27 return sycl::sqrt(3 * shamunits::pi<T> / (32 * G * rho));
28 }
29
30 template<class T>
31 T free_fall_time(T rho, const shamunits::UnitSystem<T> usys = {}) {
32 return free_fall_time(rho, shamunits::Constants{usys}.G());
33 }
34
35} // namespace shamphys
Defines a unit system.
Physical constants.
constexpr T G()
get the value of G in the current unit system units