OGS
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  else
190  { // Read single mesh with geometry.
191  WARN(
192  "Consider switching from mesh and geometry input to multiple "
193  "meshes input. See "
194  "https://www.opengeosys.org/docs/tools/meshing-submeshes/"
195  "constructmeshesfromgeometry/ tool for conversion.");
197  meshes.push_back(readSingleMesh(config.getConfigParameter("mesh"),
199 
200  std::string const geometry_file = BaseLib::copyPathToFileName(
202  config.getConfigParameter<std::string>("geometry"),
204  GeoLib::GEOObjects geoObjects;
205  readGeometry(geometry_file, geoObjects);
206 
207  std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
209  bool const multiple_nodes_allowed = false;
210  auto additional_meshes =
212  geoObjects, *meshes[0], std::move(search_length_algorithm),
213  multiple_nodes_allowed);
214 
215  std::move(begin(additional_meshes), end(additional_meshes),
216  std::back_inserter(meshes));
217  }
218 
220 
221  return meshes;
222 }
223 
224 std::optional<ParameterLib::CoordinateSystem> parseLocalCoordinateSystem(
225  std::optional<BaseLib::ConfigTree> const& config,
226  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
227 {
228  if (!config)
229  {
230  return {};
231  }
232 
233  DBUG("Reading coordinate system configuration.");
234 
235  //
236  // Fetch the first basis vector; its length defines the dimension.
237  //
238  auto const& basis_vector_0 = ParameterLib::findParameter<double>(
239  *config,
241  "basis_vector_0", parameters, 0 /* any dimension */);
242  int const dimension = basis_vector_0.getNumberOfGlobalComponents();
243 
244  // check dimension
245  if (dimension != 2 && dimension != 3)
246  {
247  OGS_FATAL(
248  "Basis vector parameter '{:s}' must have two or three components, "
249  "but it has {:d}.",
250  basis_vector_0.name, dimension);
251  }
252 
253  //
254  // Fetch the second basis vector, which must be of the same dimension as the
255  // first one.
256  //
257  auto const& basis_vector_1 = ParameterLib::findParameter<double>(
258  *config,
260  "basis_vector_1", parameters, dimension);
261 
262  //
263  // For two dimensions, we are done; construct coordinate system;
264  //
265  if (dimension == 2)
266  {
267  return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1};
268  }
269 
270  //
271  // Parse the third vector, for three dimensions.
272  //
273  auto const& basis_vector_2 = ParameterLib::findParameter<double>(
274  *config,
276  "basis_vector_2", parameters, dimension);
277  return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1,
278  basis_vector_2};
279 }
280 } // namespace
281 
282 ProjectData::ProjectData() = default;
283 
285  std::string const& project_directory,
286  std::string const& output_directory)
287  : _mesh_vec(readMeshes(project_config, project_directory))
288 {
289  if (auto const python_script =
291  project_config.getConfigParameterOptional<std::string>("python_script"))
292  {
293 #ifdef OGS_USE_PYTHON
294  namespace py = pybind11;
295 
296  // Append to python's module search path
297  auto py_path = py::module::import("sys").attr("path");
298  py_path.attr("append")(project_directory); // .prj directory
299  // virtualenv
300  py_path.attr("append")(
301  CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
302 
303  auto const script_path =
305 
306  // Evaluate in scope of main module
307  py::object scope = py::module::import("__main__").attr("__dict__");
308  // add (global) variables
309  auto globals = py::dict(scope);
310  globals["ogs_prj_directory"] = project_directory;
311  py::eval_file(script_path, scope);
312 #else
313  OGS_FATAL("OpenGeoSys has not been built with Python support.");
314 #endif // OGS_USE_PYTHON
315  }
316 
318  parseCurves(project_config.getConfigSubtreeOptional("curves"));
319 
320  auto parameter_names_for_transformation =
322  parseParameters(project_config.getConfigSubtree("parameters"));
323 
326  project_config.getConfigSubtreeOptional("local_coordinate_system"),
327  _parameters);
328 
329  for (auto& parameter : _parameters)
330  {
331  if (std::find(begin(parameter_names_for_transformation),
332  end(parameter_names_for_transformation),
333  parameter->name) !=
334  end(parameter_names_for_transformation))
335  {
337  {
338  OGS_FATAL(
339  "The parameter '{:s}' is using the local coordinate system "
340  "but no local coordinate system was provided.",
341  parameter->name);
342  }
343  parameter->setCoordinateSystem(*_local_coordinate_system);
344  }
345 
346  parameter->initialize(_parameters);
347  }
348 
350  parseProcessVariables(project_config.getConfigSubtree("process_variables"));
351 
353  parseMedia(project_config.getConfigSubtreeOptional("media"));
354 
356  parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
357 
358  auto chemical_solver_interface = parseChemicalSolverInterface(
360  project_config.getConfigSubtreeOptional("chemical_system"),
361  output_directory);
362 
364  parseProcesses(project_config.getConfigSubtree("processes"),
365  project_directory, output_directory,
366  std::move(chemical_solver_interface));
367 
369  parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
370 
372  parseTimeLoop(project_config.getConfigSubtree("time_loop"),
373  output_directory);
374 }
375 
377  BaseLib::ConfigTree const& process_variables_config)
378 {
379  DBUG("Parse process variables:");
380 
381  std::set<std::string> names;
382 
383  for (auto var_config
385  : process_variables_config.getConfigSubtreeList("process_variable"))
386  {
387  // Either the mesh name is given, or the first mesh's name will be
388  // taken. Taking the first mesh's value is deprecated.
389  auto const mesh_name =
391  var_config.getConfigParameter<std::string>("mesh",
392  _mesh_vec[0]->getName());
393 
394  auto& mesh = *BaseLib::findElementOrError(
395  begin(_mesh_vec), end(_mesh_vec),
396  [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
397  "Expected to find a mesh named " + mesh_name + ".");
398 
399  auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
401  if (!names.insert(pv.getName()).second)
402  {
403  OGS_FATAL("A process variable with name `{:s}' already exists.",
404  pv.getName());
405  }
406 
407  _process_variables.push_back(std::move(pv));
408  }
409 }
410 
411 std::vector<std::string> ProjectData::parseParameters(
412  BaseLib::ConfigTree const& parameters_config)
413 {
414  using namespace ProcessLib;
415 
416  std::set<std::string> names;
417  std::vector<std::string> parameter_names_for_transformation;
418 
419  DBUG("Reading parameters:");
420  for (auto parameter_config :
422  parameters_config.getConfigSubtreeList("parameter"))
423  {
424  auto p =
425  ParameterLib::createParameter(parameter_config, _mesh_vec, _curves);
426  if (!names.insert(p->name).second)
427  {
428  OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
429  }
430 
431  auto const use_local_coordinate_system =
433  parameter_config.getConfigParameterOptional<bool>(
434  "use_local_coordinate_system");
435  if (!!use_local_coordinate_system && *use_local_coordinate_system)
436  {
437  parameter_names_for_transformation.push_back(p->name);
438  }
439 
440  _parameters.push_back(std::move(p));
441  }
442 
443  _parameters.push_back(
444  std::make_unique<ParameterLib::ConstantParameter<double>>(
446 
447  return parameter_names_for_transformation;
448 }
449 
451  std::optional<BaseLib::ConfigTree> const& media_config)
452 {
453  if (!media_config)
454  {
455  return;
456  }
457 
458  DBUG("Reading media:");
459 
460  if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
461  {
462  ERR("A mesh is required to define medium materials.");
463  return;
464  }
465 
466  for (auto const& medium_config :
468  media_config->getConfigSubtreeList("medium"))
469  {
470  auto material_id_string =
472  medium_config.getConfigAttribute<std::string>("id", "0");
473 
474  auto const material_ids_of_this_medium =
475  splitMaterialIdString(material_id_string);
476 
477  for (auto const& id : material_ids_of_this_medium)
478  {
479  if (_media.find(id) != end(_media))
480  {
481  OGS_FATAL(
482  "Multiple media were specified for the same material id "
483  "'{:d}'. Keep in mind, that if no material id is "
484  "specified, it is assumed to be 0 by default.",
485  id);
486  }
487 
488  if (id == material_ids_of_this_medium[0])
489  {
491  _mesh_vec[0]->getDimension(), medium_config, _parameters,
493  : nullptr,
494  _curves);
495  }
496  else
497  {
498  // This medium has multiple material IDs assigned and this is
499  // not the first material ID. Therefore we can reuse the medium
500  // we created before.
501  _media[id] = _media[material_ids_of_this_medium[0]];
502  }
503  }
504  }
505 
506  if (_media.empty())
507  {
508  OGS_FATAL("No entity is found inside <media>.");
509  }
510 }
511 
512 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
514  std::optional<BaseLib::ConfigTree> const& config,
515  std::string const& output_directory)
516 {
517  if (!config)
518  {
519  return nullptr;
520  }
521 
522  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
523  chemical_solver_interface;
524 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
525  INFO(
526  "Ready for initializing interface to a chemical solver for water "
527  "chemistry calculation.");
528 
529  auto const chemical_solver =
531  config->getConfigAttribute<std::string>("chemical_solver");
532 
533  if (boost::iequals(chemical_solver, "Phreeqc"))
534  {
535  INFO(
536  "Configuring phreeqc interface for water chemistry calculation "
537  "using file-based approach.");
538 
539  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
541  *config, output_directory);
542  }
543  else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
544  {
545  OGS_FATAL(
546  "The chemical solver option of PhreeqcKernel is not accessible for "
547  "the time being. Please set 'Phreeqc'' as the chemical solver for "
548  "reactive transport modeling.");
549  }
550  else
551  {
552  OGS_FATAL(
553  "Unknown chemical solver. Please specify either Phreeqc or "
554  "PhreeqcKernel as the solver for water chemistry calculation "
555  "instead.");
556  }
557 #else
558  (void)output_directory;
559 
560  OGS_FATAL(
561  "Found the type of the process to be solved is not component transport "
562  "process. Please specify the process type to ComponentTransport. At "
563  "the present, water chemistry calculation is only available for "
564  "component transport process.");
565 #endif
566  return chemical_solver_interface;
567 }
568 
570  BaseLib::ConfigTree const& processes_config,
571  std::string const& project_directory,
572  std::string const& output_directory,
573  [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
574  chemical_solver_interface)
575 {
576  (void)project_directory; // to avoid compilation warning
577  (void)output_directory; // to avoid compilation warning
578 
579  DBUG("Reading processes:");
581  for (auto process_config : processes_config.getConfigSubtreeList("process"))
582  {
583  auto const type =
585  process_config.peekConfigParameter<std::string>("type");
586 
587  auto const name =
589  process_config.getConfigParameter<std::string>("name");
590 
591  auto const integration_order =
593  process_config.getConfigParameter<int>("integration_order");
594 
595  std::unique_ptr<ProcessLib::Process> process;
596 
597  auto jacobian_assembler = ProcessLib::createJacobianAssembler(
599  process_config.getConfigSubtreeOptional("jacobian_assembler"));
600 
601 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
602  if (type == "STEADY_STATE_DIFFUSION")
603  {
604  // The existence check of the in the configuration referenced
605  // process variables is checked in the physical process.
606  // TODO at the moment we have only one mesh, later there can be
607  // several meshes. Then we have to assign the referenced mesh
608  // here.
609  process =
611  name, *_mesh_vec[0], std::move(jacobian_assembler),
612  _process_variables, _parameters, integration_order,
613  process_config, _mesh_vec, _media);
614  }
615  else
616 #endif
617 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
618  if (type == "LIQUID_FLOW")
619  {
621  name, *_mesh_vec[0], std::move(jacobian_assembler),
622  _process_variables, _parameters, integration_order,
623  process_config, _mesh_vec, _media);
624  }
625  else
626 #endif
627 #ifdef OGS_BUILD_PROCESS_STOKESFLOW
628  if (type == "StokesFlow")
629  {
630  switch (_mesh_vec[0]->getDimension())
631  {
632  case 2:
633  process =
635  name, *_mesh_vec[0], std::move(jacobian_assembler),
636  _process_variables, _parameters, integration_order,
637  process_config, _media);
638  break;
639  default:
640  OGS_FATAL(
641  "StokesFlow process does not support given "
642  "dimension {:d}",
643  _mesh_vec[0]->getDimension());
644  }
645  }
646  else
647 #endif
648 #ifdef OGS_BUILD_PROCESS_TES
649  if (type == "TES")
650  {
652  name, *_mesh_vec[0], std::move(jacobian_assembler),
653  _process_variables, _parameters, integration_order,
654  process_config);
655  }
656  else
657 #endif
658 #ifdef OGS_BUILD_PROCESS_TH2M
659  if (type == "TH2M")
660  {
661  switch (_mesh_vec[0]->getDimension())
662  {
663  case 2:
665  name, *_mesh_vec[0], std::move(jacobian_assembler),
667  _local_coordinate_system, integration_order,
668  process_config, _media);
669  break;
670  case 3:
672  name, *_mesh_vec[0], std::move(jacobian_assembler),
674  _local_coordinate_system, integration_order,
675  process_config, _media);
676  break;
677  default:
678  OGS_FATAL("TH2M process does not support given dimension");
679  }
680  }
681  else
682 #endif
683 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
684  if (type == "HEAT_CONDUCTION")
685  {
687  name, *_mesh_vec[0], std::move(jacobian_assembler),
688  _process_variables, _parameters, integration_order,
689  process_config, _media);
690  }
691  else
692 #endif
693 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
694  if (type == "HEAT_TRANSPORT_BHE")
695  {
696  if (_mesh_vec[0]->getDimension() != 3)
697  {
698  OGS_FATAL(
699  "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
700  "mesh! ");
701  }
702 
703  process =
705  name, *_mesh_vec[0], std::move(jacobian_assembler),
706  _process_variables, _parameters, integration_order,
707  process_config, _curves, _media);
708  }
709  else
710 #endif
711 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
712  if (type == "HYDRO_MECHANICS")
713  {
715  switch (process_config.getConfigParameter<int>("dimension"))
716  {
717  case 2:
718  process =
720  2>(name, *_mesh_vec[0],
721  std::move(jacobian_assembler),
723  _local_coordinate_system, integration_order,
724  process_config, _media);
725  break;
726  case 3:
727  process =
729  3>(name, *_mesh_vec[0],
730  std::move(jacobian_assembler),
732  _local_coordinate_system, integration_order,
733  process_config, _media);
734  break;
735  default:
736  OGS_FATAL(
737  "HYDRO_MECHANICS process does not support given "
738  "dimension");
739  }
740  }
741  else
742 #endif
743 #ifdef OGS_BUILD_PROCESS_LIE
744  if (type == "HYDRO_MECHANICS_WITH_LIE")
745  {
747  switch (process_config.getConfigParameter<int>("dimension"))
748  {
749  case 2:
752  name, *_mesh_vec[0], std::move(jacobian_assembler),
754  _local_coordinate_system, integration_order,
755  process_config);
756  break;
757  case 3:
760  name, *_mesh_vec[0], std::move(jacobian_assembler),
762  _local_coordinate_system, integration_order,
763  process_config);
764  break;
765  default:
766  OGS_FATAL(
767  "HYDRO_MECHANICS_WITH_LIE process does not support "
768  "given dimension");
769  }
770  }
771  else
772 #endif
773 #ifdef OGS_BUILD_PROCESS_HT
774  if (type == "HT")
775  {
777  name, *_mesh_vec[0], std::move(jacobian_assembler),
778  _process_variables, _parameters, integration_order,
779  process_config, _mesh_vec, _media);
780  }
781  else
782 #endif
783 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
784  if (type == "ComponentTransport")
785  {
786  process =
788  name, *_mesh_vec[0], std::move(jacobian_assembler),
789  _process_variables, _parameters, integration_order,
790  process_config, _mesh_vec, _media,
791  std::move(chemical_solver_interface));
792  }
793  else
794 #endif
795 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
796  if (type == "PHASE_FIELD")
797  {
798  switch (_mesh_vec[0]->getDimension())
799  {
800  case 2:
801  process =
803  name, *_mesh_vec[0], std::move(jacobian_assembler),
805  _local_coordinate_system, integration_order,
806  process_config);
807  break;
808  case 3:
809  process =
811  name, *_mesh_vec[0], std::move(jacobian_assembler),
813  _local_coordinate_system, integration_order,
814  process_config);
815  break;
816  }
817  }
818  else
819 #endif
820 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
821  if (type == "RichardsComponentTransport")
822  {
825  name, *_mesh_vec[0], std::move(jacobian_assembler),
826  _process_variables, _parameters, integration_order,
827  process_config, _media);
828  }
829  else
830 #endif
831 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
832  if (type == "SMALL_DEFORMATION")
833  {
834  switch (_mesh_vec[0]->getDimension())
835  {
836  case 2:
839  name, *_mesh_vec[0], std::move(jacobian_assembler),
841  _local_coordinate_system, integration_order,
842  process_config);
843  break;
844  case 3:
847  name, *_mesh_vec[0], std::move(jacobian_assembler),
849  _local_coordinate_system, integration_order,
850  process_config);
851  break;
852  default:
853  OGS_FATAL(
854  "SMALL_DEFORMATION process does not support given "
855  "dimension");
856  }
857  }
858  else
859 #endif
860 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
861  if (type == "SMALL_DEFORMATION_NONLOCAL")
862  {
863  switch (_mesh_vec[0]->getDimension())
864  {
865  case 2:
868  name, *_mesh_vec[0], std::move(jacobian_assembler),
870  _local_coordinate_system, integration_order,
871  process_config);
872  break;
873  case 3:
876  name, *_mesh_vec[0], std::move(jacobian_assembler),
878  _local_coordinate_system, integration_order,
879  process_config);
880  break;
881  default:
882  OGS_FATAL(
883  "SMALL_DEFORMATION_NONLOCAL process does not support "
884  "given dimension {:d}",
885  _mesh_vec[0]->getDimension());
886  }
887  }
888  else
889 #endif
890 #ifdef OGS_BUILD_PROCESS_LIE
891  if (type == "SMALL_DEFORMATION_WITH_LIE")
892  {
894  switch (process_config.getConfigParameter<int>("dimension"))
895  {
896  case 2:
899  name, *_mesh_vec[0], std::move(jacobian_assembler),
901  _local_coordinate_system, integration_order,
902  process_config);
903  break;
904  case 3:
907  name, *_mesh_vec[0], std::move(jacobian_assembler),
909  _local_coordinate_system, integration_order,
910  process_config);
911  break;
912  default:
913  OGS_FATAL(
914  "SMALL_DEFORMATION_WITH_LIE process does not support "
915  "given dimension");
916  }
917  }
918  else
919 #endif
920 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
921  if (type == "THERMO_HYDRO_MECHANICS")
922  {
924  switch (process_config.getConfigParameter<int>("dimension"))
925  {
926  case 2:
929  name, *_mesh_vec[0], std::move(jacobian_assembler),
931  _local_coordinate_system, integration_order,
932  process_config, _media);
933  break;
934  case 3:
937  name, *_mesh_vec[0], std::move(jacobian_assembler),
939  _local_coordinate_system, integration_order,
940  process_config, _media);
941  break;
942  default:
943  OGS_FATAL(
944  "THERMO_HYDRO_MECHANICS process does not support given "
945  "dimension");
946  }
947  }
948  else
949 #endif
950 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
951  if (type == "THERMO_MECHANICAL_PHASE_FIELD")
952  {
953  switch (_mesh_vec[0]->getDimension())
954  {
955  case 2:
958  name, *_mesh_vec[0], std::move(jacobian_assembler),
960  _local_coordinate_system, integration_order,
961  process_config);
962  break;
963  case 3:
966  name, *_mesh_vec[0], std::move(jacobian_assembler),
968  _local_coordinate_system, integration_order,
969  process_config);
970  break;
971  }
972  }
973  else
974 #endif
975 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
976  if (type == "THERMO_MECHANICS")
977  {
978  switch (_mesh_vec[0]->getDimension())
979  {
980  case 2:
983  name, *_mesh_vec[0], std::move(jacobian_assembler),
985  _local_coordinate_system, integration_order,
986  process_config, _media);
987  break;
988  case 3:
991  name, *_mesh_vec[0], std::move(jacobian_assembler),
993  _local_coordinate_system, integration_order,
994  process_config, _media);
995  break;
996  }
997  }
998  else
999 #endif
1000 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1001  if (type == "RICHARDS_FLOW")
1002  {
1004  name, *_mesh_vec[0], std::move(jacobian_assembler),
1005  _process_variables, _parameters, integration_order,
1006  process_config, _curves, _media);
1007  }
1008  else
1009 #endif
1010 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1011  if (type == "RICHARDS_MECHANICS")
1012  {
1014  switch (process_config.getConfigParameter<int>("dimension"))
1015  {
1016  case 2:
1019  name, *_mesh_vec[0], std::move(jacobian_assembler),
1021  _local_coordinate_system, integration_order,
1022  process_config, _media);
1023  break;
1024  case 3:
1027  name, *_mesh_vec[0], std::move(jacobian_assembler),
1029  _local_coordinate_system, integration_order,
1030  process_config, _media);
1031  break;
1032  }
1033  }
1034  else
1035 #endif
1036 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1037  if (type == "THERMO_RICHARDS_FLOW")
1038  {
1039  process =
1041  name, *_mesh_vec[0], std::move(jacobian_assembler),
1042  _process_variables, _parameters, integration_order,
1043  process_config, _media);
1044  }
1045  else
1046 #endif
1047 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1048  if (type == "THERMO_RICHARDS_MECHANICS")
1049  {
1050  switch (_mesh_vec[0]->getDimension())
1051  {
1052  case 2:
1055  name, *_mesh_vec[0], std::move(jacobian_assembler),
1057  _local_coordinate_system, integration_order,
1058  process_config, _media);
1059  break;
1060  case 3:
1063  name, *_mesh_vec[0], std::move(jacobian_assembler),
1065  _local_coordinate_system, integration_order,
1066  process_config, _media);
1067  break;
1068  }
1069  }
1070  else
1071 #endif
1072 
1073 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1074  if (type == "TWOPHASE_FLOW_PP")
1075  {
1076  process =
1078  name, *_mesh_vec[0], std::move(jacobian_assembler),
1079  _process_variables, _parameters, integration_order,
1080  process_config, _curves, _media);
1081  }
1082  else
1083 #endif
1084 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1085  if (type == "TWOPHASE_FLOW_PRHO")
1086  {
1089  name, *_mesh_vec[0], std::move(jacobian_assembler),
1090  _process_variables, _parameters, integration_order,
1091  process_config, _curves);
1092  }
1093  else
1094 #endif
1095 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1096  if (type == "THERMAL_TWOPHASE_WITH_PP")
1097  {
1100  name, *_mesh_vec[0], std::move(jacobian_assembler),
1101  _process_variables, _parameters, integration_order,
1102  process_config, _curves);
1103  }
1104  else
1105 #endif
1106  {
1107  OGS_FATAL("Unknown process type: {:s}", type);
1108  }
1109 
1110  if (BaseLib::containsIf(
1111  _processes,
1112  [&name](std::unique_ptr<ProcessLib::Process> const& p)
1113  { return p->name == name; }))
1114  {
1115  OGS_FATAL("The process name '{:s}' is not unique.", name);
1116  }
1117  _processes.push_back(std::move(process));
1118  }
1119 }
1120 
1122  std::string const& output_directory)
1123 {
1124  DBUG("Reading time loop configuration.");
1125 
1127  config, output_directory, _processes, _nonlinear_solvers, _mesh_vec);
1128 
1129  if (!_time_loop)
1130  {
1131  OGS_FATAL("Initialization of time loop failed.");
1132  }
1133 }
1134 
1136 {
1137  DBUG("Reading linear solver configuration.");
1138 
1140  for (auto conf : config.getConfigSubtreeList("linear_solver"))
1141  {
1143  auto const name = conf.getConfigParameter<std::string>("name");
1146  name,
1147  std::make_unique<GlobalLinearSolver>("", &conf),
1148  "The linear solver name is not unique");
1149  }
1150 }
1151 
1153 {
1154  DBUG("Reading non-linear solver configuration.");
1155 
1157  for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1158  {
1159  auto const ls_name =
1161  conf.getConfigParameter<std::string>("linear_solver");
1162  auto& linear_solver = BaseLib::getOrError(
1163  _linear_solvers, ls_name,
1164  "A linear solver with the given name does not exist.");
1165 
1167  auto const name = conf.getConfigParameter<std::string>("name");
1170  name,
1171  NumLib::createNonlinearSolver(*linear_solver, conf).first,
1172  "The nonlinear solver name is not unique");
1173  }
1174 }
1175 
1176 void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1177 {
1178  if (!config)
1179  {
1180  return;
1181  }
1182 
1183  DBUG("Reading curves configuration.");
1184 
1186  for (auto conf : config->getConfigSubtreeList("curve"))
1187  {
1189  auto const name = conf.getConfigParameter<std::string>("name");
1191  _curves,
1192  name,
1195  "The curve name is not unique.");
1196  }
1197 }
1198 
1199 std::vector<int> splitMaterialIdString(std::string const& material_id_string)
1200 {
1201  auto const material_ids_strings =
1202  BaseLib::splitString(material_id_string, ',');
1203 
1204  std::vector<int> material_ids;
1205  for (auto& mid_str : material_ids_strings)
1206  {
1207  std::size_t num_chars_processed = 0;
1208  int material_id;
1209  try
1210  {
1211  material_id = std::stoi(mid_str, &num_chars_processed);
1212  }
1213  catch (std::invalid_argument&)
1214  {
1215  OGS_FATAL(
1216  "Could not parse material ID from '{}' to a valid "
1217  "integer.",
1218  mid_str);
1219  }
1220  catch (std::out_of_range&)
1221  {
1222  OGS_FATAL(
1223  "Could not parse material ID from '{}'. The integer value "
1224  "of the given string exceeds the permitted range.",
1225  mid_str);
1226  }
1227 
1228  if (num_chars_processed != mid_str.size())
1229  {
1230  // Not the whole string has been parsed. Check the rest.
1231  if (auto const it = std::find_if_not(
1232  begin(mid_str) + num_chars_processed, end(mid_str),
1233  [](unsigned char const c) { return std::isspace(c); });
1234  it != end(mid_str))
1235  {
1236  OGS_FATAL(
1237  "Could not parse material ID from '{}'. Please "
1238  "separate multiple material IDs by comma only. "
1239  "Invalid character: '{}' at position {}.",
1240  mid_str, *it, distance(begin(mid_str), it));
1241  }
1242  }
1243 
1244  material_ids.push_back(material_id);
1245  };
1246 
1247  return material_ids;
1248 }
Definition of the BoostXmlGmlInterface class.
Functionality to build different search length algorithm objects from given config.
#define OGS_FATAL(...)
Definition: Error.h:26
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.
std::vector< int > splitMaterialIdString(std::string const &material_id_string)
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:147
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition: Algorithm.h:106
bool containsIf(Container const &container, Predicate &&predicate)
Definition: Algorithm.h:264
std::string copyPathToFileName(const std::string &file_name, const std::string &source)
Definition: FileTools.cpp:196
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:69
std::unique_ptr< ChemicalSolverInterface > createChemicalSolverInterface(std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< std::string, std::unique_ptr< GlobalLinearSolver >> const &linear_solvers, 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