OGS
|
Implementation of OpenGeoSys simulation application python module.
Definition in file ogs_python_module.cpp.
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <spdlog/spdlog.h>
#include <tclap/CmdLine.h>
#include <algorithm>
#include "../ogs.mesh/OGSMesh.h"
#include "Applications/ApplicationsLib/Simulation.h"
#include "Applications/ApplicationsLib/TestDefinition.h"
#include "BaseLib/DateTools.h"
#include "BaseLib/Error.h"
#include "BaseLib/FileTools.h"
#include "BaseLib/Logging.h"
#include "BaseLib/RunTime.h"
#include "CommandLineArgumentParser.h"
#include "InfoLib/GitInfo.h"
#include "ogs_embedded_python.h"
Go to the source code of this file.
Functions | |
int | initOGS (std::vector< std::string > &argv_str) |
int | executeSimulation () |
int | executeTimeStep () |
double | currentTime () |
double | endTime () |
OGSMesh | getMesh (std::string const &name) |
void | finalize () |
PYBIND11_MODULE (simulator, m) | |
Variables | |
std::unique_ptr< Simulation > | simulation |
static constexpr int | EXIT_ARGPARSE_FAILURE = 3 |
static constexpr int | EXIT_ARGPARSE_EXIT_OK = 2 |
double currentTime | ( | ) |
Definition at line 163 of file ogs_python_module.cpp.
References simulation.
Referenced by PYBIND11_MODULE().
double endTime | ( | ) |
Definition at line 168 of file ogs_python_module.cpp.
References simulation.
Referenced by PYBIND11_MODULE().
int executeSimulation | ( | ) |
Definition at line 110 of file ogs_python_module.cpp.
References BaseLib::RunTime::elapsed(), ERR(), BaseLib::formatDate(), INFO(), simulation, and BaseLib::RunTime::start().
Referenced by PYBIND11_MODULE().
int executeTimeStep | ( | ) |
Definition at line 147 of file ogs_python_module.cpp.
References ERR(), and simulation.
Referenced by PYBIND11_MODULE().
void finalize | ( | ) |
Definition at line 178 of file ogs_python_module.cpp.
References simulation, and BaseLib::unsetProjectDirectory().
Referenced by PYBIND11_MODULE().
OGSMesh getMesh | ( | std::string const & | name | ) |
Definition at line 173 of file ogs_python_module.cpp.
References simulation.
Referenced by MeshElementRemovalDialog::accept(), MeshView::convertMeshToGeometry(), MeshView::exportToShapefile(), MeshView::exportToTetGen(), MeshView::extractSurfaceMesh(), ProcessLib::AssemblyMixin< Process >::initializeAssemblyOnSubmeshes(), MeshElementRemovalDialog::on_boundingBoxCheckBox_toggled(), MeshView::openAddLayerDialog(), PYBIND11_MODULE(), and MeshView::writeToFile().
int initOGS | ( | std::vector< std::string > & | argv_str | ) |
Definition at line 39 of file ogs_python_module.cpp.
References BaseLib::createOutputDirectory(), ERR(), EXIT_ARGPARSE_EXIT_OK, EXIT_ARGPARSE_FAILURE, BaseLib::formatDate(), INFO(), BaseLib::initOGSLogger(), CommandLineArguments::log_level, CommandLineArguments::mesh_dir, CommandLineArguments::nonfatal, GitInfoLib::GitInfo::ogs_version, CommandLineArguments::outdir, parseCommandLineArguments(), CommandLineArguments::project, CommandLineArguments::reference_path, CommandLineArguments::reference_path_is_set, CommandLineArguments::script_dir, simulation, CommandLineArguments::write_prj, and CommandLineArguments::xml_patch_file_names.
Referenced by PYBIND11_MODULE().
PYBIND11_MODULE | ( | simulator | , |
m | ) |
To use this module import dependencies first: import ogs.mesh as mesh import ogs.simulator as sim
See also https://github.com/pybind/pybind11/issues/1391#issuecomment-912642979
Definition at line 195 of file ogs_python_module.cpp.
References currentTime(), endTime(), executeSimulation(), executeTimeStep(), finalize(), getMesh(), and initOGS().
|
staticconstexpr |
Definition at line 35 of file ogs_python_module.cpp.
Referenced by initOGS().
|
staticconstexpr |
Definition at line 34 of file ogs_python_module.cpp.
Referenced by initOGS().
std::unique_ptr<Simulation> simulation |
Definition at line 32 of file ogs_python_module.cpp.
Referenced by currentTime(), endTime(), executeSimulation(), executeTimeStep(), finalize(), getMesh(), initOGS(), and main().