BD_Integratoren/C++/benchmark/bench.cpp
2021-10-27 22:00:24 +02:00

30 lines
819 B
C++

//
// Created by jholder on 24.10.21.
//
#define CATCH_CONFIG_MAIN
#define CATCH_CONFIG_ENABLE_BENCHMARKING
#include <catch2/catch.hpp>
#include "legacy/Integratoren2d_forceless.h"
#include "Rod2d.hpp"
TEST_CASE("Euler - Baseline", "[benchmark]") {
Rod2d rod(1.0);
Simulation sim(0.01, Catch::rngSeed());
BENCHMARK("Euler without force") {
Integratoren2d_forceless::Set1_Euler(rod, sim);
};
BENCHMARK("Heun without force") {
Integratoren2d_forceless::Set2_Heun(rod, sim);
};
BENCHMARK("Exact without force") {
Integratoren2d_forceless::Set3_Exact(rod, sim);
};
BENCHMARK("BDAS without force") {
Integratoren2d_forceless::Set4_BDAS(rod, sim);
};
BENCHMARK("MBD without force") {
Integratoren2d_forceless::Set5_MBD(rod, sim);
};
}