11 static void benchmarkGravity(
IGravity&
gravity, Benchmark::Context& context) {
25 while (context.running()) {
27 gravity.evalAll(pool, dv, stats);
38 BENCHMARK(
"BruteForceGravity",
"[gravity]", Benchmark::Context& context) {
40 benchmarkGravity(
gravity, context);
43 BENCHMARK(
"BarnesHut Octupole 0.2",
"[gravity]", Benchmark::Context& context) {
45 benchmarkGravity(
gravity, context);
48 BENCHMARK(
"BarnesHut Octupole 0.5",
"[gravity]", Benchmark::Context& context) {
50 benchmarkGravity(
gravity, context);
53 BENCHMARK(
"BarnesHut Octupole 0.8",
"[gravity]", Benchmark::Context& context) {
55 benchmarkGravity(
gravity, context);
58 BENCHMARK(
"BarnesHut Octupole 5",
"[gravity]", Benchmark::Context& context) {
60 benchmarkGravity(
gravity, context);
68 BENCHMARK(
"BarnesHut Monopole 0.5",
"[gravity]", Benchmark::Context& context) {
70 benchmarkGravity(
gravity, context);
78 while (context.running()) {
79 gravity.build(scheduler, storage);
84 BENCHMARK(
"BarnesHut build Sequential",
"[gravity]", Benchmark::Context& context) {
89 BENCHMARK(
"BarnesHut build ThreadPool",
"[gravity]", Benchmark::Context& context) {
Barnes-Hut algorithm for computation of gravitational acceleration.
Simple gravity solver evaluating all particle pairs.
BENCHMARK("BruteForceGravity", "[gravity]", Benchmark::Context &context)
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
SequentialScheduler SEQUENTIAL
Global instance of the sequential scheduler.
INLINE void clobberMemory()
Helper functions performing common tasks in unit testing and benchmarks.
Implements IScheduler interface using TBB.
Object providing safe access to continuous memory of data.
INLINE Iterator< StorageType > begin()
INLINE Iterator< StorageType > end()
Multipole approximation of distance particle.
Computes gravitational acceleration by summing up forces from all particle pairs.
Interface for computing gravitational interactions of particles.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Settings & set(const TEnum idx, TValue &&value, std::enable_if_t<!std::is_enum< std::decay_t< TValue >>::value, int >=0)
Saves a value into the settings.
Object holding various statistics about current run.
Container storing all quantities used within the simulations.
Array< TValue > & getD2t(const QuantityId key)
Retrieves a quantity second derivative from the storage, given its key and value type.
Thread pool capable of executing tasks concurrently.
static SharedPtr< ThreadPool > getGlobalInstance()
Returns the global instance of the thread pool.
Generic storage and input/output routines of settings.
@ ENERGY
Initial specific internal energy.
@ DENSITY
Density at zero pressure.
constexpr Float gravity
Gravitational constant (CODATA 2014)
Storage getGassStorage(const Size particleCnt, BodySettings settings, const IDomain &domain)
Returns a storage with ideal gas particles, having pressure, energy and sound speed.