Orrery
A GPU-accelerated N-body gravitational simulator
Toggle main menu visibility
Loading...
Searching...
No Matches
plummer.hpp
Go to the documentation of this file.
1
#pragma once
2
24
25
#include <numbers>
26
27
#include "
orrery/core/particle_data.hpp
"
28
#include "
orrery/core/random.hpp
"
29
#include "
orrery/core/types.hpp
"
30
31
namespace
orrery::initial_conditions {
32
41
inline
constexpr
core::Real
kStandardPlummerRadius
= 3 * std::numbers::pi_v<core::Real> / 16;
42
44
struct
PlummerParameters
{
45
core::Index
count = 0;
46
54
core::Real
total_mass
= 1;
55
56
core::Real scale_radius =
kStandardPlummerRadius
;
57
72
core::Real
mass_fraction_cutoff
=
static_cast<
core::Real
>
(0.999);
73
};
74
79
[[nodiscard]]
core::ParticleData
make_plummer_sphere
(
const
PlummerParameters
& parameters,
80
core::RandomSource
& random);
81
90
[[nodiscard]] core::Real
plummer_potential_energy
(
const
PlummerParameters
& parameters);
91
96
[[nodiscard]] core::Real
plummer_kinetic_energy
(
const
PlummerParameters
& parameters);
97
101
[[nodiscard]] core::Real
plummer_total_energy
(
const
PlummerParameters
& parameters);
102
103
}
// namespace orrery::initial_conditions
orrery::core::ParticleData
Storage for a set of point masses in structure-of-arrays layout.
Definition
particle_data.hpp:43
orrery::core::RandomSource
A seeded stream of random numbers.
Definition
random.hpp:46
particle_data.hpp
The particle store: one contiguous array per component.
orrery::initial_conditions::kStandardPlummerRadius
constexpr core::Real kStandardPlummerRadius
The scale radius that puts a unit-mass Plummer sphere into standard N-body units, where the total ene...
Definition
plummer.hpp:41
orrery::initial_conditions::plummer_total_energy
core::Real plummer_total_energy(const PlummerParameters ¶meters)
The total energy of the model, -3 pi G M^2 / 64 a.
orrery::initial_conditions::plummer_potential_energy
core::Real plummer_potential_energy(const PlummerParameters ¶meters)
The potential energy of the model, -3 pi G M^2 / 32 a.
orrery::initial_conditions::plummer_kinetic_energy
core::Real plummer_kinetic_energy(const PlummerParameters ¶meters)
The kinetic energy of the model, 3 pi G M^2 / 64 a.
orrery::initial_conditions::make_plummer_sphere
core::ParticleData make_plummer_sphere(const PlummerParameters ¶meters, core::RandomSource &random)
Sample count particles from the model, in the centre-of-mass frame.
random.hpp
The project's source of randomness, and the only one.
orrery::initial_conditions::PlummerParameters
A Plummer sphere to sample.
Definition
plummer.hpp:44
orrery::initial_conditions::PlummerParameters::total_mass
core::Real total_mass
Shared equally among the particles.
Definition
plummer.hpp:54
orrery::initial_conditions::PlummerParameters::mass_fraction_cutoff
core::Real mass_fraction_cutoff
The fraction of the model's mass the sample is drawn from.
Definition
plummer.hpp:72
types.hpp
The scalar and index types that every layer of the project agrees on.
orrery::core::Index
std::size_t Index
The type of a particle index and of any count of particles.
Definition
types.hpp:45
orrery
initial_conditions
plummer.hpp
Generated by
1.17.0