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-fwd.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 
65  ProjectData(BaseLib::ConfigTree const& project_config,
66  std::string const& project_directory,
67  std::string const& output_directory,
68  std::string const& mesh_directory,
69  [[maybe_unused]] std::string const& script_directory);
70 
72 
73  //
74  // Process interface
75  //
76 
78  std::vector<std::unique_ptr<ProcessLib::Process>> const& getProcesses()
79  const
80  {
81  return _processes;
82  }
83 
85 
86 private:
91  BaseLib::ConfigTree const& process_variables_config);
92 
96  std::vector<std::string> parseParameters(
97  BaseLib::ConfigTree const& parameters_config);
98 
100  void parseMedia(std::optional<BaseLib::ConfigTree> const& media_config);
101 
105  void parseProcesses(BaseLib::ConfigTree const& processes_config,
106  std::string const& project_directory,
107  std::string const& output_directory,
108  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
109  chemical_solver_interface);
110 
112  void parseTimeLoop(BaseLib::ConfigTree const& config,
113  const std::string& output_directory);
114 
115  void parseLinearSolvers(BaseLib::ConfigTree const& config);
116 
117  void parseNonlinearSolvers(BaseLib::ConfigTree const& config);
118 
119  void parseCurves(std::optional<BaseLib::ConfigTree> const& config);
120 
121  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
123  std::optional<BaseLib::ConfigTree> const& config,
124  const std::string& output_directory);
125 
126  std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
127  std::vector<std::unique_ptr<ProcessLib::Process>> _processes;
128  std::vector<ProcessLib::ProcessVariable> _process_variables;
129 
131  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> _parameters;
132 
133  std::optional<ParameterLib::CoordinateSystem> _local_coordinate_system;
134 
135  std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> _media;
136 
138  std::unique_ptr<ProcessLib::TimeLoop> _time_loop;
139 
140  std::map<std::string, std::unique_ptr<GlobalLinearSolver>> _linear_solvers;
141 
142  std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>
144  std::map<std::string,
145  std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
147 };
148 
152 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:140
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:133
ProcessLib::TimeLoop & getTimeLoop()
Definition: ProjectData.h:84
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:143
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:131
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:127
std::vector< std::unique_ptr< ProcessLib::Process > > const & getProcesses() const
Provides read access to the process container.
Definition: ProjectData.h:78
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:128
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:146
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:126
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:135
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:138
std::string project_directory
The directory where the prj file resides.
Definition: FileTools.cpp:28