Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
plummer.hpp
Go to the documentation of this file.
1#pragma once
2
24
25#include <numbers>
26
29#include "orrery/core/types.hpp"
30
31namespace orrery::initial_conditions {
32
41inline constexpr core::Real kStandardPlummerRadius = 3 * std::numbers::pi_v<core::Real> / 16;
42
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
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
Storage for a set of point masses in structure-of-arrays layout.
Definition particle_data.hpp:43
A seeded stream of random numbers.
Definition random.hpp:46
The particle store: one contiguous array per component.
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
core::Real plummer_total_energy(const PlummerParameters &parameters)
The total energy of the model, -3 pi G M^2 / 64 a.
core::Real plummer_potential_energy(const PlummerParameters &parameters)
The potential energy of the model, -3 pi G M^2 / 32 a.
core::Real plummer_kinetic_energy(const PlummerParameters &parameters)
The kinetic energy of the model, 3 pi G M^2 / 64 a.
core::ParticleData make_plummer_sphere(const PlummerParameters &parameters, core::RandomSource &random)
Sample count particles from the model, in the centre-of-mass frame.
The project's source of randomness, and the only one.
A Plummer sphere to sample.
Definition plummer.hpp:44
core::Real total_mass
Shared equally among the particles.
Definition plummer.hpp:54
core::Real mass_fraction_cutoff
The fraction of the model's mass the sample is drawn from.
Definition plummer.hpp:72
The scalar and index types that every layer of the project agrees on.
std::size_t Index
The type of a particle index and of any count of particles.
Definition types.hpp:45