87namespace orrery::solvers {
96 std::uint64_t particle_particle{};
97 std::uint64_t particle_cell{};
113 std::span<const core::Real> masses,
core::Index target,
134 const core::Real factor =
137 return offset * factor;
157 const core::Real inverse =
164 const core::Real inverse_squared = inverse * inverse;
165 const core::Real inverse_fifth = inverse_squared * inverse_squared * inverse;
166 const core::Real inverse_seventh = inverse_fifth * inverse_squared;
171 (moment.xx * offset.x) + (moment.xy * offset.y) + (moment.xz * offset.z),
172 (moment.xy * offset.x) + (moment.yy * offset.y) + (moment.yz * offset.z),
173 (moment.xz * offset.x) + (moment.yz * offset.y) + (moment.zz * offset.z)};
175 const core::Real quadratic = core::dot(offset, contracted);
177 return (contracted * -inverse_fifth) +
178 (offset * (
static_cast<core::Real
>(2.5) * quadratic * inverse_seventh));
The softening length of the Plummer kernel above.
Definition softening.hpp:49
The octree of one configuration, built from Morton-sorted particles.
Definition octree.hpp:208
The innermost loop of the direct solver, in more than one instruction set.
core::Vec3(*)(core::Vec3Span< const core::Real > positions, std::span< const core::Real > masses, core::Vec3 target, core::Index begin, core::Index end, core::Softening softening) noexcept AccumulateRange
The signature both kernels have.
Definition direct_kernel.hpp:106
The tree the Barnes-Hut solver walks, and the moments it carries.
Plummer softening, defined once for everything that needs it.
Real softened_inverse_distance(Real separation_squared, Softening softening) noexcept
The factor 1 / sqrt(r^2 + eps^2) of the softened potential.
Definition softening.hpp:82
Real softened_inverse_distance_cubed(Real separation_squared, Softening softening) noexcept
The factor 1 / (r^2 + eps^2)^(3/2) of the softened acceleration.
Definition softening.hpp:95
A view of three component arrays of equal length.
Definition vec3_span.hpp:33
A vector in three-dimensional Euclidean space.
Definition vec3.hpp:26
The traceless second moment of a cell about its centre of mass.
Definition octree.hpp:89
What one walk did, in the two units InteractionCount reports.
Definition tree_walk.hpp:95
core::Vec3 quadrupole_acceleration(core::Vec3 offset, const Quadrupole &moment, core::Softening softening) noexcept
The correction the quadrupole moment adds to the term above.
Definition tree_walk.hpp:155
core::Vec3 walk_tree(const Octree &tree, core::Vec3Span< const core::Real > positions, std::span< const core::Real > masses, core::Index target, core::Softening softening, AccumulateRange accumulate, WalkCounts &counts) noexcept
The acceleration on the particle at target, without the factor of G.
core::Vec3 monopole_acceleration(core::Vec3 offset, core::Real mass, core::Softening softening) noexcept
The acceleration at offset from a cell of the given mass, without the factor of G.
Definition tree_walk.hpp:128
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
A three-component vector for interfaces, not for storage.
constexpr Real squared_norm(Vec3 v) noexcept
The squared length.
Definition vec3.hpp:108
Three parallel component arrays, viewed as one sequence of 3-vectors.