Commit 70c63c36 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

further test improvements

parent 310b96d3
# Includes for mlmc tests
#---------------------------------------------------------------------------------------#
# Test Executables
add_executable(TestMainProgram TestMainProgram.cpp)
add_executable(BenchmarkOldResults BenchmarkEllipticResults.cpp BenchmarkTransportResults.cpp)
#add_executable(TestMultilevelPlotter TestMultilevelPlotter.cpp)
# Manage folder structure build folder
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/gp)
......@@ -16,9 +11,15 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/tests/data/dual)
set(libs MLMC sprng SRC LIB_PS fftw3 m ${SUPERLU}
${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GTEST_LIB})
# Test Executables
add_executable(TestMainProgram TestMainProgram.cpp)
add_executable(BenchmarkEllipticResults BenchmarkEllipticResults.cpp)
add_executable(BenchmarkTransportResults BenchmarkTransportResults.cpp)
add_executable(TestMultilevelPlotter TestMultilevelPlotter.cpp)
# Linking
target_link_libraries(TestMainProgram ${libs})
target_link_libraries(BenchmarkOldResults ${libs})
#target_link_libraries(TestMultilevelPlotter MLMC SRC ${SUPERLU}
# ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GTEST_LIB})
target_link_libraries(BenchmarkEllipticResults ${libs})
target_link_libraries(BenchmarkTransportResults ${libs})
target_link_libraries(TestMultilevelPlotter ${libs})
#---------------------------------------------------------------------------------------#
......@@ -4,131 +4,132 @@
#include <map>
#include <string>
struct ConfigMapsForTest {
std::map<std::string, std::string> defaultEllipticConfigMap;
struct ConfigMapForTest {
std::map<std::string, std::string> additionalConfigMap;
};
const std::map<std::string, std::string> defaultEllipticConfigMap = {
// ----- Problem Settings -----
{"Experiment", "MLMCExperiment"},
{"Problem", "StochasticLaplace1D"},
{"Model", "LagrangeFEM"},
{"Functional", "L2"},
{"degree", "1"},
{"plevel", "2"},
// ----- Multilevel Monte Carlo -----
{"maxLevel", "7"},
{"epsilon", "0.01"},
{"mcOnly", "false"},
{"uniformSampleAmount", "100"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
// ----- Stochastic Field -----
{"StochasticField", "LogNormal"},
{"mean", "1.0"},
{"sigma", "1.0"},
{"norm_p", "2"},
{"lambda1", "0.15"},
{"lambda2", "0.15"},
{"smoothing", "1.8"},
{"evtol", "1e-10"},
// ----- Solver -----
{"LinearReduction", "1e-12"},
{"LinearEpsilon", "1e-10"},
{"LinearSteps", "3000"},
{"NewtonSteps", "1"},
{"NewtonLineSearchSteps", "0"},
// ----- Plotting -----
{"GeneratorPlotting", "0"},
{"MCPlotting", "0"},
// ----- Verbose ----- // Todo einfach größer null
{"MCVerbose", "1"},
{"PDEVerbose", "0"},
{"MLMCVerbose", "1"},
{"MainVerbose", "1"},
{"MeshVerbose", "0"},
{"ConfigVerbose", "0"},
{"LinearVerbose", "-1"}, // Todo 0 should be mute
{"NewtonVerbose", "-1"}, // Todo 0 should be mute
{"GeneratorVerbose", "0"},
// ----- Logging -----
{"TimeLevel", "-1"}, // Todo einfach größer null
{"MuteLevel", "-1"},
{"DebugLevel", "-1"},
};
const std::map<std::string, std::string> defaultEllipticConfigMap = {
// ----- Problem Settings -----
{"Experiment", "MLMCExperiment"},
{"Problem", "StochasticLaplace1D"},
{"Model", "LagrangeFEM"},
{"Functional", "L2"},
{"degree", "1"},
{"plevel", "2"},
// ----- Multilevel Monte Carlo -----
{"maxLevel", "7"},
{"epsilon", "0.01"},
{"mcOnly", "false"},
{"uniformSampleAmount", "100"},
{"initLevels", "[3, 4, 5]"},
{"initSampleAmount", "[12, 6, 3]"},
// ----- Stochastic Field -----
{"StochasticField", "LogNormal"},
{"mean", "1.0"},
{"sigma", "1.0"},
{"norm_p", "2"},
{"lambda1", "0.15"},
{"lambda2", "0.15"},
{"smoothing", "1.8"},
{"evtol", "1e-10"},
// ----- Solver -----
{"LinearReduction", "1e-12"},
{"LinearEpsilon", "1e-10"},
{"LinearSteps", "3000"},
{"NewtonSteps", "1"},
{"NewtonLineSearchSteps", "0"},
// ----- Plotting -----
{"GeneratorPlotting", "-1"},
{"MCPlotting", "-1"},
// ----- Verbose ----- // Todo einfach größer null
{"MCVerbose", "1"},
{"PDEVerbose", "0"},
{"MLMCVerbose", "1"},
{"MainVerbose", "1"},
{"MeshVerbose", "0"},
{"ConfigVerbose", "0"},
{"LinearVerbose", "-1"}, // Todo 0 should be mute
{"NewtonVerbose", "-1"}, // Todo 0 should be mute
{"GeneratorVerbose", "0"},
// ----- Logging -----
{"TimeLevel", "-1"}, // Todo einfach größer null
{"MuteLevel", "-1"},
{"DebugLevel", "-1"},
};
const std::map<std::string, std::string> defaultTransportConfigMap = {
// ----- Problem Settings -----
{"Experiment", "MLMCExperiment"},
{"Problem", "StochasticPollution1D"},
{"Model", "DGTransport"},
{"Functional", "Mass"},
{"Overlap", "dG1"},
{"flux_alpha", "1"},
{"degree", "2"},
{"plevel", "2"},
// ----- Time Series -----
{"TimeSeries", "uniform"},
{"rkorder", "-2"},
{"startTime", " 0.0"},
{"endTime", "1.0 "},
{"scaling", "8"},
{"Kmax", "250"},
{"gamma", "0.01"},
{"Keps", "1e-5"},
// ----- Multilevel Monte Carlo -----
{"maxLevel", "7"},
{"epsilon", "0.01"},
{"mcOnly", "false"},
{"uniformSampleAmount", "100"},
{"initLevels", "[4, 5, 6]"},
{"initSampleAmount", "[8, 4, 2]"},
// ----- Stochastic Field -----
{"StochasticField", "LogNormal"},
{"mean", "1.0"},
{"sigma", "1.0"},
{"norm_p", "2"},
{"lambda1", "0.10"},
{"lambda2", "0.10"},
{"smoothing", "1.9"},
{"evtol", "1e-10"},
// ----- Solver -----
{"LinearReduction", "1e-12"},
{"LinearEpsilon", "1e-10"},
{"LinearSteps", "3000"},
{"NewtonSteps", "1"},
{"NewtonLineSearchSteps", "0"},
// ----- Plotting -----
{"GeneratorPlotting", "-1"},
{"MCPlotting", "-1"},
// ----- Verbose ----- // Todo einfach größer null
{"MCVerbose", "1"},
{"PDEVerbose", "0"},
{"MLMCVerbose", "1"},
{"MainVerbose", "1"},
{"MeshVerbose", "0"},
{"ConfigVerbose", "0"},
{"LinearVerbose", "-1"}, // Todo 0 should be mute
{"NewtonVerbose", "-1"}, // Todo 0 should be mute
{"GeneratorVerbose", "0"},
// ----- Logging -----
{"TimeLevel", "-1"}, // Todo einfach größer null
{"MuteLevel", "-1"},
{"DebugLevel", "-1"},
};
const std::map<std::string, std::string> defaultTransportConfigMap = {
// ----- Problem Settings -----
{"Experiment", "MLMCExperiment"},
{"Problem", "StochasticPollution1D"},
{"Model", "DGTransport"},
{"Functional", "Mass"},
{"Overlap", "dG1"},
{"flux_alpha", "1"},
{"degree", "2"},
{"plevel", "2"},
// ----- Time Series -----
{"TimeSeries", "uniform"},
{"rkorder", "-2"},
{"startTime", " 0.0"},
{"endTime", "1.0 "},
{"scaling", "8"},
{"Kmax", "250"},
{"gamma", "0.01"},
{"Keps", "1e-5"},
// ----- Multilevel Monte Carlo -----
{"maxLevel", "7"},
{"epsilon", "0.01"},
{"mcOnly", "false"},
{"uniformSampleAmount", "100"},
{"initLevels", "[4, 5, 6]"},
{"initSampleAmount", "[8, 4, 2]"},
// ----- Stochastic Field -----
{"StochasticField", "LogNormal"},
{"mean", "1.0"},
{"sigma", "1.0"},
{"norm_p", "2"},
{"lambda1", "0.10"},
{"lambda2", "0.10"},
{"smoothing", "1.9"},
{"evtol", "1e-10"},
// ----- Solver -----
{"LinearReduction", "1e-12"},
{"LinearEpsilon", "1e-10"},
{"LinearSteps", "3000"},
{"NewtonSteps", "1"},
{"NewtonLineSearchSteps", "0"},
// ----- Plotting -----
{"GeneratorPlotting", "0"},
{"MCPlotting", "0"},
// ----- Verbose ----- // Todo einfach größer null
{"MCVerbose", "1"},
{"PDEVerbose", "0"},
{"MLMCVerbose", "1"},
{"MainVerbose", "1"},
{"MeshVerbose", "1"},
{"ConfigVerbose", "0"},
{"LinearVerbose", "-1"}, // Todo 0 should be mute
{"NewtonVerbose", "-1"}, // Todo 0 should be mute
{"GeneratorVerbose", "0"},
// ----- Logging -----
{"TimeLevel", "-1"}, // Todo einfach größer null
{"MuteLevel", "-1"},
{"DebugLevel", "-1"},
};
#endif //TESTMAINPROGRAM_HPP
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