OGS
ProjectData.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "ProjectData.h"
5
6#include <pybind11/eval.h>
7
8#include <algorithm>
9#include <boost/algorithm/string/predicate.hpp>
10#include <cctype>
11#include <range/v3/action/sort.hpp>
12#include <range/v3/action/unique.hpp>
13#include <range/v3/algorithm/contains.hpp>
14#include <range/v3/range/conversion.hpp>
15#include <range/v3/view/adjacent_remove_if.hpp>
16#include <set>
17
18#include "BaseLib/Algorithm.h"
19#include "BaseLib/ConfigTree.h"
20#include "BaseLib/FileTools.h"
21#include "BaseLib/Logging.h"
22#include "BaseLib/StringTools.h"
23#include "GeoLib/GEOObjects.h"
26#include "GeoLib/Raster.h"
27#include "InfoLib/CMakeInfo.h"
31#if defined(USE_LIS)
33#elif defined(USE_PETSC)
35#else
37#endif
41#include "MeshLib/Mesh.h"
47
48// FileIO
53#include "ParameterLib/Utils.h"
55#include "ProcessLib/TimeLoop.h"
56
57#ifdef OGS_EMBED_PYTHON_INTERPRETER
59#endif
60
61#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
64#endif
65#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
67#endif
68#ifdef OGS_BUILD_PROCESS_HT
70#endif
71#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
73#endif
74#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
76#endif
77#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
79#endif
80#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
82#endif
83#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
85#endif
86#ifdef OGS_BUILD_PROCESS_LIE_M
88#endif
89#ifdef OGS_BUILD_PROCESS_LIE_HM
91#endif
92#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
94#endif
95#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
97#endif
98
99#ifdef OGS_BUILD_PROCESS_PHASEFIELD
101#endif
102#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
104#endif
105#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
107#endif
108#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
110#endif
111#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
113#endif
114#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
116#endif
117#ifdef OGS_BUILD_PROCESS_TH2M
119#endif
120#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
122#endif
123#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
125#endif
126#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
128#endif
129#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
131#endif
132#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
134#endif
135
136namespace
137{
138void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects,
139 std::string const& dir_first, std::string const& dir_second)
140{
141 DBUG("Reading geometry file '{:s}'.", fname);
142 GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
143 std::string geometry_file = BaseLib::joinPaths(dir_first, fname);
144 if (!BaseLib::IsFileExisting(geometry_file))
145 {
146 // Fallback to reading gml from prj-file directory
147 geometry_file = BaseLib::joinPaths(dir_second, fname);
148 WARN("File {:s} not found in {:s}! Trying reading from {:s}.", fname,
149 dir_first, dir_second);
150 if (!BaseLib::IsFileExisting(geometry_file))
151 {
152 OGS_FATAL("Could not read geometry file {:s} in {:s}.", fname,
153 dir_second);
154 }
155 }
156 gml_reader.readFile(geometry_file);
157}
158
159std::unique_ptr<MeshLib::Mesh> readSingleMesh(
160 BaseLib::ConfigTree const& mesh_config_parameter,
161 std::string const& directory)
162{
163 std::string const mesh_file = BaseLib::joinPaths(
164 directory, mesh_config_parameter.getValue<std::string>());
165 DBUG("Reading mesh file '{:s}'.", mesh_file);
166
167 auto mesh = std::unique_ptr<MeshLib::Mesh>(MeshLib::IO::readMeshFromFile(
168 mesh_file, true /* compute_element_neighbors */));
169 if (!mesh)
170 {
171 std::filesystem::path abspath{mesh_file};
172 try
173 {
174 abspath = std::filesystem::absolute(mesh_file);
175 }
176 catch (std::filesystem::filesystem_error const& e)
177 {
178 ERR("Determining the absolute path of '{}' failed: {}", mesh_file,
179 e.what());
180 }
181
182 OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
183 abspath.string());
184 }
185
186#ifdef DOXYGEN_DOCU_ONLY
188 mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
189#endif // DOXYGEN_DOCU_ONLY
190
191 if (auto const axially_symmetric =
193 mesh_config_parameter.getConfigAttributeOptional<bool>(
194 "axially_symmetric"))
195 {
196 mesh->setAxiallySymmetric(*axially_symmetric);
197 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
198 {
199 OGS_FATAL("3D mesh cannot be axially symmetric.");
200 }
201 }
202
203 return mesh;
204}
205
206std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
207 BaseLib::ConfigTree const& config, std::string const& directory)
208{
209 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
210
211 GeoLib::GEOObjects geoObjects;
212
214 auto optional_meshes = config.getConfigSubtreeOptional("meshes");
215 if (optional_meshes)
216 {
217 DBUG("Reading multiple meshes.");
219 auto const configs = optional_meshes->getConfigParameterList("mesh");
220 std::transform(configs.begin(), configs.end(),
221 std::back_inserter(meshes),
222 [&directory](auto const& mesh_config)
223 { return readSingleMesh(mesh_config, directory); });
224 if (auto const geometry_file_name =
226 config.getConfigParameterOptional<std::string>("geometry"))
227 {
228 readGeometry(*geometry_file_name, geoObjects, directory,
229 config.projectDirectory().string());
230 }
231 }
232 else
233 { // Read single mesh with geometry.
234 meshes.push_back(
236 readSingleMesh(config.getConfigParameter("mesh"), directory));
237
238 auto const geometry_file_name =
240 config.getConfigParameter<std::string>("geometry");
241 readGeometry(geometry_file_name, geoObjects, directory,
242 config.projectDirectory().string());
243 }
244
245 if (!geoObjects.getPoints().empty() || !geoObjects.getPolylines().empty() ||
246 !geoObjects.getSurfaces().empty())
247 { // generate meshes from geometries
248 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
250 bool const multiple_nodes_allowed = false;
251 auto additional_meshes =
253 geoObjects, *meshes[0], std::move(search_length_algorithm),
254 multiple_nodes_allowed);
255
256 std::move(begin(additional_meshes), end(additional_meshes),
257 std::back_inserter(meshes));
258 }
259
260 auto mesh_names = MeshLib::views::names | ranges::to<std::vector>() |
261 ranges::actions::sort;
262 auto const sorted_names = meshes | mesh_names;
263 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
264 if (unique_names.size() < sorted_names.size())
265 {
266 WARN(
267 "Mesh names aren't unique. From project file read mesh names are:");
268 for (auto const& name : meshes | MeshLib::views::names)
269 {
270 INFO("- {}", name);
271 }
272 }
273
274 auto const zero_mesh_field_data_by_material_ids =
276 config.getConfigParameterOptional<std::vector<int>>(
277 "zero_mesh_field_data_by_material_ids");
278 if (zero_mesh_field_data_by_material_ids)
279 {
280 WARN(
281 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
282 "name may be changed, or it may be removed due to its "
283 "corresponding feature becomes a single tool. Please use it with "
284 "care!");
286 *meshes[0], *zero_mesh_field_data_by_material_ids);
287 }
288
290
291 return meshes;
292}
293
294std::vector<GeoLib::NamedRaster> readRasters(
295 BaseLib::ConfigTree const& config,
296 GeoLib::MinMaxPoints const& min_max_points)
297{
298 INFO("readRasters ...");
299 std::vector<GeoLib::NamedRaster> named_rasters;
300
302 auto optional_rasters = config.getConfigSubtreeOptional("rasters");
303 if (optional_rasters)
304 {
306 auto const configs = optional_rasters->getConfigSubtreeList("raster");
307 std::transform(
308 configs.begin(), configs.end(), std::back_inserter(named_rasters),
309 [&min_max_points](auto const& raster_config)
310 { return GeoLib::IO::readRaster(raster_config, min_max_points); });
311 }
312 INFO("readRasters done");
313 return named_rasters;
314}
315
316// for debugging raster reading implementation
317// void writeRasters(std::vector<GeoLib::NamedRaster> const& named_rasters,
318// std::string const& output_directory)
319//{
320// for (auto const& named_raster : named_rasters)
321// {
322// #if defined(USE_PETSC)
323// int my_mpi_rank;
324// MPI_Comm_rank(BaseLib::MPI::OGS_COMM_WORLD, &my_mpi_rank);
325// #endif
326// FileIO::AsciiRasterInterface::writeRasterAsASC(
327// named_raster.raster, output_directory + "/" +
328// named_raster.raster_name +
329// #if defined(USE_PETSC)
330// "_" + std::to_string(my_mpi_rank) +
331// #endif
332// ".asc");
333// }
334//}
335
336} // namespace
337
338ProjectData::ProjectData() = default;
339
341 std::string const& output_directory,
342 std::string const& mesh_directory,
343 [[maybe_unused]] std::string const& script_directory)
344 : _mesh_vec(readMeshes(project_config, mesh_directory)),
345 _named_rasters(readRasters(project_config,
346 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
347 _mesh_vec[0]->getNodes().end())
348 .getMinMaxPoints()))
349{
350 // for debugging raster reading implementation
351 // writeRasters(_named_rasters, output_directory);
352 if (auto const python_script =
354 project_config.getConfigParameterOptional<std::string>("python_script"))
355 {
356 namespace py = pybind11;
357
358#ifdef OGS_EMBED_PYTHON_INTERPRETER
359 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
360 ApplicationsLib::setupEmbeddedPythonVenvPaths();
361#endif
362
363 // Append to python's module search path
364 auto py_path = py::module::import("sys").attr("path");
365 py_path.attr("append")(script_directory); // .prj or -s directory
366
367 auto const script_path =
368 BaseLib::joinPaths(script_directory, *python_script);
369
370 // Evaluate in scope of main module
371 py::object scope = py::module::import("__main__").attr("__dict__");
372 // add (global) variables
373 auto globals = py::dict(scope);
374 globals["ogs_prj_directory"] =
375 project_config.projectDirectory().string();
376 globals["ogs_mesh_directory"] = mesh_directory;
377 globals["ogs_script_directory"] = script_directory;
378 try
379 {
380 py::eval_file(script_path, scope);
381 }
382 catch (py::error_already_set const& e)
383 {
384 OGS_FATAL("Error evaluating python script {}: {}", script_path,
385 e.what());
386 }
387 }
388
390 parseCurves(project_config.getConfigSubtreeOptional("curves"));
391
392 auto parameter_names_for_transformation =
394 parseParameters(project_config.getConfigSubtree("parameters"));
395
396 _local_coordinate_system = ParameterLib::createCoordinateSystem(
398 project_config.getConfigSubtreeOptional("local_coordinate_system"),
399 _parameters);
400
401 for (auto& parameter : _parameters)
402 {
403 if (std::find(begin(parameter_names_for_transformation),
404 end(parameter_names_for_transformation),
405 parameter->name) !=
406 end(parameter_names_for_transformation))
407 {
408 if (!_local_coordinate_system)
409 {
410 OGS_FATAL(
411 "The parameter '{:s}' is using the local coordinate system "
412 "but no local coordinate system was provided.",
413 parameter->name);
414 }
415 parameter->setCoordinateSystem(*_local_coordinate_system);
416 }
417
418 parameter->initialize(_parameters);
419 }
420
422 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
423
425 parseMedia(project_config.getConfigSubtreeOptional("media"));
426
428 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
429
430 auto chemical_solver_interface = parseChemicalSolverInterface(
432 project_config.getConfigSubtreeOptional("chemical_system"),
433 output_directory);
434
436 parseProcesses(project_config.getConfigSubtree("processes"),
437 output_directory,
438 std::move(chemical_solver_interface));
439
441 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
442
444 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
445 output_directory);
446}
447
449 BaseLib::ConfigTree const& process_variables_config)
450{
451 DBUG("Parse process variables:");
452
453 std::set<std::string> names;
454
455 for (auto var_config
457 : process_variables_config.getConfigSubtreeList("process_variable"))
458 {
459 // Either the mesh name is given, or the first mesh's name will be
460 // taken. Taking the first mesh's value is deprecated.
461 auto const mesh_name =
463 var_config.getConfigParameter<std::string>("mesh",
464 _mesh_vec[0]->getName());
465
466 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
467
468 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
470 if (!names.insert(pv.getName()).second)
471 {
472 OGS_FATAL("A process variable with name `{:s}' already exists.",
473 pv.getName());
474 }
475
476 _process_variables.push_back(std::move(pv));
477 }
478}
479
480std::vector<std::string> ProjectData::parseParameters(
481 BaseLib::ConfigTree const& parameters_config)
482{
483 using namespace ProcessLib;
484
485 std::set<std::string> names;
486 std::vector<std::string> parameter_names_for_transformation;
487
488 DBUG("Reading parameters:");
489 for (auto parameter_config :
491 parameters_config.getConfigSubtreeList("parameter"))
492 {
493 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
495 if (!names.insert(p->name).second)
496 {
497 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
498 }
499
500 auto const use_local_coordinate_system =
502 parameter_config.getConfigParameterOptional<bool>(
503 "use_local_coordinate_system");
504 if (!!use_local_coordinate_system && *use_local_coordinate_system)
505 {
506 parameter_names_for_transformation.push_back(p->name);
507 }
508
509 _parameters.push_back(std::move(p));
510 }
511
512 _parameters.push_back(
515 _parameters.push_back(
518
519 return parameter_names_for_transformation;
520}
521
523 std::optional<BaseLib::ConfigTree> const& media_config)
524{
525 if (!media_config)
526 {
527 return;
528 }
529
530 DBUG("Reading media:");
531
532 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
533 {
534 ERR("A mesh is required to define medium materials.");
535 return;
536 }
537
538 for (auto const& medium_config :
540 media_config->getConfigSubtreeList("medium"))
541 {
542 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
543 &medium_config, this](int const id)
544 {
546 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
548 _curves);
549 };
550
551 auto const material_id_string =
553 medium_config.getConfigAttribute<std::string>("id", "0");
554
555 std::vector<int> const material_ids_of_this_medium =
556 MaterialLib::parseMaterialIdString(material_id_string,
557 materialIDs(*_mesh_vec[0]));
558
559 for (auto const& id : material_ids_of_this_medium)
560 {
562 id, _media, material_ids_of_this_medium, create_medium);
563 }
564 }
565
566 if (_media.empty())
567 {
568 OGS_FATAL("No entity is found inside <media>.");
569 }
570}
571
572std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
574 std::optional<BaseLib::ConfigTree> const& config,
575 std::string const& output_directory)
576{
577 if (!config)
578 {
579 return nullptr;
580 }
581
582 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
583 chemical_solver_interface;
584#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
585 INFO(
586 "Ready for initializing interface to a chemical solver for water "
587 "chemistry calculation.");
588
589 auto const chemical_solver =
591 config->getConfigAttribute<std::string>("chemical_solver");
592
593 if (boost::iequals(chemical_solver, "Phreeqc"))
594 {
595 INFO(
596 "Configuring phreeqc interface for water chemistry calculation "
597 "using file-based approach.");
598
599 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
601 *config, output_directory);
602 }
603 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
604 {
605 OGS_FATAL(
606 "The chemical solver option of PhreeqcKernel is not accessible for "
607 "the time being. Please set 'Phreeqc'' as the chemical solver for "
608 "reactive transport modeling.");
609 }
610 else if (boost::iequals(chemical_solver, "SelfContained"))
611 {
612 INFO(
613 "Use self-contained chemical solver for water chemistry "
614 "calculation.");
615
616 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
618 _mesh_vec, _linear_solvers, *config, output_directory);
619 }
620 else
621 {
622 OGS_FATAL(
623 "Unknown chemical solver. Please specify either Phreeqc or "
624 "PhreeqcKernel as the solver for water chemistry calculation "
625 "instead.");
626 }
627#else
628 (void)output_directory;
629
630 OGS_FATAL(
631 "Found the type of the process to be solved is not component transport "
632 "process. Please specify the process type to ComponentTransport. At "
633 "the present, water chemistry calculation is only available for "
634 "component transport process.");
635#endif
636 return chemical_solver_interface;
637}
638
640 BaseLib::ConfigTree const& processes_config,
641 std::string const& output_directory,
642 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
643 chemical_solver_interface)
644{
645 (void)output_directory; // to avoid compilation warning
646
647 DBUG("Reading processes:");
649 for (auto process_config : processes_config.getConfigSubtreeList("process"))
650 {
651 auto const type =
653 process_config.peekConfigParameter<std::string>("type");
654
655 auto const name =
657 process_config.getConfigParameter<std::string>("name");
658
659 [[maybe_unused]] auto const integration_order =
661 process_config.getConfigParameter<int>("integration_order");
662
663 std::unique_ptr<ProcessLib::Process> process;
664
665 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
667 process_config.getConfigSubtreeOptional("jacobian_assembler"));
668
669#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
670 if (type == "STEADY_STATE_DIFFUSION")
671 {
672 // The existence check of the in the configuration referenced
673 // process variables is checked in the physical process.
674 // TODO at the moment we have only one mesh, later there can be
675 // several meshes. Then we have to assign the referenced mesh
676 // here.
677 process =
679 name, *_mesh_vec[0], std::move(jacobian_assembler),
680 _process_variables, _parameters, integration_order,
681 process_config, _mesh_vec, _media);
682 }
683 else
684#endif
685#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
686 if (type == "LIQUID_FLOW")
687 {
689 name, *_mesh_vec[0], std::move(jacobian_assembler),
690 _process_variables, _parameters, integration_order,
691 process_config, _mesh_vec, _media);
692 }
693 else
694#endif
695#ifdef OGS_BUILD_PROCESS_TH2M
696 if (type == "TH2M")
697 {
698 switch (_mesh_vec[0]->getDimension())
699 {
700 case 2:
702 name, *_mesh_vec[0], std::move(jacobian_assembler),
704 _local_coordinate_system, integration_order,
705 process_config, _media);
706 break;
707 case 3:
709 name, *_mesh_vec[0], std::move(jacobian_assembler),
711 _local_coordinate_system, integration_order,
712 process_config, _media);
713 break;
714 default:
715 OGS_FATAL("TH2M process does not support given dimension");
716 }
717 }
718 else
719#endif
720#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
721 if (type == "HEAT_CONDUCTION")
722 {
724 name, *_mesh_vec[0], std::move(jacobian_assembler),
725 _process_variables, _parameters, integration_order,
726 process_config, _media);
727 }
728 else
729#endif
730#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
731 if (type == "HEAT_TRANSPORT_BHE")
732 {
733 if (_mesh_vec[0]->getDimension() != 3)
734 {
735 OGS_FATAL(
736 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
737 "mesh! ");
738 }
739
740 process =
742 name, *_mesh_vec[0], std::move(jacobian_assembler),
743 _process_variables, _parameters, integration_order,
744 process_config, _curves, _media);
745 }
746 else
747#endif
748#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
749 if (type == "WELLBORE_SIMULATOR")
750 {
751 if (_mesh_vec[0]->getDimension() != 1)
752 {
753 OGS_FATAL(
754 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
755 "mesh!");
756 }
757
758 process =
760 name, *_mesh_vec[0], std::move(jacobian_assembler),
761 _process_variables, _parameters, integration_order,
762 process_config, _media);
763 }
764 else
765#endif
766#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
767 if (type == "HYDRO_MECHANICS")
768 {
769 if (
770 process_config.getConfigParameterOptional<int>("dimension"))
771 {
772 OGS_FATAL(
773 "The 'dimension' tag has been removed in the merge-request "
774 "!4766. The dimension is now taken from the main mesh and "
775 "the tag must be removed. There is a python script in the "
776 "merge-request description for automatic conversion.");
777 }
778 switch (_mesh_vec[0]->getDimension())
779 {
780 case 2:
781 process =
783 2>(name, *_mesh_vec[0],
784 std::move(jacobian_assembler),
786 _local_coordinate_system, integration_order,
787 process_config, _media);
788 break;
789 case 3:
790 process =
792 3>(name, *_mesh_vec[0],
793 std::move(jacobian_assembler),
795 _local_coordinate_system, integration_order,
796 process_config, _media);
797 break;
798 default:
799 OGS_FATAL(
800 "HYDRO_MECHANICS process does not support given "
801 "dimension");
802 }
803 }
804 else
805#endif
806#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
807 if (type == "LARGE_DEFORMATION")
808 {
809 switch (_mesh_vec[0]->getDimension())
810 {
811 case 2:
814 name, *_mesh_vec[0], std::move(jacobian_assembler),
816 _local_coordinate_system, integration_order,
817 process_config, _media);
818 break;
819 case 3:
822 name, *_mesh_vec[0], std::move(jacobian_assembler),
824 _local_coordinate_system, integration_order,
825 process_config, _media);
826 break;
827 default:
828 OGS_FATAL(
829 "LARGE_DEFORMATION process does not support given "
830 "dimension");
831 }
832 }
833 else
834#endif
835#ifdef OGS_BUILD_PROCESS_LIE_HM
836 if (type == "HYDRO_MECHANICS_WITH_LIE")
837 {
838 if (
839 process_config.getConfigParameterOptional<int>("dimension"))
840 {
841 OGS_FATAL(
842 "The 'dimension' tag has been removed in the merge-request "
843 "!4766."
844 "The dimension is now taken from the main mesh and the tag "
845 "must be"
846 "removed. There is a python script in the merge-request "
847 "description"
848 "for automatic conversion.");
849 }
850 switch (_mesh_vec[0]->getDimension())
851 {
852 case 2:
855 name, *_mesh_vec[0], std::move(jacobian_assembler),
857 _local_coordinate_system, integration_order,
858 process_config, _media);
859 break;
860 case 3:
863 name, *_mesh_vec[0], std::move(jacobian_assembler),
865 _local_coordinate_system, integration_order,
866 process_config, _media);
867 break;
868 default:
869 OGS_FATAL(
870 "HYDRO_MECHANICS_WITH_LIE process does not support "
871 "given dimension");
872 }
873 }
874 else
875#endif
876#ifdef OGS_BUILD_PROCESS_HT
877 if (type == "HT")
878 {
880 name, *_mesh_vec[0], std::move(jacobian_assembler),
881 _process_variables, _parameters, integration_order,
882 process_config, _mesh_vec, _media);
883 }
884 else
885#endif
886#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
887 if (type == "ComponentTransport")
888 {
889 process =
891 name, *_mesh_vec[0], std::move(jacobian_assembler),
892 _process_variables, _parameters, integration_order,
893 process_config, _mesh_vec, _media,
894 std::move(chemical_solver_interface));
895 }
896 else
897#endif
898#ifdef OGS_BUILD_PROCESS_PHASEFIELD
899 if (type == "PHASE_FIELD")
900 {
901 switch (_mesh_vec[0]->getDimension())
902 {
903 case 2:
904 process =
906 name, *_mesh_vec[0], std::move(jacobian_assembler),
908 _local_coordinate_system, integration_order,
909 process_config);
910 break;
911 case 3:
912 process =
914 name, *_mesh_vec[0], std::move(jacobian_assembler),
916 _local_coordinate_system, integration_order,
917 process_config);
918 break;
919 }
920 }
921 else
922#endif
923#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
924 if (type == "HM_PHASE_FIELD")
925 {
926 switch (_mesh_vec[0]->getDimension())
927 {
928 case 2:
929 process =
931 name, *_mesh_vec[0], std::move(jacobian_assembler),
933 _local_coordinate_system, integration_order,
934 process_config, _media);
935 break;
936 case 3:
937 process =
939 name, *_mesh_vec[0], std::move(jacobian_assembler),
941 _local_coordinate_system, integration_order,
942 process_config, _media);
943 break;
944 }
945 }
946 else
947#endif
948#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
949 if (type == "RichardsComponentTransport")
950 {
953 name, *_mesh_vec[0], std::move(jacobian_assembler),
954 _process_variables, _parameters, integration_order,
955 process_config, _media);
956 }
957 else
958#endif
959#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
960 if (type == "SMALL_DEFORMATION")
961 {
962 switch (_mesh_vec[0]->getDimension())
963 {
964 case 2:
967 name, *_mesh_vec[0], std::move(jacobian_assembler),
969 _local_coordinate_system, integration_order,
970 process_config, _media);
971 break;
972 case 3:
975 name, *_mesh_vec[0], std::move(jacobian_assembler),
977 _local_coordinate_system, integration_order,
978 process_config, _media);
979 break;
980 default:
981 OGS_FATAL(
982 "SMALL_DEFORMATION process does not support given "
983 "dimension");
984 }
985 }
986 else
987#endif
988#ifdef OGS_BUILD_PROCESS_LIE_M
989 if (type == "SMALL_DEFORMATION_WITH_LIE")
990 {
991 if (
992 process_config.getConfigParameterOptional<int>("dimension"))
993 {
994 OGS_FATAL(
995 "The 'dimension' tag has been removed in the merge-request "
996 "!4766."
997 "The dimension is now taken from the main mesh and the tag "
998 "must be"
999 "removed. There is a python script in the merge-request "
1000 "description"
1001 "for automatic conversion.");
1002 }
1003 switch (_mesh_vec[0]->getDimension())
1004 {
1005 case 2:
1008 name, *_mesh_vec[0], std::move(jacobian_assembler),
1010 _local_coordinate_system, integration_order,
1011 process_config);
1012 break;
1013 case 3:
1016 name, *_mesh_vec[0], std::move(jacobian_assembler),
1018 _local_coordinate_system, integration_order,
1019 process_config);
1020 break;
1021 default:
1022 OGS_FATAL(
1023 "SMALL_DEFORMATION_WITH_LIE process does not support "
1024 "given dimension");
1025 }
1026 }
1027 else
1028#endif
1029#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1030 if (type == "THERMO_HYDRO_MECHANICS")
1031 {
1032 if (
1033 process_config.getConfigParameterOptional<int>("dimension"))
1034 {
1035 OGS_FATAL(
1036 "The 'dimension' tag has been removed in the merge-request "
1037 "!4766."
1038 "The dimension is now taken from the main mesh and the tag "
1039 "must be"
1040 "removed. There is a python script in the merge-request "
1041 "description"
1042 "for automatic conversion.");
1043 }
1044 switch (_mesh_vec[0]->getDimension())
1045 {
1046 case 2:
1049 name, *_mesh_vec[0], std::move(jacobian_assembler),
1051 _local_coordinate_system, integration_order,
1052 process_config, _media);
1053 break;
1054 case 3:
1057 name, *_mesh_vec[0], std::move(jacobian_assembler),
1059 _local_coordinate_system, integration_order,
1060 process_config, _media);
1061 break;
1062 default:
1063 OGS_FATAL(
1064 "THERMO_HYDRO_MECHANICS process does not support given "
1065 "dimension");
1066 }
1067 }
1068 else
1069#endif
1070#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1071 if (type == "THERMO_MECHANICS")
1072 {
1073 switch (_mesh_vec[0]->getDimension())
1074 {
1075 case 2:
1078 name, *_mesh_vec[0], std::move(jacobian_assembler),
1080 _local_coordinate_system, integration_order,
1081 process_config, _media);
1082 break;
1083 case 3:
1086 name, *_mesh_vec[0], std::move(jacobian_assembler),
1088 _local_coordinate_system, integration_order,
1089 process_config, _media);
1090 break;
1091 }
1092 }
1093 else
1094#endif
1095#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1096 if (type == "RICHARDS_FLOW")
1097 {
1099 name, *_mesh_vec[0], std::move(jacobian_assembler),
1100 _process_variables, _parameters, integration_order,
1101 process_config, _media);
1102 }
1103 else
1104#endif
1105#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1106 if (type == "RICHARDS_MECHANICS")
1107 {
1108 if (
1109 process_config.getConfigParameterOptional<int>("dimension"))
1110 {
1111 OGS_FATAL(
1112 "The 'dimension' tag has been removed in the merge-request "
1113 "!4766."
1114 "The dimension is now taken from the main mesh and the tag "
1115 "must be"
1116 "removed. There is a python script in the merge-request "
1117 "description"
1118 "for automatic conversion.");
1119 }
1120 switch (_mesh_vec[0]->getDimension())
1121 {
1122 case 2:
1125 name, *_mesh_vec[0], std::move(jacobian_assembler),
1127 _local_coordinate_system, integration_order,
1128 process_config, _media);
1129 break;
1130 case 3:
1133 name, *_mesh_vec[0], std::move(jacobian_assembler),
1135 _local_coordinate_system, integration_order,
1136 process_config, _media);
1137 break;
1138 }
1139 }
1140 else
1141#endif
1142#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1143 if (type == "THERMO_RICHARDS_FLOW")
1144 {
1145 process =
1147 name, *_mesh_vec[0], std::move(jacobian_assembler),
1148 _process_variables, _parameters, integration_order,
1149 process_config, _media);
1150 }
1151 else
1152#endif
1153#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1154 if (type == "THERMO_RICHARDS_MECHANICS")
1155 {
1156 switch (_mesh_vec[0]->getDimension())
1157 {
1158 case 2:
1161 name, *_mesh_vec[0], std::move(jacobian_assembler),
1163 _local_coordinate_system, integration_order,
1164 process_config, _media);
1165 break;
1166 case 3:
1169 name, *_mesh_vec[0], std::move(jacobian_assembler),
1171 _local_coordinate_system, integration_order,
1172 process_config, _media);
1173 break;
1174 }
1175 }
1176 else
1177#endif
1178
1179#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1180 if (type == "TWOPHASE_FLOW_PP")
1181 {
1182 process =
1184 name, *_mesh_vec[0], std::move(jacobian_assembler),
1185 _process_variables, _parameters, integration_order,
1186 process_config, _media);
1187 }
1188 else
1189#endif
1190#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1191 if (type == "THERMAL_TWOPHASE_WITH_PP")
1192 {
1195 name, *_mesh_vec[0], std::move(jacobian_assembler),
1196 _process_variables, _parameters, integration_order,
1197 process_config, _media);
1198 }
1199 else
1200#endif
1201 {
1202 OGS_FATAL("Unknown process type: {:s}", type);
1203 }
1204
1205 if (ranges::contains(_processes, name,
1206 [](std::unique_ptr<ProcessLib::Process> const& p)
1207 { return p->name; }))
1208 {
1209 OGS_FATAL("The process name '{:s}' is not unique.", name);
1210 }
1211 _processes.push_back(std::move(process));
1212 }
1213}
1214
1216 std::string const& output_directory)
1217{
1218 DBUG("Reading time loop configuration.");
1219
1220 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1221 std::begin(_process_variables),
1222 std::end(_process_variables),
1223 [](auto const& process_variable)
1224 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1225
1227 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1228 compensate_non_equilibrium_initial_residuum);
1229
1230 if (!_time_loop)
1231 {
1232 OGS_FATAL("Initialization of time loop failed.");
1233 }
1234}
1235
1237{
1238 DBUG("Reading linear solver configuration.");
1239
1241 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1242 {
1244 auto const name = conf.getConfigParameter<std::string>("name");
1245 auto const linear_solver_parser =
1247 auto const solver_options =
1248 linear_solver_parser.parseNameAndOptions("", &conf);
1249
1252 name,
1253 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1254 std::get<1>(solver_options)),
1255 "The linear solver name is not unique");
1256 }
1257}
1258
1260{
1261 DBUG("Reading non-linear solver configuration.");
1262
1264 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1265 {
1266 auto const ls_name =
1268 conf.getConfigParameter<std::string>("linear_solver");
1269 auto const& linear_solver = BaseLib::getOrError(
1270 _linear_solvers, ls_name,
1271 "A linear solver with the given name does not exist.");
1272
1274 auto const name = conf.getConfigParameter<std::string>("name");
1277 name,
1278 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1279 "The nonlinear solver name is not unique");
1280 }
1281}
1282
1283void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1284{
1285 if (!config)
1286 {
1287 return;
1288 }
1289
1290 DBUG("Reading curves configuration.");
1291
1293 for (auto conf : config->getConfigSubtreeList("curve"))
1294 {
1296 auto const name = conf.getConfigParameter<std::string>("name");
1298 _curves,
1299 name,
1302 "The curve name is not unique.");
1303 }
1304}
1305
1306MeshLib::Mesh& ProjectData::getMesh(std::string const& mesh_name) const
1307{
1308 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1309}
1310
1311std::vector<std::string> ProjectData::getMeshNames() const
1312{
1313 return _mesh_vec | MeshLib::views::names | ranges::to<std::vector>;
1314}
Chemical-solver interface used in OGS operator-split reactive transport.
#define OGS_FATAL(...)
Definition Error.h:19
std::vector< std::size_t > getNodes(GeoLib::Point const &pnt, std::vector< MeshLib::Node * > const &nodes, MeshLib::PropertyVector< int > const &mat_ids, std::pair< int, int > const &mat_limits, std::pair< double, double > const &elevation_limits, MeshLib::Mesh const &mesh)
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:28
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:34
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
std::filesystem::path projectDirectory() const
std::optional< T > getConfigParameterOptional(std::string const &param) const
T getConfigParameter(std::string const &param) const
Range< SubtreeIterator > getConfigSubtreeList(std::string const &root) const
std::optional< T > getConfigAttributeOptional(std::string const &attr) const
Container class for geometric objects.
Definition GEOObjects.h:46
std::vector< PolylineVec * > const & getPolylines() const
Read access to polylines w/o using a name.
Definition GEOObjects.h:288
std::vector< PointVec * > const & getPoints() const
Read access to points w/o using a name.
Definition GEOObjects.h:286
std::vector< SurfaceVec * > const & getSurfaces() const
Read access to surfaces w/o using a name.
Definition GEOObjects.h:290
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:40
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
MeshLib::Mesh & getMesh(std::string const &mesh_name) const
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)
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
std::vector< GeoLib::NamedRaster > _named_rasters
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
std::vector< std::string > getMeshNames() const
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
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.
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)
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition Algorithm.h:97
bool IsFileExisting(const std::string &strFilename)
Returns true if given file exists.
Definition FileTools.cpp:23
std::string joinPaths(std::string const &pathA, std::string const &pathB)
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:111
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)
void createMediumForId(int const id, std::map< int, std::shared_ptr< T > > &media, std::vector< int > const &material_ids_of_this_medium, CreateMedium &&create_medium)
std::vector< int > parseMaterialIdString(std::string const &material_id_string, MeshLib::PropertyVector< int > const *const material_ids)
std::unique_ptr< Medium > createMedium(int const material_id, int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
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, bool const compute_element_neighbors)
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:220
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
Definition Mesh.cpp:354
void setMeshSpaceDimension(std::vector< std::unique_ptr< Mesh > > const &meshes)
void zeroMeshFieldDataByMaterialIDs(MeshLib::Mesh &mesh, std::vector< int > const &selected_material_ids)
std::optional< ParameterLib::CoordinateSystem > createCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< ParameterBase > createParameter(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< GeoLib::NamedRaster > const &named_rasters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< Process > createComponentTransportProcess(std::string const &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)
template std::unique_ptr< Process > createHMPhaseFieldProcess< 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 > createHMPhaseFieldProcess< 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 > createHTProcess(std::string const &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 const &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 const &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 const &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 const &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< 3 >(std::string const &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 > createSmallDeformationProcess< 2 >(std::string const &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 const &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 > createLargeDeformationProcess< 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 > createLargeDeformationProcess< 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)
std::unique_ptr< Process > createLiquidFlowProcess(std::string const &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 const &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 const &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 const &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 const &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 > createRichardsMechanicsProcess< 3 >(std::string const &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< 2 >(std::string const &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 > createSmallDeformationProcess< 3 >(std::string const &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 > createSmallDeformationProcess< 2 >(std::string const &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 > createSteadyStateDiffusion(std::string const &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 > createTH2MProcess< 3 >(std::string const &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 const &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 const &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 > createThermoHydroMechanicsProcess< 2 >(std::string const &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 const &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< 3 >(std::string const &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 const &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 const &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 const &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 const &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 const &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 > createWellboreSimulatorProcess(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< 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 > > &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::vector< GeoLib::NamedRaster > readRasters(BaseLib::ConfigTree const &config, GeoLib::MinMaxPoints const &min_max_points)
std::vector< std::unique_ptr< MeshLib::Mesh > > readMeshes(BaseLib::ConfigTree const &config, std::string const &directory)
void readGeometry(std::string const &fname, GeoLib::GEOObjects &geo_objects, std::string const &dir_first, std::string const &dir_second)
std::unique_ptr< MeshLib::Mesh > readSingleMesh(BaseLib::ConfigTree const &mesh_config_parameter, std::string const &directory)
Single, constant value parameter.
static PROCESSLIB_EXPORT const std::string zero_parameter_name