OGS 6.2.0-244-g47b8a9a9d
ProjectData.h
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include <boost/optional/optional.hpp>
16 #include <map>
17 #include <memory>
18 #include <string>
19 
20 #include "BaseLib/ConfigTree.h"
21 #include "MaterialLib/MPL/Medium.h"
23 
25 #include "ParameterLib/Parameter.h"
26 #include "ProcessLib/Process.h"
28 
29 namespace MeshLib
30 {
31 class Mesh;
32 }
33 
34 namespace NumLib
35 {
37 }
38 
39 namespace ProcessLib
40 {
41 class TimeLoop;
42 }
43 
49 class ProjectData final
50 {
51 public:
54  ProjectData();
55 
62  ProjectData(BaseLib::ConfigTree const& config_tree,
63  std::string const& project_directory,
64  std::string const& output_directory);
65 
66  ProjectData(ProjectData&) = delete;
67 
68 
69  //
70  // Process interface
71  //
72 
74  std::map<std::string, std::unique_ptr<ProcessLib::Process>> const&
75  getProcesses() const
76  {
77  return _processes;
78  }
79 
80  ProcessLib::TimeLoop& getTimeLoop() { return *_time_loop; }
81 
82 private:
86  void parseProcessVariables(
87  BaseLib::ConfigTree const& process_variables_config);
88 
92  std::vector<std::string> parseParameters(
93  BaseLib::ConfigTree const& parameters_config);
94 
96  void parseMedia(boost::optional<BaseLib::ConfigTree> const& media_config);
97 
101  void parseProcesses(BaseLib::ConfigTree const& process_config,
102  std::string const& project_directory,
103  std::string const& output_directory);
104 
106  void parseTimeLoop(BaseLib::ConfigTree const& config,
107  const std::string& output_directory);
108 
109  void parseLinearSolvers(BaseLib::ConfigTree const& config);
110 
111  void parseNonlinearSolvers(BaseLib::ConfigTree const& config);
112 
113  void parseCurves(boost::optional<BaseLib::ConfigTree> const& config);
114 
115  std::unique_ptr<MaterialPropertyLib::Medium> _medium;
116  std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
117  std::map<std::string, std::unique_ptr<ProcessLib::Process>> _processes;
118  std::vector<ProcessLib::ProcessVariable> _process_variables;
119 
121  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> _parameters;
122 
123  boost::optional<ParameterLib::CoordinateSystem> _local_coordinate_system;
124 
125  std::map<int, std::unique_ptr<MaterialPropertyLib::Medium>> _media;
126 
128  std::unique_ptr<ProcessLib::TimeLoop> _time_loop;
129 
130  std::map<std::string, std::unique_ptr<GlobalLinearSolver>> _linear_solvers;
131 
132  std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>
134  std::map<std::string,
135  std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
137 };
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
Definition: ProjectData.h:121
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:116
std::map< std::string, std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:117
Definition of the PiecewiseLinearInterpolation class.
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:133
std::map< std::string, std::unique_ptr< ProcessLib::Process > > const & getProcesses() const
Provides read access to the process container.
Definition: ProjectData.h:75
ProcessLib::TimeLoop & getTimeLoop()
Definition: ProjectData.h:80
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project&#39;s processes.
Definition: ProjectData.h:128
std::map< int, std::unique_ptr< MaterialPropertyLib::Medium > > _media
Definition: ProjectData.h:125
Time loop capable of time-integrating several processes at once.
Definition: TimeLoop.h:35
std::unique_ptr< MaterialPropertyLib::Medium > _medium
Definition: ProjectData.h:115
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:130
boost::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:123
Interface for heuristic search length strategy.
Definition: ProjectData.h:29
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:118
static std::string project_directory
The directory where the prj file resides.
Definition: FileTools.cpp:25
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:136