14#include <spdlog/spdlog.h>
15#include <tclap/CmdLine.h>
45 _MM_SET_EXCEPTION_MASK(_MM_GET_EXCEPTION_MASK() & ~_MM_MASK_INVALID);
48 feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
53int main(
int argc,
char* argv[])
64 INFO(
"This is OpenGeoSys-6 version {:s}.",
70 auto const start_time = std::chrono::system_clock::now();
72 INFO(
"OGS started on {:s}.", time_str);
75 std::optional<ApplicationsLib::TestDefinition> test_definition{
77 auto ogs_status = EXIT_SUCCESS;
89 bool solver_succeeded =
simulation.executeSimulation();
91 test_definition =
simulation.getTestDefinition();
93 INFO(
"[time] Execution took {:g} s.", run_time.
elapsed());
94 ogs_status = solver_succeeded ? EXIT_SUCCESS : EXIT_FAILURE;
96 catch (std::exception& e)
99 ogs_status = EXIT_FAILURE;
103 auto const end_time = std::chrono::system_clock::now();
105 INFO(
"OGS terminated on {:s}.", time_str);
108 if (ogs_status == EXIT_FAILURE)
110 ERR(
"OGS terminated with error.");
114 if (!test_definition)
121 INFO(
"##########################################");
122 INFO(
"# Running tests #");
123 INFO(
"##########################################");
125 if (!test_definition->runTests())
127 ERR(
"One of the tests failed.");
CommandLineArguments parseCommandLineArguments(int argc, char *argv[], bool const exit_on_exception)
Declaration of CommandLineArgumentParser.
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition of the RunTime class.
Declaration of class Simulation.
double elapsed() const
Get the elapsed time in seconds.
void start()
Start the timer.
void initOGSLogger(std::string const &log_level)
std::string formatDate(std::chrono::time_point< std::chrono::system_clock > const &time)
GITINFOLIB_EXPORT const std::string ogs_version
int main(int argc, char *argv[])
void enableFloatingPointExceptions()
std::unique_ptr< Simulation > simulation
bool reference_path_is_set
std::string reference_path
std::vector< std::string > xml_patch_file_names