Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
uniform_sphere.hpp
Go to the documentation of this file.
1#pragma once
2
25
28#include "orrery/core/types.hpp"
29
30namespace orrery::initial_conditions {
31
34 core::Index count = 0;
35
38 core::Real total_mass = 1;
39
40 core::Real radius = 1;
41};
42
52 core::RandomSource& random);
53
59[[nodiscard]] core::Real uniform_sphere_potential_energy(const UniformSphereParameters& parameters);
60
61} // 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.
The project's source of randomness, and the only one.
A sphere of uniform density to sample.
Definition uniform_sphere.hpp:33
core::Real total_mass
Shared equally among the particles, so that the sampled density is uniform in mass as well as in numb...
Definition uniform_sphere.hpp:38
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
core::ParticleData make_uniform_sphere(const UniformSphereParameters &parameters, core::RandomSource &random)
Sample count particles uniformly through the sphere, at rest.
core::Real uniform_sphere_potential_energy(const UniformSphereParameters &parameters)
The potential energy of the model, -3 G M^2 / 5 R.