Orrery
A GPU-accelerated N-body gravitational simulator
Toggle main menu visibility
Loading...
Searching...
No Matches
galaxy_collision.hpp
Go to the documentation of this file.
1
#pragma once
2
45
46
#include "
orrery/core/particle_data.hpp
"
47
#include "
orrery/core/random.hpp
"
48
#include "
orrery/core/types.hpp
"
49
#include "
orrery/core/vec3.hpp
"
50
#include "
orrery/initial_conditions/disc_galaxy.hpp
"
51
52
namespace
orrery::initial_conditions {
53
55
struct
GalaxyCollisionParameters
{
65
DiscGalaxyParameters
primary
;
66
67
DiscGalaxyParameters
secondary;
68
70
core::Real
separation
= 20;
71
80
core::Real
impact_parameter
= 2;
81
89
core::Real
approach_speed
=
static_cast<
core::Real
>
(0.8);
90
};
91
105
[[nodiscard]]
core::ParticleData
make_galaxy_collision
(
const
GalaxyCollisionParameters
& parameters,
106
core::RandomSource
& random);
107
113
[[nodiscard]]
core::Vec3
galaxy_collision_separation
(
const
GalaxyCollisionParameters
& parameters);
114
119
[[nodiscard]]
core::Vec3
120
galaxy_collision_relative_velocity
(
const
GalaxyCollisionParameters
& parameters);
121
127
[[nodiscard]] core::Real
galaxy_collision_orbit_energy
(
const
GalaxyCollisionParameters
& parameters);
128
129
}
// 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
disc_galaxy.hpp
A rotating disc galaxy: the configuration the project's demonstration is built from.
orrery::initial_conditions::galaxy_collision_relative_velocity
core::Vec3 galaxy_collision_relative_velocity(const GalaxyCollisionParameters ¶meters)
The relative velocity of the secondary with respect to the primary.
orrery::initial_conditions::make_galaxy_collision
core::ParticleData make_galaxy_collision(const GalaxyCollisionParameters ¶meters, core::RandomSource &random)
Sample both galaxies and place them on the encounter, in the combined centre-of-mass frame.
orrery::initial_conditions::galaxy_collision_orbit_energy
core::Real galaxy_collision_orbit_energy(const GalaxyCollisionParameters ¶meters)
The energy of the encounter, treating each galaxy as a point mass.
orrery::initial_conditions::galaxy_collision_separation
core::Vec3 galaxy_collision_separation(const GalaxyCollisionParameters ¶meters)
The separation vector from the primary's centre to the secondary's.
particle_data.hpp
The particle store: one contiguous array per component.
random.hpp
The project's source of randomness, and the only one.
orrery::core::Vec3
A vector in three-dimensional Euclidean space.
Definition
vec3.hpp:26
orrery::initial_conditions::DiscGalaxyParameters
A disc galaxy to sample.
Definition
disc_galaxy.hpp:77
orrery::initial_conditions::GalaxyCollisionParameters
An encounter between two disc galaxies.
Definition
galaxy_collision.hpp:55
orrery::initial_conditions::GalaxyCollisionParameters::approach_speed
core::Real approach_speed
The relative speed, as a multiple of the escape speed at the initial separation.
Definition
galaxy_collision.hpp:89
orrery::initial_conditions::GalaxyCollisionParameters::impact_parameter
core::Real impact_parameter
The y component of the separation, which is what makes the encounter grazing rather than head on.
Definition
galaxy_collision.hpp:80
orrery::initial_conditions::GalaxyCollisionParameters::primary
DiscGalaxyParameters primary
The galaxy that comes first in the particle array.
Definition
galaxy_collision.hpp:65
orrery::initial_conditions::GalaxyCollisionParameters::separation
core::Real separation
The x component of the separation between the two centres.
Definition
galaxy_collision.hpp:70
types.hpp
The scalar and index types that every layer of the project agrees on.
vec3.hpp
A three-component vector for interfaces, not for storage.
orrery
initial_conditions
galaxy_collision.hpp
Generated by
1.17.0