OGS
Simulation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include <optional>
5#ifdef USE_PETSC
6#include <vtkMPIController.h>
7#include <vtkSmartPointer.h>
8#endif
9
13
14class ProjectData;
15namespace MeshLib
16{
17class Mesh;
18}
19
20class Simulation final
21{
22public:
23 OGS_EXPORT_SYMBOL Simulation(int argc, char* argv[]);
24
26 std::string const& project,
27 std::vector<std::string> const& xml_patch_file_names,
28 bool reference_path_is_set, std::string const& reference_path,
29 bool nonfatal, std::string const& outdir, std::string const& mesh_dir,
30 std::string const& script_dir, bool write_prj);
31
32 OGS_EXPORT_SYMBOL double currentTime() const;
33 OGS_EXPORT_SYMBOL double endTime() const;
37 OGS_EXPORT_SYMBOL MeshLib::Mesh& getMesh(std::string const& name);
38 OGS_EXPORT_SYMBOL std::vector<std::string> getMeshNames() const;
39
40 OGS_EXPORT_SYMBOL std::optional<ApplicationsLib::TestDefinition>
41 getTestDefinition() const;
42
44
46 std::optional<ApplicationsLib::TestDefinition>& test_definition);
47
48private:
50#if defined(USE_PETSC)
51 vtkSmartPointer<vtkMPIController> controller;
52#endif
53 std::unique_ptr<ProjectData> project_data;
54 std::optional<ApplicationsLib::TestDefinition> test_definition;
55#if defined(OGS_USE_INSITU)
56 bool isInsituConfigured = false;
57#endif
58};
#define OGS_EXPORT_SYMBOL
OGS_EXPORT_SYMBOL double currentTime() const
OGS_EXPORT_SYMBOL bool executeSimulation()
OGS_EXPORT_SYMBOL std::optional< ApplicationsLib::TestDefinition > getTestDefinition() const
std::unique_ptr< ProjectData > project_data
Definition Simulation.h:53
bool isInsituConfigured
Definition Simulation.h:56
static OGS_EXPORT_SYMBOL int runTestDefinitions(std::optional< ApplicationsLib::TestDefinition > &test_definition)
std::optional< ApplicationsLib::TestDefinition > test_definition
Definition Simulation.h:54
OGS_EXPORT_SYMBOL MeshLib::Mesh & getMesh(std::string const &name)
OGS_EXPORT_SYMBOL double endTime() const
OGS_EXPORT_SYMBOL ~Simulation()
OGS_EXPORT_SYMBOL void initializeDataStructures(std::string const &project, std::vector< std::string > const &xml_patch_file_names, bool reference_path_is_set, std::string const &reference_path, bool nonfatal, std::string const &outdir, std::string const &mesh_dir, std::string const &script_dir, bool write_prj)
ApplicationsLib::LinearSolverLibrarySetup linear_solver_library_setup
Definition Simulation.h:49
OGS_EXPORT_SYMBOL bool executeTimeStep()
vtkSmartPointer< vtkMPIController > controller
Definition Simulation.h:51
OGS_EXPORT_SYMBOL void outputLastTimeStep() const
OGS_EXPORT_SYMBOL Simulation(int argc, char *argv[])
OGS_EXPORT_SYMBOL std::vector< std::string > getMeshNames() const