OGS 6.2.1-499-g3b941532c.dirty.20191012113459
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 
24 #include "ChemistryLib/PhreeqcIO.h"
26 #include "ParameterLib/Parameter.h"
27 #include "ProcessLib/Process.h"
29 
30 namespace MeshLib
31 {
32 class Mesh;
33 }
34 
35 namespace NumLib
36 {
38 }
39 
40 namespace ProcessLib
41 {
42 class TimeLoop;
43 }
44 
50 class ProjectData final
51 {
52 public:
55  ProjectData();
56 
63  ProjectData(BaseLib::ConfigTree const& project_config,
64  std::string const& project_directory,
65  std::string const& output_directory);
66 
67  ProjectData(ProjectData&) = delete;
68 
69 
70  //
71  // Process interface
72  //
73 
75  std::vector<std::unique_ptr<ProcessLib::Process>> const& getProcesses()
76  const
77  {
78  return _processes;
79  }
80 
81  ProcessLib::TimeLoop& getTimeLoop() { return *_time_loop; }
82 
83 private:
87  void parseProcessVariables(
88  BaseLib::ConfigTree const& process_variables_config);
89 
93  std::vector<std::string> parseParameters(
94  BaseLib::ConfigTree const& parameters_config);
95 
97  void parseMedia(boost::optional<BaseLib::ConfigTree> const& media_config);
98 
102  void parseProcesses(BaseLib::ConfigTree const& processes_config,
103  std::string const& project_directory,
104  std::string const& output_directory);
105 
107  void parseTimeLoop(BaseLib::ConfigTree const& config,
108  const std::string& output_directory);
109 
110  void parseLinearSolvers(BaseLib::ConfigTree const& config);
111 
112  void parseNonlinearSolvers(BaseLib::ConfigTree const& config);
113 
114  void parseCurves(boost::optional<BaseLib::ConfigTree> const& config);
115 
116  void parseChemicalSystem(boost::optional<BaseLib::ConfigTree> const& config,
117  const std::string& output_directory);
118 
119  std::unique_ptr<MaterialPropertyLib::Medium> _medium;
120  std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
121  std::vector<std::unique_ptr<ProcessLib::Process>> _processes;
122  std::vector<ProcessLib::ProcessVariable> _process_variables;
123 
125  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> _parameters;
126 
127  boost::optional<ParameterLib::CoordinateSystem> _local_coordinate_system;
128 
129  std::map<int, std::unique_ptr<MaterialPropertyLib::Medium>> _media;
130 
132  std::unique_ptr<ProcessLib::TimeLoop> _time_loop;
133 
134  std::map<std::string, std::unique_ptr<GlobalLinearSolver>> _linear_solvers;
135 
136  std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>
138  std::map<std::string,
139  std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
141 
142  std::unique_ptr<ChemistryLib::ChemicalSolverInterface> _chemical_system;
143 };
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
Definition: ProjectData.h:125
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:120
Definition of the PiecewiseLinearInterpolation class.
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:137
ProcessLib::TimeLoop & getTimeLoop()
Definition: ProjectData.h:81
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project&#39;s processes.
Definition: ProjectData.h:132
std::map< int, std::unique_ptr< MaterialPropertyLib::Medium > > _media
Definition: ProjectData.h:129
Time loop capable of time-integrating several processes at once.
Definition: TimeLoop.h:39
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > _chemical_system
Definition: ProjectData.h:142
std::unique_ptr< MaterialPropertyLib::Medium > _medium
Definition: ProjectData.h:119
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:134
boost::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:127
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:121
Interface for heuristic search length strategy.
Definition: ProjectData.h:30
std::vector< std::unique_ptr< ProcessLib::Process > > const & getProcesses() const
Provides read access to the process container.
Definition: ProjectData.h:75
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:122
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:140