Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
force_solver.hpp
Go to the documentation of this file.
1#pragma once
2
25
26#include <string_view>
27
31
32namespace orrery::solvers {
33
41class ForceSolver : public integrators::AccelerationField {
42public:
51 ~ForceSolver() override = default;
52
54 [[nodiscard]] virtual std::string_view name() const noexcept = 0;
55
64 [[nodiscard]] virtual core::Softening softening() const noexcept = 0;
65
69 [[nodiscard]] virtual InteractionCount interaction_count() const noexcept = 0;
70
76 virtual void reset_interaction_count() noexcept = 0;
77
78protected:
79 // As on `AccelerationField`, and for the same reasons: a class with a
80 // virtual destructor suppresses the implicit copy and move operations, and
81 // copying an implementation through a reference to this base would slice it.
82 ForceSolver() = default;
83 ForceSolver(const ForceSolver&) = default;
84 ForceSolver(ForceSolver&&) = default;
85 ForceSolver& operator=(const ForceSolver&) = default;
86 ForceSolver& operator=(ForceSolver&&) = default;
87};
88
89} // namespace orrery::solvers
What an integrator is allowed to know about gravity.
The acceleration produced by a set of masses at a set of positions.
Definition acceleration_field.hpp:37
virtual core::Softening softening() const noexcept=0
The softening this solver applies.
~ForceSolver() override=default
Public and virtual, the second by inheritance from AccelerationField.
virtual InteractionCount interaction_count() const noexcept=0
The work done since construction or since the last reset.
virtual std::string_view name() const noexcept=0
The solver's name, for benchmark tables and test messages.
virtual void reset_interaction_count() noexcept=0
Set every counter back to zero.
The unit in which the cost of a force evaluation is reported.
Plummer softening, defined once for everything that needs it.
What a solver has done since the count was last reset.
Definition interaction_count.hpp:37