Orrery
A GPU-accelerated N-body gravitational simulator
Toggle main menu visibility
Loading...
Searching...
No Matches
force_solver.hpp
Go to the documentation of this file.
1
#pragma once
2
25
26
#include <string_view>
27
28
#include "
orrery/core/softening.hpp
"
29
#include "
orrery/integrators/acceleration_field.hpp
"
30
#include "
orrery/solvers/interaction_count.hpp
"
31
32
namespace
orrery::solvers {
33
41
class
ForceSolver :
public
integrators::AccelerationField
{
42
public
:
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
78
protected:
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
acceleration_field.hpp
What an integrator is allowed to know about gravity.
orrery::integrators::AccelerationField
The acceleration produced by a set of masses at a set of positions.
Definition
acceleration_field.hpp:37
orrery::solvers::ForceSolver::softening
virtual core::Softening softening() const noexcept=0
The softening this solver applies.
orrery::solvers::ForceSolver::~ForceSolver
~ForceSolver() override=default
Public and virtual, the second by inheritance from AccelerationField.
orrery::solvers::ForceSolver::interaction_count
virtual InteractionCount interaction_count() const noexcept=0
The work done since construction or since the last reset.
orrery::solvers::ForceSolver::name
virtual std::string_view name() const noexcept=0
The solver's name, for benchmark tables and test messages.
orrery::solvers::ForceSolver::reset_interaction_count
virtual void reset_interaction_count() noexcept=0
Set every counter back to zero.
interaction_count.hpp
The unit in which the cost of a force evaluation is reported.
softening.hpp
Plummer softening, defined once for everything that needs it.
orrery::solvers::InteractionCount
What a solver has done since the count was last reset.
Definition
interaction_count.hpp:37
orrery
solvers
force_solver.hpp
Generated by
1.17.0