OGS
ProjectData.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <map>
17#include <memory>
18#include <optional>
19#include <string>
20
28#include "ProcessLib/Process.h"
30
31#ifdef OGS_EMBED_PYTHON_INTERPRETER
32#include <pybind11/embed.h>
33#endif
34
35namespace GeoLib
36{
37struct NamedRaster;
38}
39
40namespace MeshLib
41{
42class Mesh;
43}
44
45namespace NumLib
46{
48}
49
50namespace ProcessLib
51{
52class TimeLoop;
53}
54
60class ProjectData final
61{
62public:
66
76 ProjectData(BaseLib::ConfigTree const& project_config,
77 std::string const& project_directory,
78 std::string const& output_directory,
79 std::string const& mesh_directory,
80 [[maybe_unused]] std::string const& script_directory);
81
83
84 //
85 // Process interface
86 //
87
89 std::vector<std::unique_ptr<ProcessLib::Process>> const& getProcesses()
90 const
91 {
92 return _processes;
93 }
94
96
97 MeshLib::Mesh& getMesh(std::string const& mesh_name) const;
98
99 std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
100 getMedia() const
101 {
102 return _media;
103 }
104
105private:
110 BaseLib::ConfigTree const& process_variables_config);
111
115 std::vector<std::string> parseParameters(
116 BaseLib::ConfigTree const& parameters_config);
117
119 void parseMedia(std::optional<BaseLib::ConfigTree> const& media_config);
120
124 void parseProcesses(BaseLib::ConfigTree const& processes_config,
125 std::string const& project_directory,
126 std::string const& output_directory,
127 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
128 chemical_solver_interface);
129
131 void parseTimeLoop(BaseLib::ConfigTree const& config,
132 const std::string& output_directory);
133
134 void parseLinearSolvers(BaseLib::ConfigTree const& config);
135
136 void parseNonlinearSolvers(BaseLib::ConfigTree const& config);
137
138 void parseCurves(std::optional<BaseLib::ConfigTree> const& config);
139
140 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
142 std::optional<BaseLib::ConfigTree> const& config,
143 const std::string& output_directory);
144
145 std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
146 std::vector<GeoLib::NamedRaster> _named_rasters;
147 std::vector<std::unique_ptr<ProcessLib::Process>> _processes;
148 std::vector<ProcessLib::ProcessVariable> _process_variables;
149
151 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> _parameters;
152
153 std::optional<ParameterLib::CoordinateSystem> _local_coordinate_system;
154
155 std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> _media;
156
158 std::unique_ptr<ProcessLib::TimeLoop> _time_loop;
159
160 std::map<std::string, std::unique_ptr<GlobalLinearSolver>> _linear_solvers;
161
162 std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>
164 std::map<std::string,
165 std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
167
168#ifdef OGS_EMBED_PYTHON_INTERPRETER
169 std::optional<pybind11::scoped_interpreter> _py_scoped_interpreter;
170#endif
171};
Definition of the PiecewiseLinearInterpolation class.
Time loop capable of time-integrating several processes at once.
Definition TimeLoop.h:38
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
ProcessLib::TimeLoop & getTimeLoop()
Definition ProjectData.h:95
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
MeshLib::Mesh & getMesh(std::string const &mesh_name) const
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &project_directory, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > parseChemicalSolverInterface(std::optional< BaseLib::ConfigTree > const &config, const std::string &output_directory)
void parseMedia(std::optional< BaseLib::ConfigTree > const &media_config)
Parses media configuration and saves them in an object.
void parseLinearSolvers(BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
std::vector< GeoLib::NamedRaster > _named_rasters
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & getMedia() const
std::vector< ProcessLib::ProcessVariable > _process_variables
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
void parseTimeLoop(BaseLib::ConfigTree const &config, const std::string &output_directory)
Parses the time loop configuration.
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > _media
ProjectData(ProjectData &)=delete
std::vector< std::string > parseParameters(BaseLib::ConfigTree const &parameters_config)
std::vector< std::unique_ptr< ProcessLib::Process > > const & getProcesses() const
Provides read access to the process container.
Definition ProjectData.h:89
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project's processes.