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& directory)
143 {
144  std::string const mesh_file = BaseLib::copyPathToFileName(
145  mesh_config_parameter.getValue<std::string>(), 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& 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(configs.begin(), configs.end(),
185  std::back_inserter(meshes),
186  [&directory](auto const& mesh_config)
187  { return readSingleMesh(mesh_config, 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.");
196  meshes.push_back(
198  readSingleMesh(config.getConfigParameter("mesh"), directory));
199 
200  std::string const geometry_file = BaseLib::copyPathToFileName(
202  config.getConfigParameter<std::string>("geometry"),
203  directory);
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  std::string const& mesh_directory)
288  : _mesh_vec(readMeshes(project_config, mesh_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 
357  parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
358 
359  auto chemical_solver_interface = parseChemicalSolverInterface(
361  project_config.getConfigSubtreeOptional("chemical_system"),
362  output_directory);
363 
365  parseProcesses(project_config.getConfigSubtree("processes"),
366  project_directory, output_directory,
367  std::move(chemical_solver_interface));
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  _parameters.push_back(
448  std::make_unique<ParameterLib::ConstantParameter<double>>(
450 
451  return parameter_names_for_transformation;
452 }
453 
455  std::optional<BaseLib::ConfigTree> const& media_config)
456 {
457  if (!media_config)
458  {
459  return;
460  }
461 
462  DBUG("Reading media:");
463 
464  if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
465  {
466  ERR("A mesh is required to define medium materials.");
467  return;
468  }
469 
470  for (auto const& medium_config :
472  media_config->getConfigSubtreeList("medium"))
473  {
474  auto material_id_string =
476  medium_config.getConfigAttribute<std::string>("id", "0");
477 
478  auto const material_ids_of_this_medium =
479  splitMaterialIdString(material_id_string);
480 
481  for (auto const& id : material_ids_of_this_medium)
482  {
483  if (_media.find(id) != end(_media))
484  {
485  OGS_FATAL(
486  "Multiple media were specified for the same material id "
487  "'{:d}'. Keep in mind, that if no material id is "
488  "specified, it is assumed to be 0 by default.",
489  id);
490  }
491 
492  if (id == material_ids_of_this_medium[0])
493  {
495  id, _mesh_vec[0]->getDimension(), medium_config,
496  _parameters,
498  : nullptr,
499  _curves);
500  }
501  else
502  {
503  // This medium has multiple material IDs assigned and this is
504  // not the first material ID. Therefore we can reuse the medium
505  // we created before.
506  _media[id] = _media[material_ids_of_this_medium[0]];
507  }
508  }
509  }
510 
511  if (_media.empty())
512  {
513  OGS_FATAL("No entity is found inside <media>.");
514  }
515 }
516 
517 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
519  std::optional<BaseLib::ConfigTree> const& config,
520  std::string const& output_directory)
521 {
522  if (!config)
523  {
524  return nullptr;
525  }
526 
527  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
528  chemical_solver_interface;
529 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
530  INFO(
531  "Ready for initializing interface to a chemical solver for water "
532  "chemistry calculation.");
533 
534  auto const chemical_solver =
536  config->getConfigAttribute<std::string>("chemical_solver");
537 
538  if (boost::iequals(chemical_solver, "Phreeqc"))
539  {
540  INFO(
541  "Configuring phreeqc interface for water chemistry calculation "
542  "using file-based approach.");
543 
544  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
546  *config, output_directory);
547  }
548  else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
549  {
550  OGS_FATAL(
551  "The chemical solver option of PhreeqcKernel is not accessible for "
552  "the time being. Please set 'Phreeqc'' as the chemical solver for "
553  "reactive transport modeling.");
554  }
555  else if (boost::iequals(chemical_solver, "SelfContained"))
556  {
557  INFO(
558  "Use self-contained chemical solver for water chemistry "
559  "calculation.");
560 
561  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
563  _mesh_vec, _linear_solvers, *config, output_directory);
564  }
565  else
566  {
567  OGS_FATAL(
568  "Unknown chemical solver. Please specify either Phreeqc or "
569  "PhreeqcKernel as the solver for water chemistry calculation "
570  "instead.");
571  }
572 #else
573  (void)output_directory;
574 
575  OGS_FATAL(
576  "Found the type of the process to be solved is not component transport "
577  "process. Please specify the process type to ComponentTransport. At "
578  "the present, water chemistry calculation is only available for "
579  "component transport process.");
580 #endif
581  return chemical_solver_interface;
582 }
583 
585  BaseLib::ConfigTree const& processes_config,
586  std::string const& project_directory,
587  std::string const& output_directory,
588  [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
589  chemical_solver_interface)
590 {
591  (void)project_directory; // to avoid compilation warning
592  (void)output_directory; // to avoid compilation warning
593 
594  DBUG("Reading processes:");
596  for (auto process_config : processes_config.getConfigSubtreeList("process"))
597  {
598  auto const type =
600  process_config.peekConfigParameter<std::string>("type");
601 
602  auto const name =
604  process_config.getConfigParameter<std::string>("name");
605 
606  auto const integration_order =
608  process_config.getConfigParameter<int>("integration_order");
609 
610  std::unique_ptr<ProcessLib::Process> process;
611 
612  auto jacobian_assembler = ProcessLib::createJacobianAssembler(
614  process_config.getConfigSubtreeOptional("jacobian_assembler"));
615 
616 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
617  if (type == "STEADY_STATE_DIFFUSION")
618  {
619  // The existence check of the in the configuration referenced
620  // process variables is checked in the physical process.
621  // TODO at the moment we have only one mesh, later there can be
622  // several meshes. Then we have to assign the referenced mesh
623  // here.
624  process =
626  name, *_mesh_vec[0], std::move(jacobian_assembler),
627  _process_variables, _parameters, integration_order,
628  process_config, _mesh_vec, _media);
629  }
630  else
631 #endif
632 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
633  if (type == "LIQUID_FLOW")
634  {
636  name, *_mesh_vec[0], std::move(jacobian_assembler),
637  _process_variables, _parameters, integration_order,
638  process_config, _mesh_vec, _media);
639  }
640  else
641 #endif
642 #ifdef OGS_BUILD_PROCESS_STOKESFLOW
643  if (type == "StokesFlow")
644  {
645  switch (_mesh_vec[0]->getDimension())
646  {
647  case 2:
648  process =
650  name, *_mesh_vec[0], std::move(jacobian_assembler),
651  _process_variables, _parameters, integration_order,
652  process_config, _media);
653  break;
654  default:
655  OGS_FATAL(
656  "StokesFlow process does not support given "
657  "dimension {:d}",
658  _mesh_vec[0]->getDimension());
659  }
660  }
661  else
662 #endif
663 #ifdef OGS_BUILD_PROCESS_TES
664  if (type == "TES")
665  {
667  name, *_mesh_vec[0], std::move(jacobian_assembler),
668  _process_variables, _parameters, integration_order,
669  process_config);
670  }
671  else
672 #endif
673 #ifdef OGS_BUILD_PROCESS_TH2M
674  if (type == "TH2M")
675  {
676  switch (_mesh_vec[0]->getDimension())
677  {
678  case 2:
680  name, *_mesh_vec[0], std::move(jacobian_assembler),
682  _local_coordinate_system, integration_order,
683  process_config, _media);
684  break;
685  case 3:
687  name, *_mesh_vec[0], std::move(jacobian_assembler),
689  _local_coordinate_system, integration_order,
690  process_config, _media);
691  break;
692  default:
693  OGS_FATAL("TH2M process does not support given dimension");
694  }
695  }
696  else
697 #endif
698 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
699  if (type == "HEAT_CONDUCTION")
700  {
702  name, *_mesh_vec[0], std::move(jacobian_assembler),
703  _process_variables, _parameters, integration_order,
704  process_config, _media);
705  }
706  else
707 #endif
708 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
709  if (type == "HEAT_TRANSPORT_BHE")
710  {
711  if (_mesh_vec[0]->getDimension() != 3)
712  {
713  OGS_FATAL(
714  "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
715  "mesh! ");
716  }
717 
718  process =
720  name, *_mesh_vec[0], std::move(jacobian_assembler),
721  _process_variables, _parameters, integration_order,
722  process_config, _curves, _media);
723  }
724  else
725 #endif
726 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
727  if (type == "HYDRO_MECHANICS")
728  {
730  switch (process_config.getConfigParameter<int>("dimension"))
731  {
732  case 2:
733  process =
735  2>(name, *_mesh_vec[0],
736  std::move(jacobian_assembler),
738  _local_coordinate_system, integration_order,
739  process_config, _media);
740  break;
741  case 3:
742  process =
744  3>(name, *_mesh_vec[0],
745  std::move(jacobian_assembler),
747  _local_coordinate_system, integration_order,
748  process_config, _media);
749  break;
750  default:
751  OGS_FATAL(
752  "HYDRO_MECHANICS process does not support given "
753  "dimension");
754  }
755  }
756  else
757 #endif
758 #ifdef OGS_BUILD_PROCESS_LIE
759  if (type == "HYDRO_MECHANICS_WITH_LIE")
760  {
762  switch (process_config.getConfigParameter<int>("dimension"))
763  {
764  case 2:
767  name, *_mesh_vec[0], std::move(jacobian_assembler),
769  _local_coordinate_system, integration_order,
770  process_config);
771  break;
772  case 3:
775  name, *_mesh_vec[0], std::move(jacobian_assembler),
777  _local_coordinate_system, integration_order,
778  process_config);
779  break;
780  default:
781  OGS_FATAL(
782  "HYDRO_MECHANICS_WITH_LIE process does not support "
783  "given dimension");
784  }
785  }
786  else
787 #endif
788 #ifdef OGS_BUILD_PROCESS_HT
789  if (type == "HT")
790  {
792  name, *_mesh_vec[0], std::move(jacobian_assembler),
793  _process_variables, _parameters, integration_order,
794  process_config, _mesh_vec, _media);
795  }
796  else
797 #endif
798 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
799  if (type == "ComponentTransport")
800  {
801  process =
803  name, *_mesh_vec[0], std::move(jacobian_assembler),
804  _process_variables, _parameters, integration_order,
805  process_config, _mesh_vec, _media,
806  std::move(chemical_solver_interface));
807  }
808  else
809 #endif
810 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
811  if (type == "PHASE_FIELD")
812  {
813  switch (_mesh_vec[0]->getDimension())
814  {
815  case 2:
816  process =
818  name, *_mesh_vec[0], std::move(jacobian_assembler),
820  _local_coordinate_system, integration_order,
821  process_config);
822  break;
823  case 3:
824  process =
826  name, *_mesh_vec[0], std::move(jacobian_assembler),
828  _local_coordinate_system, integration_order,
829  process_config);
830  break;
831  }
832  }
833  else
834 #endif
835 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
836  if (type == "RichardsComponentTransport")
837  {
840  name, *_mesh_vec[0], std::move(jacobian_assembler),
841  _process_variables, _parameters, integration_order,
842  process_config, _media);
843  }
844  else
845 #endif
846 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
847  if (type == "SMALL_DEFORMATION")
848  {
849  switch (_mesh_vec[0]->getDimension())
850  {
851  case 2:
854  name, *_mesh_vec[0], std::move(jacobian_assembler),
856  _local_coordinate_system, integration_order,
857  process_config);
858  break;
859  case 3:
862  name, *_mesh_vec[0], std::move(jacobian_assembler),
864  _local_coordinate_system, integration_order,
865  process_config);
866  break;
867  default:
868  OGS_FATAL(
869  "SMALL_DEFORMATION process does not support given "
870  "dimension");
871  }
872  }
873  else
874 #endif
875 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
876  if (type == "SMALL_DEFORMATION_NONLOCAL")
877  {
878  switch (_mesh_vec[0]->getDimension())
879  {
880  case 2:
883  name, *_mesh_vec[0], std::move(jacobian_assembler),
885  _local_coordinate_system, integration_order,
886  process_config);
887  break;
888  case 3:
891  name, *_mesh_vec[0], std::move(jacobian_assembler),
893  _local_coordinate_system, integration_order,
894  process_config);
895  break;
896  default:
897  OGS_FATAL(
898  "SMALL_DEFORMATION_NONLOCAL process does not support "
899  "given dimension {:d}",
900  _mesh_vec[0]->getDimension());
901  }
902  }
903  else
904 #endif
905 #ifdef OGS_BUILD_PROCESS_LIE
906  if (type == "SMALL_DEFORMATION_WITH_LIE")
907  {
909  switch (process_config.getConfigParameter<int>("dimension"))
910  {
911  case 2:
914  name, *_mesh_vec[0], std::move(jacobian_assembler),
916  _local_coordinate_system, integration_order,
917  process_config);
918  break;
919  case 3:
922  name, *_mesh_vec[0], std::move(jacobian_assembler),
924  _local_coordinate_system, integration_order,
925  process_config);
926  break;
927  default:
928  OGS_FATAL(
929  "SMALL_DEFORMATION_WITH_LIE process does not support "
930  "given dimension");
931  }
932  }
933  else
934 #endif
935 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
936  if (type == "THERMO_HYDRO_MECHANICS")
937  {
939  switch (process_config.getConfigParameter<int>("dimension"))
940  {
941  case 2:
944  name, *_mesh_vec[0], std::move(jacobian_assembler),
946  _local_coordinate_system, integration_order,
947  process_config, _media);
948  break;
949  case 3:
952  name, *_mesh_vec[0], std::move(jacobian_assembler),
954  _local_coordinate_system, integration_order,
955  process_config, _media);
956  break;
957  default:
958  OGS_FATAL(
959  "THERMO_HYDRO_MECHANICS process does not support given "
960  "dimension");
961  }
962  }
963  else
964 #endif
965 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
966  if (type == "THERMO_MECHANICAL_PHASE_FIELD")
967  {
968  switch (_mesh_vec[0]->getDimension())
969  {
970  case 2:
973  name, *_mesh_vec[0], std::move(jacobian_assembler),
975  _local_coordinate_system, integration_order,
976  process_config);
977  break;
978  case 3:
981  name, *_mesh_vec[0], std::move(jacobian_assembler),
983  _local_coordinate_system, integration_order,
984  process_config);
985  break;
986  }
987  }
988  else
989 #endif
990 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
991  if (type == "THERMO_MECHANICS")
992  {
993  switch (_mesh_vec[0]->getDimension())
994  {
995  case 2:
998  name, *_mesh_vec[0], std::move(jacobian_assembler),
1000  _local_coordinate_system, integration_order,
1001  process_config, _media);
1002  break;
1003  case 3:
1006  name, *_mesh_vec[0], std::move(jacobian_assembler),
1008  _local_coordinate_system, integration_order,
1009  process_config, _media);
1010  break;
1011  }
1012  }
1013  else
1014 #endif
1015 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1016  if (type == "RICHARDS_FLOW")
1017  {
1019  name, *_mesh_vec[0], std::move(jacobian_assembler),
1020  _process_variables, _parameters, integration_order,
1021  process_config, _curves, _media);
1022  }
1023  else
1024 #endif
1025 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1026  if (type == "RICHARDS_MECHANICS")
1027  {
1029  switch (process_config.getConfigParameter<int>("dimension"))
1030  {
1031  case 2:
1034  name, *_mesh_vec[0], std::move(jacobian_assembler),
1036  _local_coordinate_system, integration_order,
1037  process_config, _media);
1038  break;
1039  case 3:
1042  name, *_mesh_vec[0], std::move(jacobian_assembler),
1044  _local_coordinate_system, integration_order,
1045  process_config, _media);
1046  break;
1047  }
1048  }
1049  else
1050 #endif
1051 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1052  if (type == "THERMO_RICHARDS_FLOW")
1053  {
1054  process =
1056  name, *_mesh_vec[0], std::move(jacobian_assembler),
1057  _process_variables, _parameters, integration_order,
1058  process_config, _media);
1059  }
1060  else
1061 #endif
1062 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1063  if (type == "THERMO_RICHARDS_MECHANICS")
1064  {
1065  switch (_mesh_vec[0]->getDimension())
1066  {
1067  case 2:
1070  name, *_mesh_vec[0], std::move(jacobian_assembler),
1072  _local_coordinate_system, integration_order,
1073  process_config, _media);
1074  break;
1075  case 3:
1078  name, *_mesh_vec[0], std::move(jacobian_assembler),
1080  _local_coordinate_system, integration_order,
1081  process_config, _media);
1082  break;
1083  }
1084  }
1085  else
1086 #endif
1087 
1088 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1089  if (type == "TWOPHASE_FLOW_PP")
1090  {
1091  process =
1093  name, *_mesh_vec[0], std::move(jacobian_assembler),
1094  _process_variables, _parameters, integration_order,
1095  process_config, _curves, _media);
1096  }
1097  else
1098 #endif
1099 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1100  if (type == "TWOPHASE_FLOW_PRHO")
1101  {
1104  name, *_mesh_vec[0], std::move(jacobian_assembler),
1105  _process_variables, _parameters, integration_order,
1106  process_config, _curves);
1107  }
1108  else
1109 #endif
1110 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1111  if (type == "THERMAL_TWOPHASE_WITH_PP")
1112  {
1115  name, *_mesh_vec[0], std::move(jacobian_assembler),
1116  _process_variables, _parameters, integration_order,
1117  process_config, _curves, _media);
1118  }
1119  else
1120 #endif
1121  {
1122  OGS_FATAL("Unknown process type: {:s}", type);
1123  }
1124 
1125  if (BaseLib::containsIf(
1126  _processes,
1127  [&name](std::unique_ptr<ProcessLib::Process> const& p)
1128  { return p->name == name; }))
1129  {
1130  OGS_FATAL("The process name '{:s}' is not unique.", name);
1131  }
1132  _processes.push_back(std::move(process));
1133  }
1134 }
1135 
1137  std::string const& output_directory)
1138 {
1139  DBUG("Reading time loop configuration.");
1140 
1141  bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1142  std::begin(_process_variables),
1143  std::end(_process_variables),
1144  [](auto const& process_variable)
1145  { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1146 
1148  config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1149  compensate_non_equilibrium_initial_residuum);
1150 
1151  if (!_time_loop)
1152  {
1153  OGS_FATAL("Initialization of time loop failed.");
1154  }
1155 }
1156 
1158 {
1159  DBUG("Reading linear solver configuration.");
1160 
1162  for (auto conf : config.getConfigSubtreeList("linear_solver"))
1163  {
1165  auto const name = conf.getConfigParameter<std::string>("name");
1166  auto const linear_solver_parser =
1168  auto const solver_options =
1169  linear_solver_parser.parseNameAndOptions("", &conf);
1170 
1173  name,
1174  std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1175  std::get<1>(solver_options)),
1176  "The linear solver name is not unique");
1177  }
1178 }
1179 
1181 {
1182  DBUG("Reading non-linear solver configuration.");
1183 
1185  for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1186  {
1187  auto const ls_name =
1189  conf.getConfigParameter<std::string>("linear_solver");
1190  auto& linear_solver = BaseLib::getOrError(
1191  _linear_solvers, ls_name,
1192  "A linear solver with the given name does not exist.");
1193 
1195  auto const name = conf.getConfigParameter<std::string>("name");
1198  name,
1199  NumLib::createNonlinearSolver(*linear_solver, conf).first,
1200  "The nonlinear solver name is not unique");
1201  }
1202 }
1203 
1204 void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1205 {
1206  if (!config)
1207  {
1208  return;
1209  }
1210 
1211  DBUG("Reading curves configuration.");
1212 
1214  for (auto conf : config->getConfigSubtreeList("curve"))
1215  {
1217  auto const name = conf.getConfigParameter<std::string>("name");
1219  _curves,
1220  name,
1223  "The curve name is not unique.");
1224  }
1225 }
1226 
1227 std::vector<int> splitMaterialIdString(std::string const& material_id_string)
1228 {
1229  auto const material_ids_strings =
1230  BaseLib::splitString(material_id_string, ',');
1231 
1232  std::vector<int> material_ids;
1233  for (auto& mid_str : material_ids_strings)
1234  {
1235  std::size_t num_chars_processed = 0;
1236  int material_id;
1237  try
1238  {
1239  material_id = std::stoi(mid_str, &num_chars_processed);
1240  }
1241  catch (std::invalid_argument&)
1242  {
1243  OGS_FATAL(
1244  "Could not parse material ID from '{}' to a valid "
1245  "integer.",
1246  mid_str);
1247  }
1248  catch (std::out_of_range&)
1249  {
1250  OGS_FATAL(
1251  "Could not parse material ID from '{}'. The integer value "
1252  "of the given string exceeds the permitted range.",
1253  mid_str);
1254  }
1255 
1256  if (num_chars_processed != mid_str.size())
1257  {
1258  // Not the whole string has been parsed. Check the rest.
1259  if (auto const it = std::find_if_not(
1260  begin(mid_str) + num_chars_processed, end(mid_str),
1261  [](unsigned char const c) { return std::isspace(c); });
1262  it != end(mid_str))
1263  {
1264  OGS_FATAL(
1265  "Could not parse material ID from '{}'. Please "
1266  "separate multiple material IDs by comma only. "
1267  "Invalid character: '{}' at position {}.",
1268  mid_str, *it, distance(begin(mid_str), it));
1269  }
1270  }
1271 
1272  material_ids.push_back(material_id);
1273  };
1274 
1275  return material_ids;
1276 }
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(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:34
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:29
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:44
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:39
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:159
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:173
ConfigTree getConfigSubtree(std::string const &root) const
Definition: ConfigTree.cpp:150
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.
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition: Process.h:45
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:137
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:130
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:140
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:128
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:124
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:125
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:143
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:123
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:132
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:135
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:197
std::vector< std::string > splitString(std::string const &str)
Definition: StringTools.cpp:28
constexpr bool any_of(List const &values)
Checks if any of the elements in the given list is true.
Definition: Algorithm.h:325
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 material_id, 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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
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, bool const compensate_non_equilibrium_initial_residuum)
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 &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 PROCESSLIB_EXPORT const std::string zero_parameter_name