OGS  master
ProjectData.cpp
Go to the documentation of this file.
1 
14 #include "ProjectData.h"
15 
16 #include <algorithm>
17 #include <boost/algorithm/string/predicate.hpp>
18 #include <cctype>
19 #include <set>
20 
21 #ifdef OGS_USE_PYTHON
22 #include <pybind11/eval.h>
23 #endif
24 
25 #include "BaseLib/Algorithm.h"
26 #include "BaseLib/ConfigTree.h"
27 #include "BaseLib/FileTools.h"
28 #include "BaseLib/Logging.h"
29 #include "BaseLib/StringTools.h"
30 #include "GeoLib/GEOObjects.h"
31 #include "InfoLib/CMakeInfo.h"
37 #include "MeshLib/Mesh.h"
42 
43 // FileIO
47 #include "ParameterLib/Utils.h"
49 #include "ProcessLib/TimeLoop.h"
50 
51 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
54 #endif
55 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
57 #endif
58 #ifdef OGS_BUILD_PROCESS_HT
60 #endif
61 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
63 #endif
64 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
66 #endif
67 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
69 #endif
70 #ifdef OGS_BUILD_PROCESS_LIE
73 #endif
74 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
76 #endif
77 #ifdef OGS_BUILD_PROCESS_STOKESFLOW
79 #endif
80 
81 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
83 #endif
84 
85 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
87 #endif
88 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
90 #endif
91 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
93 #endif
94 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
96 #endif
97 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
99 #endif
100 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
102 #endif
103 #ifdef OGS_BUILD_PROCESS_TES
105 #endif
106 #ifdef OGS_BUILD_PROCESS_TH2M
108 #endif
109 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
111 #endif
112 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
114 #endif
115 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
117 #endif
118 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
120 #endif
121 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
123 #endif
124 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
126 #endif
127 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
129 #endif
130 
131 namespace
132 {
133 void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects)
134 {
135  DBUG("Reading geometry file '{:s}'.", fname);
136  GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
137  gml_reader.readFile(fname);
138 }
139 
140 std::unique_ptr<MeshLib::Mesh> readSingleMesh(
141  BaseLib::ConfigTree const& mesh_config_parameter,
142  std::string const& project_directory)
143 {
144  std::string const mesh_file = BaseLib::copyPathToFileName(
145  mesh_config_parameter.getValue<std::string>(), project_directory);
146  DBUG("Reading mesh file '{:s}'.", mesh_file);
147 
148  auto mesh = std::unique_ptr<MeshLib::Mesh>(
149  MeshLib::IO::readMeshFromFile(mesh_file));
150  if (!mesh)
151  {
152  OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
153  mesh_file);
154  }
155 
156 #ifdef DOXYGEN_DOCU_ONLY
158  mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
159 #endif // DOXYGEN_DOCU_ONLY
160 
161  if (auto const axially_symmetric =
163  mesh_config_parameter.getConfigAttributeOptional<bool>(
164  "axially_symmetric"))
165  {
166  mesh->setAxiallySymmetric(*axially_symmetric);
167  }
168 
169  return mesh;
170 }
171 
172 std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
173  BaseLib::ConfigTree const& config, std::string const& project_directory)
174 {
175  std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
176 
178  auto optional_meshes = config.getConfigSubtreeOptional("meshes");
179  if (optional_meshes)
180  {
181  DBUG("Reading multiple meshes.");
183  auto const configs = optional_meshes->getConfigParameterList("mesh");
184  std::transform(
185  configs.begin(), configs.end(), std::back_inserter(meshes),
186  [&project_directory](auto const& mesh_config) {
187  return readSingleMesh(mesh_config, project_directory);
188  });
189  }
190  else
191  { // Read single mesh with geometry.
192  WARN(
193  "Consider switching from mesh and geometry input to multiple "
194  "meshes input. See "
195  "https://www.opengeosys.org/docs/tools/meshing-submeshes/"
196  "constructmeshesfromgeometry/ tool for conversion.");
198  meshes.push_back(readSingleMesh(config.getConfigParameter("mesh"),
200 
201  std::string const geometry_file = BaseLib::copyPathToFileName(
203  config.getConfigParameter<std::string>("geometry"),
205  GeoLib::GEOObjects geoObjects;
206  readGeometry(geometry_file, geoObjects);
207 
208  std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
210  bool const multiple_nodes_allowed = false;
211  auto additional_meshes =
213  geoObjects, *meshes[0], std::move(search_length_algorithm),
214  multiple_nodes_allowed);
215 
216  std::move(begin(additional_meshes), end(additional_meshes),
217  std::back_inserter(meshes));
218  }
219 
221 
222  return meshes;
223 }
224 
225 std::optional<ParameterLib::CoordinateSystem> parseLocalCoordinateSystem(
226  std::optional<BaseLib::ConfigTree> const& config,
227  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
228 {
229  if (!config)
230  {
231  return {};
232  }
233 
234  DBUG("Reading coordinate system configuration.");
235 
236  //
237  // Fetch the first basis vector; its length defines the dimension.
238  //
239  auto const& basis_vector_0 = ParameterLib::findParameter<double>(
240  *config,
242  "basis_vector_0", parameters, 0 /* any dimension */);
243  int const dimension = basis_vector_0.getNumberOfGlobalComponents();
244 
245  // check dimension
246  if (dimension != 2 && dimension != 3)
247  {
248  OGS_FATAL(
249  "Basis vector parameter '{:s}' must have two or three components, "
250  "but it has {:d}.",
251  basis_vector_0.name, dimension);
252  }
253 
254  //
255  // Fetch the second basis vector, which must be of the same dimension as the
256  // first one.
257  //
258  auto const& basis_vector_1 = ParameterLib::findParameter<double>(
259  *config,
261  "basis_vector_1", parameters, dimension);
262 
263  //
264  // For two dimensions, we are done; construct coordinate system;
265  //
266  if (dimension == 2)
267  {
268  return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1};
269  }
270 
271  //
272  // Parse the third vector, for three dimensions.
273  //
274  auto const& basis_vector_2 = ParameterLib::findParameter<double>(
275  *config,
277  "basis_vector_2", parameters, dimension);
278  return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1,
279  basis_vector_2};
280 }
281 } // namespace
282 
283 ProjectData::ProjectData() = default;
284 
286  std::string const& project_directory,
287  std::string const& output_directory)
288  : _mesh_vec(readMeshes(project_config, project_directory))
289 {
290  if (auto const python_script =
292  project_config.getConfigParameterOptional<std::string>("python_script"))
293  {
294 #ifdef OGS_USE_PYTHON
295  namespace py = pybind11;
296 
297  // Append to python's module search path
298  auto py_path = py::module::import("sys").attr("path");
299  py_path.attr("append")(project_directory); // .prj directory
300  // virtualenv
301  py_path.attr("append")(
302  CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
303 
304  auto const script_path =
306 
307  // Evaluate in scope of main module
308  py::object scope = py::module::import("__main__").attr("__dict__");
309  // add (global) variables
310  auto globals = py::dict(scope);
311  globals["ogs_prj_directory"] = project_directory;
312  py::eval_file(script_path, scope);
313 #else
314  OGS_FATAL("OpenGeoSys has not been built with Python support.");
315 #endif // OGS_USE_PYTHON
316  }
317 
319  parseCurves(project_config.getConfigSubtreeOptional("curves"));
320 
321  auto parameter_names_for_transformation =
323  parseParameters(project_config.getConfigSubtree("parameters"));
324 
327  project_config.getConfigSubtreeOptional("local_coordinate_system"),
328  _parameters);
329 
330  for (auto& parameter : _parameters)
331  {
332  if (std::find(begin(parameter_names_for_transformation),
333  end(parameter_names_for_transformation),
334  parameter->name) !=
335  end(parameter_names_for_transformation))
336  {
338  {
339  OGS_FATAL(
340  "The parameter '{:s}' is using the local coordinate system "
341  "but no local coordinate system was provided.",
342  parameter->name);
343  }
344  parameter->setCoordinateSystem(*_local_coordinate_system);
345  }
346 
347  parameter->initialize(_parameters);
348  }
349 
351  parseProcessVariables(project_config.getConfigSubtree("process_variables"));
352 
354  parseMedia(project_config.getConfigSubtreeOptional("media"));
355 
356  auto chemical_solver_interface = parseChemicalSolverInterface(
358  project_config.getConfigSubtreeOptional("chemical_system"),
359  output_directory);
360 
362  parseProcesses(project_config.getConfigSubtree("processes"),
363  project_directory, output_directory,
364  std::move(chemical_solver_interface));
365 
367  parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
368 
370  parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
371 
373  parseTimeLoop(project_config.getConfigSubtree("time_loop"),
374  output_directory);
375 }
376 
378  BaseLib::ConfigTree const& process_variables_config)
379 {
380  DBUG("Parse process variables:");
381 
382  std::set<std::string> names;
383 
384  for (auto var_config
386  : process_variables_config.getConfigSubtreeList("process_variable"))
387  {
388  // Either the mesh name is given, or the first mesh's name will be
389  // taken. Taking the first mesh's value is deprecated.
390  auto const mesh_name =
392  var_config.getConfigParameter<std::string>("mesh",
393  _mesh_vec[0]->getName());
394 
395  auto& mesh = *BaseLib::findElementOrError(
396  begin(_mesh_vec), end(_mesh_vec),
397  [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
398  "Expected to find a mesh named " + mesh_name + ".");
399 
400  auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
402  if (!names.insert(pv.getName()).second)
403  {
404  OGS_FATAL("A process variable with name `{:s}' already exists.",
405  pv.getName());
406  }
407 
408  _process_variables.push_back(std::move(pv));
409  }
410 }
411 
412 std::vector<std::string> ProjectData::parseParameters(
413  BaseLib::ConfigTree const& parameters_config)
414 {
415  using namespace ProcessLib;
416 
417  std::set<std::string> names;
418  std::vector<std::string> parameter_names_for_transformation;
419 
420  DBUG("Reading parameters:");
421  for (auto parameter_config :
423  parameters_config.getConfigSubtreeList("parameter"))
424  {
425  auto p =
426  ParameterLib::createParameter(parameter_config, _mesh_vec, _curves);
427  if (!names.insert(p->name).second)
428  {
429  OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
430  }
431 
432  auto const use_local_coordinate_system =
434  parameter_config.getConfigParameterOptional<bool>(
435  "use_local_coordinate_system");
436  if (!!use_local_coordinate_system && *use_local_coordinate_system)
437  {
438  parameter_names_for_transformation.push_back(p->name);
439  }
440 
441  _parameters.push_back(std::move(p));
442  }
443 
444  _parameters.push_back(
445  std::make_unique<ParameterLib::ConstantParameter<double>>(
447 
448  return parameter_names_for_transformation;
449 }
450 
452  std::optional<BaseLib::ConfigTree> const& media_config)
453 {
454  if (!media_config)
455  {
456  return;
457  }
458 
459  DBUG("Reading media:");
460 
461  if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
462  {
463  ERR("A mesh is required to define medium materials.");
464  return;
465  }
466 
467  for (auto const& medium_config :
469  media_config->getConfigSubtreeList("medium"))
470  {
471  auto material_id_string =
473  medium_config.getConfigAttribute<std::string>("id", "0");
474  material_id_string.erase(
475  remove_if(begin(material_id_string), end(material_id_string),
476  [](unsigned char const c) { return std::isspace(c); }),
477  end(material_id_string));
478  auto const material_ids_strings =
479  BaseLib::splitString(material_id_string, ',');
480 
481  // Convert strings to ints;
482  std::vector<int> material_ids;
483  std::transform(
484  begin(material_ids_strings), end(material_ids_strings),
485  std::back_inserter(material_ids), [](std::string const& m_id) {
486  if (auto const it = std::find_if_not(
487  begin(m_id), end(m_id),
488  [](unsigned char const c) { return std::isdigit(c); });
489  it != end(m_id))
490  {
491  OGS_FATAL(
492  "Could not parse material ID's from '{:s}'. Please "
493  "separate multiple material ID's by comma only. "
494  "Invalid character: '%c'",
495  m_id, *it);
496  }
497  return std::stoi(m_id);
498  });
499 
500  for (auto const& id : material_ids)
501  {
502  if (_media.find(id) != end(_media))
503  {
504  OGS_FATAL(
505  "Multiple media were specified for the same material id "
506  "'{:d}'. Keep in mind, that if no material id is "
507  "specified, it is assumed to be 0 by default.",
508  id);
509  }
510 
511  _media[id] =
512  (id == material_ids[0])
514  _mesh_vec[0]->getDimension(), medium_config,
515  _parameters,
517  : nullptr,
518  _curves)
519  : _media[material_ids[0]];
520  }
521  }
522 
523  if (_media.empty())
524  {
525  OGS_FATAL("No entity is found inside <media>.");
526  }
527 }
528 
529 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
531  std::optional<BaseLib::ConfigTree> const& config,
532  std::string const& output_directory)
533 {
534  if (!config)
535  {
536  return nullptr;
537  }
538 
539  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
540  chemical_solver_interface;
541 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
542  INFO(
543  "Ready for initializing interface to a chemical solver for water "
544  "chemistry calculation.");
545 
546  auto const chemical_solver =
548  config->getConfigAttribute<std::string>("chemical_solver");
549 
550  if (boost::iequals(chemical_solver, "Phreeqc"))
551  {
552  INFO(
553  "Configuring phreeqc interface for water chemistry calculation "
554  "using file-based approach.");
555 
556  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
558  output_directory);
559  }
560  else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
561  {
562  OGS_FATAL(
563  "The chemical solver option of PhreeqcKernel is not accessible for "
564  "the time being. Please set 'Phreeqc'' as the chemical solver for "
565  "reactive transport modeling.");
566  }
567  else
568  {
569  OGS_FATAL(
570  "Unknown chemical solver. Please specify either Phreeqc or "
571  "PhreeqcKernel as the solver for water chemistry calculation "
572  "instead.");
573  }
574 #else
575  (void)output_directory;
576 
577  OGS_FATAL(
578  "Found the type of the process to be solved is not component transport "
579  "process. Please specify the process type to ComponentTransport. At "
580  "the present, water chemistry calculation is only available for "
581  "component transport process.");
582 #endif
583  return chemical_solver_interface;
584 }
585 
587  BaseLib::ConfigTree const& processes_config,
588  std::string const& project_directory,
589  std::string const& output_directory,
590  [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
591  chemical_solver_interface)
592 {
593  (void)project_directory; // to avoid compilation warning
594  (void)output_directory; // to avoid compilation warning
595 
596  DBUG("Reading processes:");
598  for (auto process_config : processes_config.getConfigSubtreeList("process"))
599  {
600  auto const type =
602  process_config.peekConfigParameter<std::string>("type");
603 
604  auto const name =
606  process_config.getConfigParameter<std::string>("name");
607 
608  auto const integration_order =
610  process_config.getConfigParameter<int>("integration_order");
611 
612  std::unique_ptr<ProcessLib::Process> process;
613 
614  auto jacobian_assembler = ProcessLib::createJacobianAssembler(
616  process_config.getConfigSubtreeOptional("jacobian_assembler"));
617 
618 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
619  if (type == "STEADY_STATE_DIFFUSION")
620  {
621  // The existence check of the in the configuration referenced
622  // process variables is checked in the physical process.
623  // TODO at the moment we have only one mesh, later there can be
624  // several meshes. Then we have to assign the referenced mesh
625  // here.
626  process =
628  name, *_mesh_vec[0], std::move(jacobian_assembler),
629  _process_variables, _parameters, integration_order,
630  process_config, _mesh_vec, _media);
631  }
632  else
633 #endif
634 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
635  if (type == "LIQUID_FLOW")
636  {
638  name, *_mesh_vec[0], std::move(jacobian_assembler),
639  _process_variables, _parameters, integration_order,
640  process_config, _mesh_vec, _media);
641  }
642  else
643 #endif
644 #ifdef OGS_BUILD_PROCESS_STOKESFLOW
645  if (type == "StokesFlow")
646  {
647  switch (_mesh_vec[0]->getDimension())
648  {
649  case 2:
650  process =
652  name, *_mesh_vec[0], std::move(jacobian_assembler),
653  _process_variables, _parameters, integration_order,
654  process_config, _media);
655  break;
656  default:
657  OGS_FATAL(
658  "StokesFlow process does not support given "
659  "dimension {:d}",
660  _mesh_vec[0]->getDimension());
661  }
662  }
663  else
664 #endif
665 #ifdef OGS_BUILD_PROCESS_TES
666  if (type == "TES")
667  {
669  name, *_mesh_vec[0], std::move(jacobian_assembler),
670  _process_variables, _parameters, integration_order,
671  process_config);
672  }
673  else
674 #endif
675 #ifdef OGS_BUILD_PROCESS_TH2M
676  if (type == "TH2M")
677  {
678  switch (_mesh_vec[0]->getDimension())
679  {
680  case 2:
682  name, *_mesh_vec[0], std::move(jacobian_assembler),
684  _local_coordinate_system, integration_order,
685  process_config, _media);
686  break;
687  case 3:
689  name, *_mesh_vec[0], std::move(jacobian_assembler),
691  _local_coordinate_system, integration_order,
692  process_config, _media);
693  break;
694  default:
695  OGS_FATAL("TH2M process does not support given dimension");
696  }
697  }
698  else
699 #endif
700 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
701  if (type == "HEAT_CONDUCTION")
702  {
704  name, *_mesh_vec[0], std::move(jacobian_assembler),
705  _process_variables, _parameters, integration_order,
706  process_config, _media);
707  }
708  else
709 #endif
710 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
711  if (type == "HEAT_TRANSPORT_BHE")
712  {
713  if (_mesh_vec[0]->getDimension() != 3)
714  {
715  OGS_FATAL(
716  "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
717  "mesh! ");
718  }
719 
720  process =
722  name, *_mesh_vec[0], std::move(jacobian_assembler),
723  _process_variables, _parameters, integration_order,
724  process_config, _curves, _media);
725  }
726  else
727 #endif
728 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
729  if (type == "HYDRO_MECHANICS")
730  {
732  switch (process_config.getConfigParameter<int>("dimension"))
733  {
734  case 2:
735  process =
737  2>(name, *_mesh_vec[0],
738  std::move(jacobian_assembler),
740  _local_coordinate_system, integration_order,
741  process_config, _media);
742  break;
743  case 3:
744  process =
746  3>(name, *_mesh_vec[0],
747  std::move(jacobian_assembler),
749  _local_coordinate_system, integration_order,
750  process_config, _media);
751  break;
752  default:
753  OGS_FATAL(
754  "HYDRO_MECHANICS process does not support given "
755  "dimension");
756  }
757  }
758  else
759 #endif
760 #ifdef OGS_BUILD_PROCESS_LIE
761  if (type == "HYDRO_MECHANICS_WITH_LIE")
762  {
764  switch (process_config.getConfigParameter<int>("dimension"))
765  {
766  case 2:
769  name, *_mesh_vec[0], std::move(jacobian_assembler),
771  _local_coordinate_system, integration_order,
772  process_config);
773  break;
774  case 3:
777  name, *_mesh_vec[0], std::move(jacobian_assembler),
779  _local_coordinate_system, integration_order,
780  process_config);
781  break;
782  default:
783  OGS_FATAL(
784  "HYDRO_MECHANICS_WITH_LIE process does not support "
785  "given dimension");
786  }
787  }
788  else
789 #endif
790 #ifdef OGS_BUILD_PROCESS_HT
791  if (type == "HT")
792  {
794  name, *_mesh_vec[0], std::move(jacobian_assembler),
795  _process_variables, _parameters, integration_order,
796  process_config, _mesh_vec, _media);
797  }
798  else
799 #endif
800 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
801  if (type == "ComponentTransport")
802  {
803  process =
805  name, *_mesh_vec[0], std::move(jacobian_assembler),
806  _process_variables, _parameters, integration_order,
807  process_config, _mesh_vec, _media,
808  std::move(chemical_solver_interface));
809  }
810  else
811 #endif
812 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
813  if (type == "PHASE_FIELD")
814  {
815  switch (_mesh_vec[0]->getDimension())
816  {
817  case 2:
818  process =
820  name, *_mesh_vec[0], std::move(jacobian_assembler),
822  _local_coordinate_system, integration_order,
823  process_config);
824  break;
825  case 3:
826  process =
828  name, *_mesh_vec[0], std::move(jacobian_assembler),
830  _local_coordinate_system, integration_order,
831  process_config);
832  break;
833  }
834  }
835  else
836 #endif
837 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
838  if (type == "RichardsComponentTransport")
839  {
842  name, *_mesh_vec[0], std::move(jacobian_assembler),
843  _process_variables, _parameters, integration_order,
844  process_config, _media);
845  }
846  else
847 #endif
848 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
849  if (type == "SMALL_DEFORMATION")
850  {
851  switch (_mesh_vec[0]->getDimension())
852  {
853  case 2:
856  name, *_mesh_vec[0], std::move(jacobian_assembler),
858  _local_coordinate_system, integration_order,
859  process_config);
860  break;
861  case 3:
864  name, *_mesh_vec[0], std::move(jacobian_assembler),
866  _local_coordinate_system, integration_order,
867  process_config);
868  break;
869  default:
870  OGS_FATAL(
871  "SMALL_DEFORMATION process does not support given "
872  "dimension");
873  }
874  }
875  else
876 #endif
877 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
878  if (type == "SMALL_DEFORMATION_NONLOCAL")
879  {
880  switch (_mesh_vec[0]->getDimension())
881  {
882  case 2:
885  name, *_mesh_vec[0], std::move(jacobian_assembler),
887  _local_coordinate_system, integration_order,
888  process_config);
889  break;
890  case 3:
893  name, *_mesh_vec[0], std::move(jacobian_assembler),
895  _local_coordinate_system, integration_order,
896  process_config);
897  break;
898  default:
899  OGS_FATAL(
900  "SMALL_DEFORMATION_NONLOCAL process does not support "
901  "given dimension {:d}",
902  _mesh_vec[0]->getDimension());
903  }
904  }
905  else
906 #endif
907 #ifdef OGS_BUILD_PROCESS_LIE
908  if (type == "SMALL_DEFORMATION_WITH_LIE")
909  {
911  switch (process_config.getConfigParameter<int>("dimension"))
912  {
913  case 2:
916  name, *_mesh_vec[0], std::move(jacobian_assembler),
918  _local_coordinate_system, integration_order,
919  process_config);
920  break;
921  case 3:
924  name, *_mesh_vec[0], std::move(jacobian_assembler),
926  _local_coordinate_system, integration_order,
927  process_config);
928  break;
929  default:
930  OGS_FATAL(
931  "SMALL_DEFORMATION_WITH_LIE process does not support "
932  "given dimension");
933  }
934  }
935  else
936 #endif
937 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
938  if (type == "THERMO_HYDRO_MECHANICS")
939  {
941  switch (process_config.getConfigParameter<int>("dimension"))
942  {
943  case 2:
946  name, *_mesh_vec[0], std::move(jacobian_assembler),
948  _local_coordinate_system, integration_order,
949  process_config, _media);
950  break;
951  case 3:
954  name, *_mesh_vec[0], std::move(jacobian_assembler),
956  _local_coordinate_system, integration_order,
957  process_config, _media);
958  break;
959  default:
960  OGS_FATAL(
961  "THERMO_HYDRO_MECHANICS process does not support given "
962  "dimension");
963  }
964  }
965  else
966 #endif
967 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
968  if (type == "THERMO_MECHANICAL_PHASE_FIELD")
969  {
970  switch (_mesh_vec[0]->getDimension())
971  {
972  case 2:
975  name, *_mesh_vec[0], std::move(jacobian_assembler),
977  _local_coordinate_system, integration_order,
978  process_config);
979  break;
980  case 3:
983  name, *_mesh_vec[0], std::move(jacobian_assembler),
985  _local_coordinate_system, integration_order,
986  process_config);
987  break;
988  }
989  }
990  else
991 #endif
992 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
993  if (type == "THERMO_MECHANICS")
994  {
995  switch (_mesh_vec[0]->getDimension())
996  {
997  case 2:
1000  name, *_mesh_vec[0], std::move(jacobian_assembler),
1002  _local_coordinate_system, integration_order,
1003  process_config, _media);
1004  break;
1005  case 3:
1008  name, *_mesh_vec[0], std::move(jacobian_assembler),
1010  _local_coordinate_system, integration_order,
1011  process_config, _media);
1012  break;
1013  }
1014  }
1015  else
1016 #endif
1017 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1018  if (type == "RICHARDS_FLOW")
1019  {
1021  name, *_mesh_vec[0], std::move(jacobian_assembler),
1022  _process_variables, _parameters, integration_order,
1023  process_config, _curves, _media);
1024  }
1025  else
1026 #endif
1027 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1028  if (type == "RICHARDS_MECHANICS")
1029  {
1031  switch (process_config.getConfigParameter<int>("dimension"))
1032  {
1033  case 2:
1036  name, *_mesh_vec[0], std::move(jacobian_assembler),
1038  _local_coordinate_system, integration_order,
1039  process_config, _media);
1040  break;
1041  case 3:
1044  name, *_mesh_vec[0], std::move(jacobian_assembler),
1046  _local_coordinate_system, integration_order,
1047  process_config, _media);
1048  break;
1049  }
1050  }
1051  else
1052 #endif
1053 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1054  if (type == "THERMO_RICHARDS_FLOW")
1055  {
1056  process =
1058  name, *_mesh_vec[0], std::move(jacobian_assembler),
1059  _process_variables, _parameters, integration_order,
1060  process_config, _media);
1061  }
1062  else
1063 #endif
1064 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1065  if (type == "THERMO_RICHARDS_MECHANICS")
1066  {
1067  switch (_mesh_vec[0]->getDimension())
1068  {
1069  case 2:
1072  name, *_mesh_vec[0], std::move(jacobian_assembler),
1074  _local_coordinate_system, integration_order,
1075  process_config, _media);
1076  break;
1077  case 3:
1080  name, *_mesh_vec[0], std::move(jacobian_assembler),
1082  _local_coordinate_system, integration_order,
1083  process_config, _media);
1084  break;
1085  }
1086  }
1087  else
1088 #endif
1089 
1090 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1091  if (type == "TWOPHASE_FLOW_PP")
1092  {
1093  process =
1095  name, *_mesh_vec[0], std::move(jacobian_assembler),
1096  _process_variables, _parameters, integration_order,
1097  process_config, _curves, _media);
1098  }
1099  else
1100 #endif
1101 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1102  if (type == "TWOPHASE_FLOW_PRHO")
1103  {
1106  name, *_mesh_vec[0], std::move(jacobian_assembler),
1107  _process_variables, _parameters, integration_order,
1108  process_config, _curves);
1109  }
1110  else
1111 #endif
1112 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1113  if (type == "THERMAL_TWOPHASE_WITH_PP")
1114  {
1117  name, *_mesh_vec[0], std::move(jacobian_assembler),
1118  _process_variables, _parameters, integration_order,
1119  process_config, _curves);
1120  }
1121  else
1122 #endif
1123  {
1124  OGS_FATAL("Unknown process type: {:s}", type);
1125  }
1126 
1127  if (BaseLib::containsIf(
1128  _processes,
1129  [&name](std::unique_ptr<ProcessLib::Process> const& p) {
1130  return p->name == name;
1131  }))
1132  {
1133  OGS_FATAL("The process name '{:s}' is not unique.", name);
1134  }
1135  _processes.push_back(std::move(process));
1136  }
1137 }
1138 
1140  std::string const& output_directory)
1141 {
1142  DBUG("Reading time loop configuration.");
1143 
1145  config, output_directory, _processes, _nonlinear_solvers, _mesh_vec);
1146 
1147  if (!_time_loop)
1148  {
1149  OGS_FATAL("Initialization of time loop failed.");
1150  }
1151 }
1152 
1154 {
1155  DBUG("Reading linear solver configuration.");
1156 
1158  for (auto conf : config.getConfigSubtreeList("linear_solver"))
1159  {
1161  auto const name = conf.getConfigParameter<std::string>("name");
1164  name,
1165  std::make_unique<GlobalLinearSolver>("", &conf),
1166  "The linear solver name is not unique");
1167  }
1168 }
1169 
1171 {
1172  DBUG("Reading non-linear solver configuration.");
1173 
1175  for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1176  {
1177  auto const ls_name =
1179  conf.getConfigParameter<std::string>("linear_solver");
1180  auto& linear_solver = BaseLib::getOrError(
1181  _linear_solvers, ls_name,
1182  "A linear solver with the given name does not exist.");
1183 
1185  auto const name = conf.getConfigParameter<std::string>("name");
1188  name,
1189  NumLib::createNonlinearSolver(*linear_solver, conf).first,
1190  "The nonlinear solver name is not unique");
1191  }
1192 }
1193 
1194 void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1195 {
1196  if (!config)
1197  {
1198  return;
1199  }
1200 
1201  DBUG("Reading curves configuration.");
1202 
1204  for (auto conf : config->getConfigSubtreeList("curve"))
1205  {
1207  auto const name = conf.getConfigParameter<std::string>("name");
1209  _curves,
1210  name,
1213  "The curve name is not unique.");
1214  }
1215 }
Definition of the BoostXmlGmlInterface class.
Functionality to build different search length algorithm objects from given config.
#define OGS_FATAL(...)
Definition: Error.h:25
Filename manipulation routines.
Definition of the GEOObjects class.
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
void ERR(char const *fmt, Args const &... args)
Definition: Logging.h:42
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
void WARN(char const *fmt, Args const &... args)
Definition: Logging.h:37
Definition of the Mesh class.
Base class for different search length strategies.
Definition of string helper functions.
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
Definition: ConfigTree.cpp:155
std::optional< T > getConfigParameterOptional(std::string const &param) const
T getConfigParameter(std::string const &param) const
Range< SubtreeIterator > getConfigSubtreeList(std::string const &root) const
Definition: ConfigTree.cpp:169
ConfigTree getConfigSubtree(std::string const &root) const
Definition: ConfigTree.cpp:146
std::optional< T > getConfigAttributeOptional(std::string const &attr) const
Container class for geometric objects.
Definition: GEOObjects.h:61
bool readFile(const std::string &fname) override
Reads an xml-file containing OGS geometry.
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
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
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
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::unique_ptr< GeoLib::GEOObjects > readGeometry(std::string const &filename)
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > readMeshes(std::vector< std::string > const &filenames)
Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition: Algorithm.h:149
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition: Algorithm.h:107
bool containsIf(Container const &container, Predicate &&predicate)
Definition: Algorithm.h:266
std::string copyPathToFileName(const std::string &file_name, const std::string &source)
Definition: FileTools.cpp:191
std::vector< std::string > splitString(std::string const &str)
Definition: StringTools.cpp:28
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
Definition: Algorithm.h:70
std::unique_ptr< ChemicalSolverInterface > createChemicalSolverInterface(std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, BaseLib::ConfigTree const &config, std::string const &output_directory)
std::unique_ptr< Medium > createMedium(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
static const double p
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)
std::unique_ptr< MeshGeoToolsLib::SearchLength > createSearchLengthAlgorithm(BaseLib::ConfigTree const &external_config, MeshLib::Mesh const &mesh)
std::vector< std::unique_ptr< MeshLib::Mesh > > constructAdditionalMeshesFromGeoObjects(GeoLib::GEOObjects const &geo_objects, MeshLib::Mesh const &mesh, std::unique_ptr< SearchLength > search_length_algorithm, bool const multiple_nodes_allowed)
MeshLib::Mesh * readMeshFromFile(const std::string &file_name)
void setMeshSpaceDimension(std::vector< std::unique_ptr< Mesh >> const &meshes)
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:26
std::unique_ptr< Process > createComponentTransportProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< Process > createHTProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createHeatConductionProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createHeatTransportBHEProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createHydroMechanicsProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createHydroMechanicsProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createHydroMechanicsProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< Process > createLiquidFlowProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createPhaseFieldProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createPhaseFieldProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< Process > createRichardsComponentTransportProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createRichardsFlowProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createRichardsMechanicsProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createRichardsMechanicsProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createSmallDeformationNonlocalProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationNonlocalProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< Process > createSteadyStateDiffusion(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createStokesFlowProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createTESProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createTH2MProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createTH2MProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createThermalTwoPhaseFlowWithPPProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
template std::unique_ptr< Process > createThermoHydroMechanicsProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createThermoHydroMechanicsProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createThermoMechanicalPhaseFieldProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createThermoMechanicalPhaseFieldProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createThermoMechanicsProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createThermoMechanicsProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createThermoRichardsFlowProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createTwoPhaseFlowWithPPProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createTwoPhaseFlowWithPrhoProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::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< TimeLoop > createTimeLoop(BaseLib::ConfigTree const &config, std::string const &output_directory, const std::vector< 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 a TimeLoop from the given configuration.
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(std::optional< BaseLib::ConfigTree > const &config)
std::string project_directory
The directory where the prj file resides.
Definition: FileTools.cpp:27
std::unique_ptr< MeshLib::Mesh > readSingleMesh(BaseLib::ConfigTree const &mesh_config_parameter, std::string const &project_directory)
std::optional< ParameterLib::CoordinateSystem > parseLocalCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)
unsigned getDimension(MeshLib::MeshElemType eleType)
Definition of readMeshFromFile function.
Single, constant value parameter.
static const std::string zero_parameter_name