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