Commit 47ca83e3 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

deleted benchmark tests

parent bfe7f43d
#include "main/MainProgram.hpp"
#include "ConfigMapsForTest.hpp"
#include "TestEnvironment.hpp"
using ConfigMap = std::map<std::string, std::string>;
struct ConfigMapsForTest {
ConfigMap defaultMap;
ConfigMap additionalConfigMap;
};
class TestEllipticResults : public TestWithParam<ConfigMapsForTest> {
protected:
std::unique_ptr<MainProgram> mainProgram;
void SetUp() override {
std::map<std::string, std::string> finalMap =
GetParam().defaultMap;
std::map<std::string, std::string> additionalMap =
GetParam().additionalConfigMap;
for (auto &pair: additionalMap)
finalMap[pair.first] = pair.second;
Config::initialize(finalMap);
mainProgram = std::make_unique<MainProgram>();
mainProgram->Initialize();
}
};
/*
* Elliptic Convergence Results
*
*/
class TestEllipticConvergenceResults : public TestEllipticResults {};
INSTANTIATE_TEST_CASE_P(TestEllipticResults, TestEllipticConvergenceResults, Values(
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "500"},
{"Problem", "StochasticLaplace2D"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "500"},
{"Problem", "StochasticLaplace2D"},
{"sigma", "1.5"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "500"},
{"Problem", "StochasticLaplace2D"},
{"sigma", "2.0"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "500"},
{"Problem", "StochasticLaplace2D"},
{"lambda", "0.05"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "500"},
{"Problem", "StochasticLaplace2D"},
{"lambda", "0.15"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "20"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.4"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "500"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.8"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "ConvergenceTest"},
{"initLevels", "[3, 4, 5, 6, 7, 8, 9]"},
{"maxLevel", "9"},
{"uniformSampleAmount", "500"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.8"}}}
));
TEST_P(TestEllipticConvergenceResults, TestResults) {
ASSERT_EQ(mainProgram->Run(), 0);
ASSERT_TRUE(mainProgram->mlmc->totalErr < mainProgram->epsilon);
}
/*
* Elliptic MLMC Results
*
*/
class TestEllipticMLMCResults : public TestEllipticResults {};
INSTANTIATE_TEST_CASE_P(TestEllipticResults, TestEllipticMLMCResults, Values(
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.01"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.4"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.005"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.4"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.001"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.4"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.0005"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.4"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.01"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.8"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.005"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.8"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.001"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.8"}}},
ConfigMapsForTest{defaultEllipticConfigMap, std::map<std::string, std::string>{
{"Experiment", "MLMCExperiment"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
{"epsilon", "0.0005"},
{"maxLevel", "10"},
{"Problem", "StochasticLaplace2D"},
{"smoothing", "1.8"}}}
));
TEST_P(TestEllipticMLMCResults, TestResults) {
ASSERT_EQ(mainProgram->Run(), 0);
ASSERT_TRUE(mainProgram->mlmc->totalErr < mainProgram->epsilon);
}
/*
* Elliptic Discretization Results
* TODO: Open Research Topic
*/
int main(int argc, char **argv) {
MppTest mppTest = MppTestBuilder(argc, argv).WithPPM().WithoutDefaultConfig().
WithScreenLogging().WithSearchPath("../../mlmc/");
return mppTest.RUN_ALL_MPP_TESTS();
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment