OGS 6.1.0-1721-g6382411ad
ProjectData.cpp
Go to the documentation of this file.
1 
14 #include "ProjectData.h"
15 
16 #include <algorithm>
17 #include <set>
18 
19 #include <logog/include/logog.hpp>
20 
21 #ifdef OGS_USE_PYTHON
22 #include <pybind11/eval.h>
23 #endif
24 
25 #include "BaseLib/Algorithm.h"
26 #include "BaseLib/FileTools.h"
27 
28 #include "GeoLib/GEOObjects.h"
34 #include "MeshLib/Mesh.h"
35 
39 
40 // FileIO
43 
46 
47 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
49 #endif
50 #ifdef OGS_BUILD_PROCESS_GROUNDWATERFLOW
52 #endif
53 #ifdef OGS_BUILD_PROCESS_HT
55 #endif
56 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
58 #endif
59 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
61 #endif
62 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
64 #endif
65 #ifdef OGS_BUILD_PROCESS_LIE
68 #endif
69 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
71 #endif
72 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
74 #endif
75 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
77 #endif
78 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
80 #endif
81 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
83 #endif
84 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
86 #endif
87 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
89 #endif
90 #ifdef OGS_BUILD_PROCESS_TES
92 #endif
93 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
95 #endif
96 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
98 #endif
99 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
101 #endif
102 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
104 #endif
105 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
107 #endif
108 
109 namespace
110 {
111 void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects)
112 {
113  DBUG("Reading geometry file '%s'.", fname.c_str());
114  GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
115  gml_reader.readFile(fname);
116 }
117 
118 std::unique_ptr<MeshLib::Mesh> readSingleMesh(
119  BaseLib::ConfigTree const& mesh_config_parameter,
120  std::string const& project_directory)
121 {
122  std::string const mesh_file = BaseLib::copyPathToFileName(
123  mesh_config_parameter.getValue<std::string>(), project_directory);
124  DBUG("Reading mesh file '%s'.", mesh_file.c_str());
125 
126  auto mesh = std::unique_ptr<MeshLib::Mesh>(
127  MeshLib::IO::readMeshFromFile(mesh_file));
128  if (!mesh)
129  {
130  OGS_FATAL("Could not read mesh from '%s' file. No mesh added.",
131  mesh_file.c_str());
132  }
133 
134 #ifdef DOXYGEN_DOCU_ONLY
135  mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
137 #endif // DOXYGEN_DOCU_ONLY
138 
139  if (auto const axially_symmetric =
141  mesh_config_parameter.getConfigAttributeOptional<bool>(
142  "axially_symmetric"))
143  {
144  mesh->setAxiallySymmetric(*axially_symmetric);
145  }
146 
147  return mesh;
148 }
149 
150 std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
151  BaseLib::ConfigTree const& config, std::string const& project_directory)
152 {
153  std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
154 
156  auto optional_meshes = config.getConfigSubtreeOptional("meshes");
157  if (optional_meshes)
158  {
159  DBUG("Reading multiple meshes.");
160  for (auto mesh_config :
162  optional_meshes->getConfigParameterList("mesh"))
163  {
164  meshes.push_back(readSingleMesh(mesh_config, project_directory));
165  }
166  }
167  else
168  { // Read single mesh with geometry.
169  WARN(
170  "Consider switching from mesh and geometry input to multiple "
171  "meshes input. See "
172  "https://www.opengeosys.org/docs/tools/model-preparation/"
173  "constructmeshesfromgeometry/ tool for conversion.");
175  meshes.push_back(readSingleMesh(config.getConfigParameter("mesh"),
177 
178  std::string const geometry_file = BaseLib::copyPathToFileName(
180  config.getConfigParameter<std::string>("geometry"),
181  project_directory);
182  GeoLib::GEOObjects geoObjects;
183  readGeometry(geometry_file, geoObjects);
184 
185  std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
187  auto additional_meshes =
189  geoObjects, *meshes[0], std::move(search_length_algorithm));
190 
191  std::move(begin(additional_meshes), end(additional_meshes),
192  std::back_inserter(meshes));
193  }
194  return meshes;
195 }
196 } // namespace
197 
198 ProjectData::ProjectData() = default;
199 
201  std::string const& project_directory,
202  std::string const& output_directory)
203 {
204  _mesh_vec = readMeshes(project_config, project_directory);
205 
206  if (auto const python_script =
208  project_config.getConfigParameterOptional<std::string>("python_script"))
209  {
210 #ifdef OGS_USE_PYTHON
211  namespace py = pybind11;
212 
213  // Append project's directory to python's module search path.
214  py::module::import("sys").attr("path").attr("append")(
216 
217  auto const script_path =
218  BaseLib::copyPathToFileName(*python_script, project_directory);
219 
220  // Evaluate in scope of main module
221  py::object scope = py::module::import("__main__").attr("__dict__");
222  py::eval_file(script_path, scope);
223 #else
224  OGS_FATAL("OpenGeoSys has not been built with Python support.");
225 #endif // OGS_USE_PYTHON
226  }
227 
229  parseCurves(project_config.getConfigSubtreeOptional("curves"));
230 
232  parseParameters(project_config.getConfigSubtree("parameters"));
233 
235  parseProcessVariables(project_config.getConfigSubtree("process_variables"));
236 
238  parseMedia(project_config.getConfigSubtreeOptional("media"));
239 
241  parseProcesses(project_config.getConfigSubtree("processes"),
242  project_directory, output_directory);
243 
245  parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
246 
248  parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
249 
251  parseTimeLoop(project_config.getConfigSubtree("time_loop"),
252  output_directory);
253 }
254 
256  BaseLib::ConfigTree const& process_variables_config)
257 {
258  DBUG("Parse process variables:");
259 
260  std::set<std::string> names;
261 
262  for (auto var_config
264  : process_variables_config.getConfigSubtreeList("process_variable"))
265  {
266  // Either the mesh name is given, or the first mesh's name will be
267  // taken. Taking the first mesh's value is deprecated.
268  auto const mesh_name =
270  var_config.getConfigParameter<std::string>("mesh",
271  _mesh_vec[0]->getName());
272 
273  auto& mesh = *BaseLib::findElementOrError(
274  begin(_mesh_vec), end(_mesh_vec),
275  [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
276  "Expected to find a mesh named " + mesh_name + ".");
277 
278  auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
279  _parameters};
280  if (!names.insert(pv.getName()).second)
281  OGS_FATAL("A process variable with name `%s' already exists.",
282  pv.getName().c_str());
283 
284  _process_variables.push_back(std::move(pv));
285  }
286 }
287 
288 void ProjectData::parseParameters(BaseLib::ConfigTree const& parameters_config)
289 {
290  using namespace ProcessLib;
291 
292  std::set<std::string> names;
293 
294  DBUG("Reading parameters:");
295  for (auto parameter_config :
297  parameters_config.getConfigSubtreeList("parameter"))
298  {
299  auto p =
300  ProcessLib::createParameter(parameter_config, _mesh_vec, _curves);
301  if (!names.insert(p->name).second)
302  OGS_FATAL("A parameter with name `%s' already exists.",
303  p->name.c_str());
304 
305  _parameters.push_back(std::move(p));
306  }
307 
308  _parameters.push_back(
309  std::make_unique<ProcessLib::ConstantParameter<double>>(
311 
312  for (auto& parameter : _parameters)
313  parameter->initialize(_parameters);
314 }
315 
317  boost::optional<BaseLib::ConfigTree> const& media_config)
318 {
319  if (!media_config)
320  return;
321 
322  DBUG("Reading media:");
323 
324  if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
325  {
326  ERR("A mesh is required to define medium materials.");
327  return;
328  }
329 
330  for (auto const& medium_config :
332  media_config->getConfigSubtreeList("medium"))
333  {
335  auto const material_id = medium_config.getConfigAttribute<int>("id", 0);
336 
337  if (_media.find(material_id) != _media.end())
338  {
339  OGS_FATAL(
340  "Multiple media were specified for the same material id %d. "
341  "Keep in mind, that if no material id is specified, it is "
342  "assumed to be 0 by default.",
343  material_id);
344  }
345 
346  _media[material_id] = MaterialPropertyLib::createMedium(medium_config);
347  }
348 
349  if (_media.empty())
350  {
351  OGS_FATAL("No entity is found inside <media>.");
352  }
353 }
354 
356  std::string const& project_directory,
357  std::string const& output_directory)
358 {
359  (void)project_directory; // to avoid compilation warning
360  (void)output_directory; // to avoid compilation warning
361 
362  DBUG("Reading processes:");
364  for (auto process_config : processes_config.getConfigSubtreeList("process"))
365  {
366  auto const type =
368  process_config.peekConfigParameter<std::string>("type");
369 
370  auto const name =
372  process_config.getConfigParameter<std::string>("name");
373 
374  auto const integration_order =
376  process_config.getConfigParameter<int>("integration_order");
377 
378  std::unique_ptr<ProcessLib::Process> process;
379 
380  auto jacobian_assembler = ProcessLib::createJacobianAssembler(
382  process_config.getConfigSubtreeOptional("jacobian_assembler"));
383 
384 #ifdef OGS_BUILD_PROCESS_GROUNDWATERFLOW
385  if (type == "GROUNDWATER_FLOW")
386  {
387  // The existence check of the in the configuration referenced
388  // process variables is checked in the physical process.
389  // TODO at the moment we have only one mesh, later there can be
390  // several meshes. Then we have to assign the referenced mesh
391  // here.
393  *_mesh_vec[0], std::move(jacobian_assembler),
394  _process_variables, _parameters, integration_order,
395  process_config, _mesh_vec, output_directory);
396  }
397  else
398 #endif
399 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
400  if (type == "LIQUID_FLOW")
401  {
403  *_mesh_vec[0], std::move(jacobian_assembler),
404  _process_variables, _parameters, integration_order,
405  process_config);
406  }
407  else
408 #endif
409 #ifdef OGS_BUILD_PROCESS_TES
410  if (type == "TES")
411  {
413  *_mesh_vec[0], std::move(jacobian_assembler),
414  _process_variables, _parameters, integration_order,
415  process_config);
416  }
417  else
418 #endif
419 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
420  if (type == "HEAT_CONDUCTION")
421  {
423  *_mesh_vec[0], std::move(jacobian_assembler),
424  _process_variables, _parameters, integration_order,
425  process_config);
426  }
427  else
428 #endif
429 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
430  if (type == "HEAT_TRANSPORT_BHE")
431  {
432  if (_mesh_vec[0]->getDimension() != 3)
433  {
434  OGS_FATAL(
435  "HEAT_TRANSPORT_BHE can only work with a 3-dimentional "
436  "mesh! ");
437  }
438 
439  process =
441  *_mesh_vec[0], std::move(jacobian_assembler),
442  _process_variables, _parameters, integration_order,
443  process_config, _curves);
444  }
445  else
446 #endif
447 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
448  if (type == "HYDRO_MECHANICS")
449  {
451  switch (process_config.getConfigParameter<int>("dimension"))
452  {
453  case 2:
454  process =
456  2>(*_mesh_vec[0], std::move(jacobian_assembler),
458  integration_order, process_config);
459  break;
460  case 3:
461  process =
463  3>(*_mesh_vec[0], std::move(jacobian_assembler),
465  integration_order, process_config);
466  break;
467  default:
468  OGS_FATAL(
469  "HYDRO_MECHANICS process does not support given "
470  "dimension");
471  }
472  }
473  else
474 #endif
475 #ifdef OGS_BUILD_PROCESS_LIE
476  if (type == "HYDRO_MECHANICS_WITH_LIE")
477  {
479  switch (process_config.getConfigParameter<int>("dimension"))
480  {
481  case 2:
482  process = ProcessLib::LIE::HydroMechanics::
483  createHydroMechanicsProcess<2>(
484  *_mesh_vec[0], std::move(jacobian_assembler),
485  _process_variables, _parameters, integration_order,
486  process_config);
487  break;
488  case 3:
489  process = ProcessLib::LIE::HydroMechanics::
490  createHydroMechanicsProcess<3>(
491  *_mesh_vec[0], std::move(jacobian_assembler),
492  _process_variables, _parameters, integration_order,
493  process_config);
494  break;
495  default:
496  OGS_FATAL(
497  "HYDRO_MECHANICS_WITH_LIE process does not support "
498  "given dimension");
499  }
500  }
501  else
502 #endif
503 #ifdef OGS_BUILD_PROCESS_HT
504  if (type == "HT")
505  {
507  *_mesh_vec[0], std::move(jacobian_assembler),
508  _process_variables, _parameters, integration_order,
509  process_config, _mesh_vec, output_directory);
510  }
511  else
512 #endif
513 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
514  if (type == "ComponentTransport")
515  {
516  process =
518  *_mesh_vec[0], std::move(jacobian_assembler),
519  _process_variables, _parameters, integration_order,
520  process_config, _mesh_vec, output_directory, _media);
521  }
522  else
523 #endif
524 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
525  if (type == "PHASE_FIELD")
526  {
527  switch (_mesh_vec[0]->getDimension())
528  {
529  case 2:
530  process =
532  *_mesh_vec[0], std::move(jacobian_assembler),
533  _process_variables, _parameters, integration_order,
534  process_config);
535  break;
536  case 3:
537  process =
539  *_mesh_vec[0], std::move(jacobian_assembler),
540  _process_variables, _parameters, integration_order,
541  process_config);
542  break;
543  }
544  }
545  else
546 #endif
547 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
548  if (type == "RichardsComponentTransport")
549  {
552  *_mesh_vec[0], std::move(jacobian_assembler),
553  _process_variables, _parameters, integration_order,
554  process_config);
555  }
556  else
557 #endif
558 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
559  if (type == "SMALL_DEFORMATION")
560  {
561  switch (_mesh_vec[0]->getDimension())
562  {
563  case 2:
564  process = ProcessLib::SmallDeformation::
565  createSmallDeformationProcess<2>(
566  *_mesh_vec[0], std::move(jacobian_assembler),
567  _process_variables, _parameters, integration_order,
568  process_config);
569  break;
570  case 3:
571  process = ProcessLib::SmallDeformation::
572  createSmallDeformationProcess<3>(
573  *_mesh_vec[0], std::move(jacobian_assembler),
574  _process_variables, _parameters, integration_order,
575  process_config);
576  break;
577  default:
578  OGS_FATAL(
579  "SMALL_DEFORMATION process does not support "
580  "given dimension");
581  }
582  }
583  else
584 #endif
585 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
586  if (type == "SMALL_DEFORMATION_NONLOCAL")
587  {
588  switch (_mesh_vec[0]->getDimension())
589  {
590  case 2:
591  process = ProcessLib::SmallDeformationNonlocal::
592  createSmallDeformationNonlocalProcess<2>(
593  *_mesh_vec[0], std::move(jacobian_assembler),
594  _process_variables, _parameters, integration_order,
595  process_config);
596  break;
597  case 3:
598  process = ProcessLib::SmallDeformationNonlocal::
599  createSmallDeformationNonlocalProcess<3>(
600  *_mesh_vec[0], std::move(jacobian_assembler),
601  _process_variables, _parameters, integration_order,
602  process_config);
603  break;
604  default:
605  OGS_FATAL(
606  "SMALL_DEFORMATION_NONLOCAL process does not support "
607  "given dimension %d",
608  _mesh_vec[0]->getDimension());
609  }
610  }
611  else
612 #endif
613 #ifdef OGS_BUILD_PROCESS_LIE
614  if (type == "SMALL_DEFORMATION_WITH_LIE")
615  {
617  switch (process_config.getConfigParameter<int>("dimension"))
618  {
619  case 2:
620  process = ProcessLib::LIE::SmallDeformation::
621  createSmallDeformationProcess<2>(
622  *_mesh_vec[0], std::move(jacobian_assembler),
623  _process_variables, _parameters, integration_order,
624  process_config);
625  break;
626  case 3:
627  process = ProcessLib::LIE::SmallDeformation::
628  createSmallDeformationProcess<3>(
629  *_mesh_vec[0], std::move(jacobian_assembler),
630  _process_variables, _parameters, integration_order,
631  process_config);
632  break;
633  default:
634  OGS_FATAL(
635  "SMALL_DEFORMATION_WITH_LIE process does not support "
636  "given dimension");
637  }
638  }
639  else
640 #endif
641 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
642  if (type == "THERMO_MECHANICAL_PHASE_FIELD")
643  {
644  switch (_mesh_vec[0]->getDimension())
645  {
646  case 2:
647  process = ProcessLib::ThermoMechanicalPhaseField::
648  createThermoMechanicalPhaseFieldProcess<2>(
649  *_mesh_vec[0], std::move(jacobian_assembler),
650  _process_variables, _parameters, integration_order,
651  process_config);
652  break;
653  case 3:
654  process = ProcessLib::ThermoMechanicalPhaseField::
655  createThermoMechanicalPhaseFieldProcess<3>(
656  *_mesh_vec[0], std::move(jacobian_assembler),
657  _process_variables, _parameters, integration_order,
658  process_config);
659  break;
660  }
661  }
662  else
663 #endif
664 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
665  if (type == "THERMO_MECHANICS")
666  {
667  switch (_mesh_vec[0]->getDimension())
668  {
669  case 2:
670  process = ProcessLib::ThermoMechanics::
671  createThermoMechanicsProcess<2>(
672  *_mesh_vec[0], std::move(jacobian_assembler),
673  _process_variables, _parameters, integration_order,
674  process_config);
675  break;
676  case 3:
677  process = ProcessLib::ThermoMechanics::
678  createThermoMechanicsProcess<3>(
679  *_mesh_vec[0], std::move(jacobian_assembler),
680  _process_variables, _parameters, integration_order,
681  process_config);
682  break;
683  }
684  }
685  else
686 #endif
687 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
688  if (type == "RICHARDS_FLOW")
689  {
691  *_mesh_vec[0], std::move(jacobian_assembler),
692  _process_variables, _parameters, integration_order,
693  process_config, _curves);
694  }
695  else
696 #endif
697 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
698  if (type == "RICHARDS_MECHANICS")
699  {
701  switch (process_config.getConfigParameter<int>("dimension"))
702  {
703  case 2:
704  process = ProcessLib::RichardsMechanics::
705  createRichardsMechanicsProcess<2>(
706  *_mesh_vec[0], std::move(jacobian_assembler),
707  _process_variables, _parameters, integration_order,
708  process_config);
709  break;
710  case 3:
711  process = ProcessLib::RichardsMechanics::
712  createRichardsMechanicsProcess<3>(
713  *_mesh_vec[0], std::move(jacobian_assembler),
714  _process_variables, _parameters, integration_order,
715  process_config);
716  break;
717  }
718  }
719  else
720 #endif
721 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
722  if (type == "TWOPHASE_FLOW_PP")
723  {
724  process =
726  *_mesh_vec[0], std::move(jacobian_assembler),
727  _process_variables, _parameters, integration_order,
728  process_config, _curves);
729  }
730  else
731 #endif
732 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
733  if (type == "TWOPHASE_FLOW_PRHO")
734  {
737  *_mesh_vec[0], std::move(jacobian_assembler),
738  _process_variables, _parameters, integration_order,
739  process_config, _curves);
740  }
741  else
742 #endif
743 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
744  if (type == "THERMAL_TWOPHASE_WITH_PP")
745  {
748  *_mesh_vec[0], std::move(jacobian_assembler),
749  _process_variables, _parameters, integration_order,
750  process_config, _curves);
751  }
752  else
753 #endif
754  {
755  OGS_FATAL("Unknown process type: %s", type.c_str());
756  }
757 
759  name,
760  std::move(process),
761  "The process name is not unique");
762  }
763 }
764 
766  std::string const& output_directory)
767 {
768  DBUG("Reading time loop configuration.");
769 
771  config, output_directory, _processes, _nonlinear_solvers, _mesh_vec);
772 
773  if (!_time_loop)
774  {
775  OGS_FATAL("Initialization of time loop failed.");
776  }
777 }
778 
780 {
781  DBUG("Reading linear solver configuration.");
782 
784  for (auto conf : config.getConfigSubtreeList("linear_solver"))
785  {
787  auto const name = conf.getConfigParameter<std::string>("name");
790  name,
791  std::make_unique<GlobalLinearSolver>("", &conf),
792  "The linear solver name is not unique");
793  }
794 }
795 
797 {
798  DBUG("Reading linear solver configuration.");
799 
801  for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
802  {
803  auto const ls_name =
805  conf.getConfigParameter<std::string>("linear_solver");
806  auto& linear_solver = BaseLib::getOrError(
807  _linear_solvers, ls_name,
808  "A linear solver with the given name does not exist.");
809 
811  auto const name = conf.getConfigParameter<std::string>("name");
814  name,
815  NumLib::createNonlinearSolver(*linear_solver, conf).first,
816  "The nonlinear solver name is not unique");
817  }
818 }
819 
821  boost::optional<BaseLib::ConfigTree> const& config)
822 {
823  if (!config)
824  return;
825 
826  DBUG("Reading curves configuration.");
827 
829  for (auto conf : config->getConfigSubtreeList("curve"))
830  {
832  auto const name = conf.getConfigParameter<std::string>("name");
834  _curves,
835  name,
838  "The curve name is not unique.");
839  }
840 }
void parseProcesses(BaseLib::ConfigTree const &process_config, std::string const &project_directory, std::string const &output_directory)
Container class for geometric objects.
Definition: GEOObjects.h:62
Definition of the BoostXmlGmlInterface class.
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(boost::optional< BaseLib::ConfigTree > const &config)
void parseLinearSolvers(BaseLib::ConfigTree const &config)
void parseCurves(boost::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:115
std::map< std::string, std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:116
std::string copyPathToFileName(const std::string &file_name, const std::string &source)
Definition: FileTools.cpp:143
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:130
std::unique_ptr< Process > createHTProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::string const &output_directory)
template std::unique_ptr< Process > createPhaseFieldProcess< 2 >(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< Process > createTwoPhaseFlowWithPrhoProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
Definition of the Mesh class.
Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition: Algorithm.h:147
void parseMedia(boost::optional< BaseLib::ConfigTree > const &media_config)
Parses media configuration and saves them in an object.
template std::unique_ptr< Process > createPhaseFieldProcess< 3 >(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< ParameterBase > createParameter(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
Definition: Parameter.cpp:23
T getConfigParameter(std::string const &param) const
MeshLib::Mesh * readMeshFromFile(const std::string &file_name)
static const std::string zero_parameter_name
std::vector< std::unique_ptr< ProcessLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
Definition: ProjectData.h:120
std::map< int, std::unique_ptr< MaterialPropertyLib::Medium > > _media
Definition: ProjectData.h:122
std::unique_ptr< Process > createTESProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:127
std::unique_ptr< Medium > createMedium(BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > constructAdditionalMeshesFromGeoObjects(GeoLib::GEOObjects const &geo_objects, MeshLib::Mesh const &mesh, std::unique_ptr< SearchLength > search_length_algorithm)
std::unique_ptr< Process > createGroundwaterFlowProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::string const &output_directory)
Definition of readMeshFromFile function.
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::unique_ptr< TimeLoop > _time_loop
The time loop used to solve this project&#39;s processes.
Definition: ProjectData.h:125
std::unique_ptr< Process > createTwoPhaseFlowWithPPProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
void parseTimeLoop(BaseLib::ConfigTree const &config, const std::string &output_directory)
Parses the time loop configuration.
static const double p
std::unique_ptr< UncoupledProcessesTimeLoop > createUncoupledProcessesTimeLoop(BaseLib::ConfigTree const &config, std::string const &output_directory, const std::map< std::string, std::unique_ptr< Process >> &processes, const std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase >> &nonlinear_solvers, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes)
Builds an UncoupledProcessesTimeLoop from the given configuration.
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition: Algorithm.h:104
std::unique_ptr< Process > createHeatTransportBHEProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
std::unique_ptr< Process > createHeatConductionProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
ConfigTree getConfigSubtree(std::string const &root) const
Definition: ConfigTree.cpp:146
std::vector< std::unique_ptr< MeshLib::Mesh > > readMeshes(std::vector< std::string > const &filenames)
std::unique_ptr< Process > createLiquidFlowProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< Process > createThermalTwoPhaseFlowWithPPProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
Range< SubtreeIterator > getConfigSubtreeList(std::string const &root) const
Definition: ConfigTree.cpp:170
Single, constant value parameter.
std::unique_ptr< GeoLib::GEOObjects > readGeometry(std::string const &filename)
std::unique_ptr< MeshGeoToolsLib::SearchLength > createSearchLengthAlgorithm(BaseLib::ConfigTree const &external_config, MeshLib::Mesh const &mesh)
std::unique_ptr< Process > createComponentTransportProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::string const &output_directory, std::map< int, std::unique_ptr< MaterialPropertyLib::Medium >> const &media)
unsigned getDimension(MeshLib::MeshElemType eleType)
boost::optional< T > getConfigAttributeOptional(std::string const &attr) const
std::unique_ptr< Process > createRichardsFlowProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
boost::optional< T > getConfigParameterOptional(std::string const &param) const
#define OGS_FATAL(fmt,...)
Definition: Error.h:71
void parseParameters(BaseLib::ConfigTree const &parameters_config)
boost::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
Definition: ConfigTree.cpp:156
Filename manipulation routines.
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:117
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
Definition: Algorithm.h:67
std::unique_ptr< Process > createRichardsComponentTransportProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
static std::string project_directory
The directory where the prj file resides.
Definition: FileTools.cpp:25
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:133
std::unique_ptr< Process > createHydroMechanicsProcess(MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< MeshLib::Mesh > readSingleMesh(BaseLib::ConfigTree const &mesh_config_parameter, std::string const &project_directory)