14#include <pybind11/pybind11.h>
15#include <spdlog/spdlog.h>
16#include <tclap/CmdLine.h>
48 _MM_SET_EXCEPTION_MASK(_MM_GET_EXCEPTION_MASK() & ~_MM_MASK_INVALID);
51 feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
56int main(
int argc,
char* argv[])
67 INFO(
"This is OpenGeoSys-6 version {:s}.",
73 auto const start_time = std::chrono::system_clock::now();
75 INFO(
"OGS started on {:s}.", time_str);
78 std::optional<ApplicationsLib::TestDefinition> test_definition{
80 auto ogs_status = EXIT_SUCCESS;
89 bool solver_succeeded =
false;
99 solver_succeeded =
simulation.executeSimulation();
101 test_definition =
simulation.getTestDefinition();
103 catch (pybind11::error_already_set
const& e)
105 OGS_FATAL(
"Python exception thrown: {}", e.what());
108 INFO(
"[time] Execution took {:g} s.", run_time.
elapsed());
109 ogs_status = solver_succeeded ? EXIT_SUCCESS : EXIT_FAILURE;
111 catch (std::exception& e)
114 ogs_status = EXIT_FAILURE;
118 auto const end_time = std::chrono::system_clock::now();
120 INFO(
"OGS terminated on {:s}.", time_str);
123 if (ogs_status == EXIT_FAILURE)
125 ERR(
"OGS terminated with error.");
129 if (!test_definition)
136 INFO(
"##########################################");
137 INFO(
"# Running tests #");
138 INFO(
"##########################################");
140 if (!test_definition->runTests())
142 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)
bool createOutputDirectory(std::string const &dir)
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