OGS  v6.4.0
ProjectData.cpp
Go to the documentation of this file.
1 
14 #include "ProjectData.h"
15 
16 #include <algorithm>
17 #include <cctype>
18 #include <set>
19 
20 #ifdef OGS_USE_PYTHON
21 #include <pybind11/eval.h>
22 #endif
23 
24 #include "BaseLib/Algorithm.h"
25 #include "BaseLib/ConfigTree.h"
26 #include "BaseLib/FileTools.h"
27 #include "BaseLib/Logging.h"
28 #include "BaseLib/StringTools.h"
29 #include "GeoLib/GEOObjects.h"
30 #include "InfoLib/CMakeInfo.h"
36 #include "MeshLib/Mesh.h"
40 
41 // FileIO
44 
46 #include "ParameterLib/Utils.h"
48 #include "ProcessLib/TimeLoop.h"
49 
50 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
53 #endif
54 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
56 #endif
57 #ifdef OGS_BUILD_PROCESS_HT
59 #endif
60 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
62 #endif
63 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
65 #endif
66 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
68 #endif
69 #ifdef OGS_BUILD_PROCESS_LIE
72 #endif
73 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
75 #endif
76 
77 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
79 #endif
80 
81 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
83 #endif
84 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
86 #endif
87 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
89 #endif
90 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
92 #endif
93 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
95 #endif
96 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
98 #endif
99 #ifdef OGS_BUILD_PROCESS_TES
101 #endif
102 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
104 #endif
105 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
107 #endif
108 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
110 #endif
111 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
113 #endif
114 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
116 #endif
117 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
119 #endif
120 
121 namespace
122 {
123 void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects)
124 {
125  DBUG("Reading geometry file '{:s}'.", fname);
126  GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
127  gml_reader.readFile(fname);
128 }
129 
130 std::unique_ptr<MeshLib::Mesh> readSingleMesh(
131  BaseLib::ConfigTree const& mesh_config_parameter,
132  std::string const& project_directory)
133 {
134  std::string const mesh_file = BaseLib::copyPathToFileName(
135  mesh_config_parameter.getValue<std::string>(), project_directory);
136  DBUG("Reading mesh file '{:s}'.", mesh_file);
137 
138  auto mesh = std::unique_ptr<MeshLib::Mesh>(
139  MeshLib::IO::readMeshFromFile(mesh_file));
140  if (!mesh)
141  {
142  OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
143  mesh_file);
144  }
145 
146 #ifdef DOXYGEN_DOCU_ONLY
148  mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
149 #endif // DOXYGEN_DOCU_ONLY
150 
151  if (auto const axially_symmetric =
153  mesh_config_parameter.getConfigAttributeOptional<bool>(
154  "axially_symmetric"))
155  {
156  mesh->setAxiallySymmetric(*axially_symmetric);
157  }
158 
159  return mesh;
160 }
161 
162 std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
163  BaseLib::ConfigTree const& config, std::string const& project_directory)
164 {
165  std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
166 
168  auto optional_meshes = config.getConfigSubtreeOptional("meshes");
169  if (optional_meshes)
170  {
171  DBUG("Reading multiple meshes.");
173  auto const configs = optional_meshes->getConfigParameterList("mesh");
174  std::transform(
175  configs.begin(), configs.end(), std::back_inserter(meshes),
176  [&project_directory](auto const& mesh_config) {
177  return readSingleMesh(mesh_config, project_directory);
178  });
179  }
180  else
181  { // Read single mesh with geometry.
182  WARN(
183  "Consider switching from mesh and geometry input to multiple "
184  "meshes input. See "
185  "https://www.opengeosys.org/docs/tools/model-preparation/"
186  "constructmeshesfromgeometry/ tool for conversion.");
188  meshes.push_back(readSingleMesh(config.getConfigParameter("mesh"),
190 
191  std::string const geometry_file = BaseLib::copyPathToFileName(
193  config.getConfigParameter<std::string>("geometry"),
195  GeoLib::GEOObjects geoObjects;
196  readGeometry(geometry_file, geoObjects);
197 
198  std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
200  bool const multiple_nodes_allowed = false;
201  auto additional_meshes =
203  geoObjects, *meshes[0], std::move(search_length_algorithm),
204  multiple_nodes_allowed);
205 
206  std::move(begin(additional_meshes), end(additional_meshes),
207  std::back_inserter(meshes));
208  }
209  return meshes;
210 }
211 
212 std::optional<ParameterLib::CoordinateSystem> parseLocalCoordinateSystem(
213  std::optional<BaseLib::ConfigTree> const& config,
214  std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
215 {
216  if (!config)
217  {
218  return {};
219  }
220 
221  DBUG("Reading coordinate system configuration.");
222 
223  //
224  // Fetch the first basis vector; its length defines the dimension.
225  //
226  auto const& basis_vector_0 = ParameterLib::findParameter<double>(
227  *config,
229  "basis_vector_0", parameters, 0 /* any dimension */);
230  int const dimension = basis_vector_0.getNumberOfGlobalComponents();
231 
232  // check dimension
233  if (dimension != 2 && dimension != 3)
234  {
235  OGS_FATAL(
236  "Basis vector parameter '{:s}' must have two or three components, "
237  "but it has {:d}.",
238  basis_vector_0.name, dimension);
239  }
240 
241  //
242  // Fetch the second basis vector, which must be of the same dimension as the
243  // first one.
244  //
245  auto const& basis_vector_1 = ParameterLib::findParameter<double>(
246  *config,
248  "basis_vector_1", parameters, dimension);
249 
250  //
251  // For two dimensions, we are done; construct coordinate system;
252  //
253  if (dimension == 2)
254  {
255  return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1};
256  }
257 
258  //
259  // Parse the third vector, for three dimensions.
260  //
261  auto const& basis_vector_2 = ParameterLib::findParameter<double>(
262  *config,
264  "basis_vector_2", parameters, dimension);
265  return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1,
266  basis_vector_2};
267 }
268 } // namespace
269 
270 ProjectData::ProjectData() = default;
271 
273  std::string const& project_directory,
274  std::string const& output_directory)
275  : _mesh_vec(readMeshes(project_config, project_directory))
276 {
277  if (auto const python_script =
279  project_config.getConfigParameterOptional<std::string>("python_script"))
280  {
281 #ifdef OGS_USE_PYTHON
282  namespace py = pybind11;
283 
284  // Append to python's module search path
285  auto py_path = py::module::import("sys").attr("path");
286  py_path.attr("append")(project_directory); // .prj directory
287  // virtualenv
288  py_path.attr("append")(
289  CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
290 
291  auto const script_path =
293 
294  // Evaluate in scope of main module
295  py::object scope = py::module::import("__main__").attr("__dict__");
296  // add (global) variables
297  auto globals = py::dict(scope);
298  globals["ogs_prj_directory"] = project_directory;
299  py::eval_file(script_path, scope);
300 #else
301  OGS_FATAL("OpenGeoSys has not been built with Python support.");
302 #endif // OGS_USE_PYTHON
303  }
304 
306  parseCurves(project_config.getConfigSubtreeOptional("curves"));
307 
308  auto parameter_names_for_transformation =
310  parseParameters(project_config.getConfigSubtree("parameters"));
311 
314  project_config.getConfigSubtreeOptional("local_coordinate_system"),
315  _parameters);
316 
317  for (auto& parameter : _parameters)
318  {
319  if (std::find(begin(parameter_names_for_transformation),
320  end(parameter_names_for_transformation),
321  parameter->name) !=
322  end(parameter_names_for_transformation))
323  {
325  {
326  OGS_FATAL(
327  "The parameter '{:s}' is using the local coordinate system "
328  "but no local coordinate system was provided.",
329  parameter->name);
330  }
331  parameter->setCoordinateSystem(*_local_coordinate_system);
332  }
333 
334  parameter->initialize(_parameters);
335  }
336 
338  parseProcessVariables(project_config.getConfigSubtree("process_variables"));
339 
341  parseMedia(project_config.getConfigSubtreeOptional("media"));
342 
343  auto chemical_solver_interface = parseChemicalSolverInterface(
345  project_config.getConfigSubtreeOptional("chemical_system"),
346  output_directory);
347 
349  parseProcesses(project_config.getConfigSubtree("processes"),
350  project_directory, output_directory,
351  std::move(chemical_solver_interface));
352 
354  parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
355 
357  parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
358 
360  parseTimeLoop(project_config.getConfigSubtree("time_loop"),
361  output_directory);
362 }
363 
365  BaseLib::ConfigTree const& process_variables_config)
366 {
367  DBUG("Parse process variables:");
368 
369  std::set<std::string> names;
370 
371  for (auto var_config
373  : process_variables_config.getConfigSubtreeList("process_variable"))
374  {
375  // Either the mesh name is given, or the first mesh's name will be
376  // taken. Taking the first mesh's value is deprecated.
377  auto const mesh_name =
379  var_config.getConfigParameter<std::string>("mesh",
380  _mesh_vec[0]->getName());
381 
382  auto& mesh = *BaseLib::findElementOrError(
383  begin(_mesh_vec), end(_mesh_vec),
384  [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
385  "Expected to find a mesh named " + mesh_name + ".");
386 
387  auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
389  if (!names.insert(pv.getName()).second)
390  {
391  OGS_FATAL("A process variable with name `{:s}' already exists.",
392  pv.getName());
393  }
394 
395  _process_variables.push_back(std::move(pv));
396  }
397 }
398 
399 std::vector<std::string> ProjectData::parseParameters(
400  BaseLib::ConfigTree const& parameters_config)
401 {
402  using namespace ProcessLib;
403 
404  std::set<std::string> names;
405  std::vector<std::string> parameter_names_for_transformation;
406 
407  DBUG("Reading parameters:");
408  for (auto parameter_config :
410  parameters_config.getConfigSubtreeList("parameter"))
411  {
412  auto p =
413  ParameterLib::createParameter(parameter_config, _mesh_vec, _curves);
414  if (!names.insert(p->name).second)
415  {
416  OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
417  }
418 
419  auto const use_local_coordinate_system =
421  parameter_config.getConfigParameterOptional<bool>(
422  "use_local_coordinate_system");
423  if (!!use_local_coordinate_system && *use_local_coordinate_system)
424  {
425  parameter_names_for_transformation.push_back(p->name);
426  }
427 
428  _parameters.push_back(std::move(p));
429  }
430 
431  _parameters.push_back(
432  std::make_unique<ParameterLib::ConstantParameter<double>>(
434 
435  return parameter_names_for_transformation;
436 }
437 
439  std::optional<BaseLib::ConfigTree> const& media_config)
440 {
441  if (!media_config)
442  {
443  return;
444  }
445 
446  DBUG("Reading media:");
447 
448  if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
449  {
450  ERR("A mesh is required to define medium materials.");
451  return;
452  }
453 
454  for (auto const& medium_config :
456  media_config->getConfigSubtreeList("medium"))
457  {
458  auto material_id_string =
460  medium_config.getConfigAttribute<std::string>("id", "0");
461  material_id_string.erase(
462  remove_if(begin(material_id_string), end(material_id_string),
463  [](unsigned char const c) { return std::isspace(c); }),
464  end(material_id_string));
465  auto const material_ids_strings =
466  BaseLib::splitString(material_id_string, ',');
467 
468  // Convert strings to ints;
469  std::vector<int> material_ids;
470  std::transform(
471  begin(material_ids_strings), end(material_ids_strings),
472  std::back_inserter(material_ids), [](std::string const& m_id) {
473  if (auto const it = std::find_if_not(
474  begin(m_id), end(m_id),
475  [](unsigned char const c) { return std::isdigit(c); });
476  it != end(m_id))
477  {
478  OGS_FATAL(
479  "Could not parse material ID's from '{:s}'. Please "
480  "separate multiple material ID's by comma only. "
481  "Invalid character: '%c'",
482  m_id, *it);
483  }
484  return std::stoi(m_id);
485  });
486 
487  for (auto const& id : material_ids)
488  {
489  if (_media.find(id) != end(_media))
490  {
491  OGS_FATAL(
492  "Multiple media were specified for the same material id "
493  "'{:d}'. "
494  "Keep in mind, that if no material id is specified, it is "
495  "assumed to be 0 by default.",
496  id);
497  }
498 
499  _media[id] =
500  (id == material_ids[0])
502  _mesh_vec[0]->getDimension(), medium_config,
503  _parameters,
505  : nullptr,
506  _curves)
507  : _media[material_ids[0]];
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 "
542  "calculation using file-based approach.");
543 
544  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
546  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 "
552  "for the time being. Please set 'Phreeqc'' as the chemical "
553  "solver for reactive transport modeling.");
554  }
555  else
556  {
557  OGS_FATAL(
558  "Unknown chemical solver. Please specify either Phreeqc or "
559  "PhreeqcKernel as the solver for water chemistry calculation "
560  "instead.");
561  }
562 #else
563  (void)output_directory;
564 
565  OGS_FATAL(
566  "Found the type of the process to be solved is not component transport "
567  "process. Please specify the process type to ComponentTransport. At "
568  "the present, water chemistry calculation is only available for "
569  "component transport process.");
570 #endif
571  return chemical_solver_interface;
572 }
573 
575  BaseLib::ConfigTree const& processes_config,
576  std::string const& project_directory,
577  std::string const& output_directory,
578  [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
579  chemical_solver_interface)
580 {
581  (void)project_directory; // to avoid compilation warning
582  (void)output_directory; // to avoid compilation warning
583 
584  DBUG("Reading processes:");
586  for (auto process_config : processes_config.getConfigSubtreeList("process"))
587  {
588  auto const type =
590  process_config.peekConfigParameter<std::string>("type");
591 
592  auto const name =
594  process_config.getConfigParameter<std::string>("name");
595 
596  auto const integration_order =
598  process_config.getConfigParameter<int>("integration_order");
599 
600  std::unique_ptr<ProcessLib::Process> process;
601 
602  auto jacobian_assembler = ProcessLib::createJacobianAssembler(
604  process_config.getConfigSubtreeOptional("jacobian_assembler"));
605 
606 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
607  if (type == "STEADY_STATE_DIFFUSION")
608  {
609  // The existence check of the in the configuration referenced
610  // process variables is checked in the physical process.
611  // TODO at the moment we have only one mesh, later there can be
612  // several meshes. Then we have to assign the referenced mesh
613  // here.
614  process =
616  name, *_mesh_vec[0], std::move(jacobian_assembler),
617  _process_variables, _parameters, integration_order,
618  process_config, _mesh_vec, _media);
619  }
620  else
621 #endif
622 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
623  if (type == "LIQUID_FLOW")
624  {
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_TES
633  if (type == "TES")
634  {
636  name, *_mesh_vec[0], std::move(jacobian_assembler),
637  _process_variables, _parameters, integration_order,
638  process_config);
639  }
640  else
641 #endif
642 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
643  if (type == "HEAT_CONDUCTION")
644  {
646  name, *_mesh_vec[0], std::move(jacobian_assembler),
647  _process_variables, _parameters, integration_order,
648  process_config, _media);
649  }
650  else
651 #endif
652 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
653  if (type == "HEAT_TRANSPORT_BHE")
654  {
655  if (_mesh_vec[0]->getDimension() != 3)
656  {
657  OGS_FATAL(
658  "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
659  "mesh! ");
660  }
661 
662  process =
664  name, *_mesh_vec[0], std::move(jacobian_assembler),
665  _process_variables, _parameters, integration_order,
666  process_config, _curves, _media);
667  }
668  else
669 #endif
670 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
671  if (type == "HYDRO_MECHANICS")
672  {
674  switch (process_config.getConfigParameter<int>("dimension"))
675  {
676  case 2:
677  process =
679  2>(name, *_mesh_vec[0],
680  std::move(jacobian_assembler),
682  _local_coordinate_system, integration_order,
683  process_config, _media);
684  break;
685  case 3:
686  process =
688  3>(name, *_mesh_vec[0],
689  std::move(jacobian_assembler),
691  _local_coordinate_system, integration_order,
692  process_config, _media);
693  break;
694  default:
695  OGS_FATAL(
696  "HYDRO_MECHANICS process does not support given "
697  "dimension");
698  }
699  }
700  else
701 #endif
702 #ifdef OGS_BUILD_PROCESS_LIE
703  if (type == "HYDRO_MECHANICS_WITH_LIE")
704  {
706  switch (process_config.getConfigParameter<int>("dimension"))
707  {
708  case 2:
711  name, *_mesh_vec[0], std::move(jacobian_assembler),
713  _local_coordinate_system, integration_order,
714  process_config);
715  break;
716  case 3:
719  name, *_mesh_vec[0], std::move(jacobian_assembler),
721  _local_coordinate_system, integration_order,
722  process_config);
723  break;
724  default:
725  OGS_FATAL(
726  "HYDRO_MECHANICS_WITH_LIE process does not support "
727  "given dimension");
728  }
729  }
730  else
731 #endif
732 #ifdef OGS_BUILD_PROCESS_HT
733  if (type == "HT")
734  {
736  name, *_mesh_vec[0], std::move(jacobian_assembler),
737  _process_variables, _parameters, integration_order,
738  process_config, _mesh_vec, _media);
739  }
740  else
741 #endif
742 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
743  if (type == "ComponentTransport")
744  {
745  process =
747  name, *_mesh_vec[0], std::move(jacobian_assembler),
748  _process_variables, _parameters, integration_order,
749  process_config, _mesh_vec, _media,
750  std::move(chemical_solver_interface));
751  }
752  else
753 #endif
754 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
755  if (type == "PHASE_FIELD")
756  {
757  switch (_mesh_vec[0]->getDimension())
758  {
759  case 2:
760  process =
762  name, *_mesh_vec[0], std::move(jacobian_assembler),
764  _local_coordinate_system, integration_order,
765  process_config);
766  break;
767  case 3:
768  process =
770  name, *_mesh_vec[0], std::move(jacobian_assembler),
772  _local_coordinate_system, integration_order,
773  process_config);
774  break;
775  }
776  }
777  else
778 #endif
779 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
780  if (type == "RichardsComponentTransport")
781  {
784  name, *_mesh_vec[0], std::move(jacobian_assembler),
785  _process_variables, _parameters, integration_order,
786  process_config);
787  }
788  else
789 #endif
790 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
791  if (type == "SMALL_DEFORMATION")
792  {
793  switch (_mesh_vec[0]->getDimension())
794  {
795  case 2:
798  name, *_mesh_vec[0], std::move(jacobian_assembler),
800  _local_coordinate_system, integration_order,
801  process_config);
802  break;
803  case 3:
806  name, *_mesh_vec[0], std::move(jacobian_assembler),
808  _local_coordinate_system, integration_order,
809  process_config);
810  break;
811  default:
812  OGS_FATAL(
813  "SMALL_DEFORMATION process does not support "
814  "given dimension");
815  }
816  }
817  else
818 #endif
819 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
820  if (type == "SMALL_DEFORMATION_NONLOCAL")
821  {
822  switch (_mesh_vec[0]->getDimension())
823  {
824  case 2:
827  name, *_mesh_vec[0], std::move(jacobian_assembler),
829  _local_coordinate_system, integration_order,
830  process_config);
831  break;
832  case 3:
835  name, *_mesh_vec[0], std::move(jacobian_assembler),
837  _local_coordinate_system, integration_order,
838  process_config);
839  break;
840  default:
841  OGS_FATAL(
842  "SMALL_DEFORMATION_NONLOCAL process does not support "
843  "given dimension {:d}",
844  _mesh_vec[0]->getDimension());
845  }
846  }
847  else
848 #endif
849 #ifdef OGS_BUILD_PROCESS_LIE
850  if (type == "SMALL_DEFORMATION_WITH_LIE")
851  {
853  switch (process_config.getConfigParameter<int>("dimension"))
854  {
855  case 2:
858  name, *_mesh_vec[0], std::move(jacobian_assembler),
860  _local_coordinate_system, integration_order,
861  process_config);
862  break;
863  case 3:
866  name, *_mesh_vec[0], std::move(jacobian_assembler),
868  _local_coordinate_system, integration_order,
869  process_config);
870  break;
871  default:
872  OGS_FATAL(
873  "SMALL_DEFORMATION_WITH_LIE process does not support "
874  "given dimension");
875  }
876  }
877  else
878 #endif
879 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
880  if (type == "THERMO_HYDRO_MECHANICS")
881  {
883  switch (process_config.getConfigParameter<int>("dimension"))
884  {
885  case 2:
888  name, *_mesh_vec[0], std::move(jacobian_assembler),
890  _local_coordinate_system, integration_order,
891  process_config, _media);
892  break;
893  case 3:
896  name, *_mesh_vec[0], std::move(jacobian_assembler),
898  _local_coordinate_system, integration_order,
899  process_config, _media);
900  break;
901  default:
902  OGS_FATAL(
903  "THERMO_HYDRO_MECHANICS process does not support given "
904  "dimension");
905  }
906  }
907  else
908 #endif
909 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
910  if (type == "THERMO_MECHANICAL_PHASE_FIELD")
911  {
912  switch (_mesh_vec[0]->getDimension())
913  {
914  case 2:
917  name, *_mesh_vec[0], std::move(jacobian_assembler),
919  _local_coordinate_system, integration_order,
920  process_config);
921  break;
922  case 3:
925  name, *_mesh_vec[0], std::move(jacobian_assembler),
927  _local_coordinate_system, integration_order,
928  process_config);
929  break;
930  }
931  }
932  else
933 #endif
934 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
935  if (type == "THERMO_MECHANICS")
936  {
937  switch (_mesh_vec[0]->getDimension())
938  {
939  case 2:
942  name, *_mesh_vec[0], std::move(jacobian_assembler),
944  _local_coordinate_system, integration_order,
945  process_config, _media);
946  break;
947  case 3:
950  name, *_mesh_vec[0], std::move(jacobian_assembler),
952  _local_coordinate_system, integration_order,
953  process_config, _media);
954  break;
955  }
956  }
957  else
958 #endif
959 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
960  if (type == "RICHARDS_FLOW")
961  {
963  name, *_mesh_vec[0], std::move(jacobian_assembler),
964  _process_variables, _parameters, integration_order,
965  process_config, _curves, _media);
966  }
967  else
968 #endif
969 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
970  if (type == "RICHARDS_MECHANICS")
971  {
973  switch (process_config.getConfigParameter<int>("dimension"))
974  {
975  case 2:
978  name, *_mesh_vec[0], std::move(jacobian_assembler),
980  _local_coordinate_system, integration_order,
981  process_config, _media);
982  break;
983  case 3:
986  name, *_mesh_vec[0], std::move(jacobian_assembler),
988  _local_coordinate_system, integration_order,
989  process_config, _media);
990  break;
991  }
992  }
993  else
994 #endif
995 
996 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
997  if (type == "THERMO_RICHARDS_MECHANICS")
998  {
999  switch (_mesh_vec[0]->getDimension())
1000  {
1001  case 2:
1004  name, *_mesh_vec[0], std::move(jacobian_assembler),
1006  _local_coordinate_system, integration_order,
1007  process_config, _media);
1008  break;
1009  case 3:
1012  name, *_mesh_vec[0], std::move(jacobian_assembler),
1014  _local_coordinate_system, integration_order,
1015  process_config, _media);
1016  break;
1017  }
1018  }
1019  else
1020 #endif
1021 
1022 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1023  if (type == "TWOPHASE_FLOW_PP")
1024  {
1025  process =
1027  name, *_mesh_vec[0], std::move(jacobian_assembler),
1028  _process_variables, _parameters, integration_order,
1029  process_config, _curves, _media);
1030  }
1031  else
1032 #endif
1033 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1034  if (type == "TWOPHASE_FLOW_PRHO")
1035  {
1038  name, *_mesh_vec[0], std::move(jacobian_assembler),
1039  _process_variables, _parameters, integration_order,
1040  process_config, _curves);
1041  }
1042  else
1043 #endif
1044 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1045  if (type == "THERMAL_TWOPHASE_WITH_PP")
1046  {
1049  name, *_mesh_vec[0], std::move(jacobian_assembler),
1050  _process_variables, _parameters, integration_order,
1051  process_config, _curves);
1052  }
1053  else
1054 #endif
1055  {
1056  OGS_FATAL("Unknown process type: {:s}", type);
1057  }
1058 
1059  if (BaseLib::containsIf(
1060  _processes,
1061  [&name](std::unique_ptr<ProcessLib::Process> const& p) {
1062  return p->name == name;
1063  }))
1064  {
1065  OGS_FATAL("The process name '{:s}' is not unique.", name);
1066  }
1067  _processes.push_back(std::move(process));
1068  }
1069 }
1070 
1072  std::string const& output_directory)
1073 {
1074  DBUG("Reading time loop configuration.");
1075 
1077  config, output_directory, _processes, _nonlinear_solvers, _mesh_vec);
1078 
1079  if (!_time_loop)
1080  {
1081  OGS_FATAL("Initialization of time loop failed.");
1082  }
1083 }
1084 
1086 {
1087  DBUG("Reading linear solver configuration.");
1088 
1090  for (auto conf : config.getConfigSubtreeList("linear_solver"))
1091  {
1093  auto const name = conf.getConfigParameter<std::string>("name");
1096  name,
1097  std::make_unique<GlobalLinearSolver>("", &conf),
1098  "The linear solver name is not unique");
1099  }
1100 }
1101 
1103 {
1104  DBUG("Reading linear solver configuration.");
1105 
1107  for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1108  {
1109  auto const ls_name =
1111  conf.getConfigParameter<std::string>("linear_solver");
1112  auto& linear_solver = BaseLib::getOrError(
1113  _linear_solvers, ls_name,
1114  "A linear solver with the given name does not exist.");
1115 
1117  auto const name = conf.getConfigParameter<std::string>("name");
1120  name,
1121  NumLib::createNonlinearSolver(*linear_solver, conf).first,
1122  "The nonlinear solver name is not unique");
1123  }
1124 }
1125 
1126 void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1127 {
1128  if (!config)
1129  {
1130  return;
1131  }
1132 
1133  DBUG("Reading curves configuration.");
1134 
1136  for (auto conf : config->getConfigSubtreeList("curve"))
1137  {
1139  auto const name = conf.getConfigParameter<std::string>("name");
1141  _curves,
1142  name,
1145  "The curve name is not unique.");
1146  }
1147 }
Definition of the BoostXmlGmlInterface class.
Functionality to build different search length algorithm objects from given config.
#define OGS_FATAL(...)
Definition: Error.h:25
Filename manipulation routines.
Definition of the GEOObjects class.
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
void ERR(char const *fmt, Args const &... args)
Definition: Logging.h:42
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
void WARN(char const *fmt, Args const &... args)
Definition: Logging.h:37
Definition of the Mesh class.
Base class for different search length strategies.
Definition of string helper functions.
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
Definition: ConfigTree.cpp:160
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:176
ConfigTree getConfigSubtree(std::string const &root) const
Definition: ConfigTree.cpp:152
std::optional< T > getConfigAttributeOptional(std::string const &attr) const
Container class for geometric objects.
Definition: GEOObjects.h:64
bool readFile(const std::string &fname) override
Reads an xml-file containing OGS geometry.
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:136
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:129
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:139
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &project_directory, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > parseChemicalSolverInterface(std::optional< BaseLib::ConfigTree > const &config, const std::string &output_directory)
void parseMedia(std::optional< BaseLib::ConfigTree > const &media_config)
Parses media configuration and saves them in an object.
void parseLinearSolvers(BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
Definition: ProjectData.h:127
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:123
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:124
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:142
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:122
void parseTimeLoop(BaseLib::ConfigTree const &config, const std::string &output_directory)
Parses the time loop configuration.
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > _media
Definition: ProjectData.h:131
std::vector< std::string > parseParameters(BaseLib::ConfigTree const &parameters_config)
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project's processes.
Definition: ProjectData.h:134
std::unique_ptr< GeoLib::GEOObjects > readGeometry(std::string const &filename)
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > readMeshes(std::vector< std::string > const &filenames)
Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition: Algorithm.h:149
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition: Algorithm.h:107
bool containsIf(Container const &container, Predicate &&predicate)
Definition: Algorithm.h:266
std::string copyPathToFileName(const std::string &file_name, const std::string &source)
Definition: FileTools.cpp:191
std::vector< std::string > splitString(std::string const &str)
Definition: StringTools.cpp:28
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
Definition: Algorithm.h:70
std::unique_ptr< ChemicalSolverInterface > createChemicalSolverInterface(std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, BaseLib::ConfigTree const &config, std::string const &output_directory)
std::unique_ptr< Medium > createMedium(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
static const double p
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)
std::unique_ptr< MeshGeoToolsLib::SearchLength > createSearchLengthAlgorithm(BaseLib::ConfigTree const &external_config, MeshLib::Mesh const &mesh)
std::vector< std::unique_ptr< MeshLib::Mesh > > constructAdditionalMeshesFromGeoObjects(GeoLib::GEOObjects const &geo_objects, MeshLib::Mesh const &mesh, std::unique_ptr< SearchLength > search_length_algorithm, bool const multiple_nodes_allowed)
MeshLib::Mesh * readMeshFromFile(const std::string &file_name)
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::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)
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)
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)
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