OGS
ProjectData.h
Go to the documentation of this file.
1 
13 #pragma once
14 
15 #include <map>
16 #include <memory>
17 #include <optional>
18 #include <string>
19 
20 #include "BaseLib/ConfigTree.h"
22 #include "MaterialLib/MPL/Medium.h"
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:
55 
62  ProjectData(BaseLib::ConfigTree const& project_config,
63  std::string const& project_directory,
64  std::string const& output_directory);
65 
67 
68 
69  //
70  // Process interface
71  //
72 
74  std::vector<std::unique_ptr<ProcessLib::Process>> const& getProcesses()
75  const
76  {
77  return _processes;
78  }
79 
81 
82 private:
87  BaseLib::ConfigTree const& process_variables_config);
88 
92  std::vector<std::string> parseParameters(
93  BaseLib::ConfigTree const& parameters_config);
94 
96  void parseMedia(std::optional<BaseLib::ConfigTree> const& media_config);
97 
101  void parseProcesses(BaseLib::ConfigTree const& processes_config,
102  std::string const& project_directory,
103  std::string const& output_directory,
104  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
105  chemical_solver_interface);
106 
108  void parseTimeLoop(BaseLib::ConfigTree const& config,
109  const std::string& output_directory);
110 
111  void parseLinearSolvers(BaseLib::ConfigTree const& config);
112 
113  void parseNonlinearSolvers(BaseLib::ConfigTree const& config);
114 
115  void parseCurves(std::optional<BaseLib::ConfigTree> const& config);
116 
117  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
119  std::optional<BaseLib::ConfigTree> const& config,
120  const std::string& output_directory);
121 
122  std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
123  std::vector<std::unique_ptr<ProcessLib::Process>> _processes;
124  std::vector<ProcessLib::ProcessVariable> _process_variables;
125 
127  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> _parameters;
128 
129  std::optional<ParameterLib::CoordinateSystem> _local_coordinate_system;
130 
131  std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> _media;
132 
134  std::unique_ptr<ProcessLib::TimeLoop> _time_loop;
135 
136  std::map<std::string, std::unique_ptr<GlobalLinearSolver>> _linear_solvers;
137 
138  std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>
140  std::map<std::string,
141  std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
143 };
144 
148 std::vector<int> splitMaterialIdString(std::string const& material_id_string);
Definition of the PiecewiseLinearInterpolation class.
std::vector< int > splitMaterialIdString(std::string const &material_id_string)
Time loop capable of time-integrating several processes at once.
Definition: TimeLoop.h:37
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:136
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:129
ProcessLib::TimeLoop & getTimeLoop()
Definition: ProjectData.h:80
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:139
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.
Definition: ProjectData.h:127
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:123
std::vector< std::unique_ptr< ProcessLib::Process > > const & getProcesses() const
Provides read access to the process container.
Definition: ProjectData.h:74
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:124
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:142
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:122
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
Definition: ProjectData.h:131
ProjectData(ProjectData &)=delete
std::vector< std::string > parseParameters(BaseLib::ConfigTree const &parameters_config)
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project's processes.
Definition: ProjectData.h:134
std::string project_directory
The directory where the prj file resides.
Definition: FileTools.cpp:27