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