OGS
ProjectData.cpp
Go to the documentation of this file.
1
15#include "ProjectData.h"
16
17#include <pybind11/eval.h>
18
19#include <algorithm>
20#include <boost/algorithm/string/predicate.hpp>
21#include <cctype>
22#include <range/v3/action/sort.hpp>
23#include <range/v3/action/unique.hpp>
24#include <range/v3/algorithm/contains.hpp>
25#include <range/v3/range/conversion.hpp>
26#include <range/v3/view/adjacent_remove_if.hpp>
27#include <set>
28
29#include "BaseLib/Algorithm.h"
30#include "BaseLib/ConfigTree.h"
31#include "BaseLib/FileTools.h"
32#include "BaseLib/Logging.h"
33#include "BaseLib/StringTools.h"
34#include "GeoLib/GEOObjects.h"
37#include "GeoLib/Raster.h"
38#include "InfoLib/CMakeInfo.h"
42#if defined(USE_LIS)
44#elif defined(USE_PETSC)
46#else
48#endif
52#include "MeshLib/Mesh.h"
58
59// FileIO
64#include "ParameterLib/Utils.h"
66#include "ProcessLib/TimeLoop.h"
67
68#ifdef OGS_EMBED_PYTHON_INTERPRETER
70#endif
71
72#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
75#endif
76#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
78#endif
79#ifdef OGS_BUILD_PROCESS_HT
81#endif
82#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
84#endif
85#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
87#endif
88#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
90#endif
91#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
93#endif
94#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
96#endif
97#ifdef OGS_BUILD_PROCESS_LIE_M
99#endif
100#ifdef OGS_BUILD_PROCESS_LIE_HM
102#endif
103#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
105#endif
106#ifdef OGS_BUILD_PROCESS_STOKESFLOW
108#endif
109
110#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
112#endif
113
114#ifdef OGS_BUILD_PROCESS_PHASEFIELD
116#endif
117#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
119#endif
120#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
122#endif
123#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
125#endif
126#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
128#endif
129#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
131#endif
132#ifdef OGS_BUILD_PROCESS_TES
134#endif
135#ifdef OGS_BUILD_PROCESS_TH2M
137#endif
138#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
140#endif
141#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
143#endif
144#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
146#endif
147#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
149#endif
150#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
152#endif
153#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
155#endif
156#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
158#endif
159
160namespace
161{
162void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects,
163 std::string const& dir_first, std::string const& dir_second)
164{
165 DBUG("Reading geometry file '{:s}'.", fname);
166 GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
167 std::string geometry_file = BaseLib::joinPaths(dir_first, fname);
168 if (!BaseLib::IsFileExisting(geometry_file))
169 {
170 // Fallback to reading gml from prj-file directory
171 geometry_file = BaseLib::joinPaths(dir_second, fname);
172 WARN("File {:s} not found in {:s}! Trying reading from {:s}.", fname,
173 dir_first, dir_second);
174 if (!BaseLib::IsFileExisting(geometry_file))
175 {
176 OGS_FATAL("Could not read geometry file {:s} in {:s}.", fname,
177 dir_second);
178 }
179 }
180 gml_reader.readFile(geometry_file);
181}
182
183std::unique_ptr<MeshLib::Mesh> readSingleMesh(
184 BaseLib::ConfigTree const& mesh_config_parameter,
185 std::string const& directory)
186{
187 std::string const mesh_file = BaseLib::joinPaths(
188 directory, mesh_config_parameter.getValue<std::string>());
189 DBUG("Reading mesh file '{:s}'.", mesh_file);
190
191 auto mesh = std::unique_ptr<MeshLib::Mesh>(MeshLib::IO::readMeshFromFile(
192 mesh_file, true /* compute_element_neighbors */));
193 if (!mesh)
194 {
195 std::filesystem::path abspath{mesh_file};
196 try
197 {
198 abspath = std::filesystem::absolute(mesh_file);
199 }
200 catch (std::filesystem::filesystem_error const& e)
201 {
202 ERR("Determining the absolute path of '{}' failed: {}", mesh_file,
203 e.what());
204 }
205
206 OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
207 abspath.string());
208 }
209
210#ifdef DOXYGEN_DOCU_ONLY
212 mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
213#endif // DOXYGEN_DOCU_ONLY
214
215 if (auto const axially_symmetric =
217 mesh_config_parameter.getConfigAttributeOptional<bool>(
218 "axially_symmetric"))
219 {
220 mesh->setAxiallySymmetric(*axially_symmetric);
221 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
222 {
223 OGS_FATAL("3D mesh cannot be axially symmetric.");
224 }
225 }
226
227 return mesh;
228}
229
230std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
231 BaseLib::ConfigTree const& config, std::string const& directory,
232 std::string const& project_directory)
233{
234 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
235
236 GeoLib::GEOObjects geoObjects;
237
239 auto optional_meshes = config.getConfigSubtreeOptional("meshes");
240 if (optional_meshes)
241 {
242 DBUG("Reading multiple meshes.");
244 auto const configs = optional_meshes->getConfigParameterList("mesh");
245 std::transform(configs.begin(), configs.end(),
246 std::back_inserter(meshes),
247 [&directory](auto const& mesh_config)
248 { return readSingleMesh(mesh_config, directory); });
249 if (auto const geometry_file_name =
251 config.getConfigParameterOptional<std::string>("geometry"))
252 {
253 readGeometry(*geometry_file_name, geoObjects, directory,
254 project_directory);
255 }
256 }
257 else
258 { // Read single mesh with geometry.
259 meshes.push_back(
261 readSingleMesh(config.getConfigParameter("mesh"), directory));
262
263 auto const geometry_file_name =
265 config.getConfigParameter<std::string>("geometry");
266 readGeometry(geometry_file_name, geoObjects, directory,
267 project_directory);
268 }
269
270 { // generate meshes from geometries
271 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
273 bool const multiple_nodes_allowed = false;
274 auto additional_meshes =
276 geoObjects, *meshes[0], std::move(search_length_algorithm),
277 multiple_nodes_allowed);
278
279 std::move(begin(additional_meshes), end(additional_meshes),
280 std::back_inserter(meshes));
281 }
282
283 auto mesh_names = MeshLib::views::names | ranges::to<std::vector>() |
284 ranges::actions::sort;
285 auto const sorted_names = meshes | mesh_names;
286 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
287 if (unique_names.size() < sorted_names.size())
288 {
289 WARN(
290 "Mesh names aren't unique. From project file read mesh names are:");
291 for (auto const& name : meshes | MeshLib::views::names)
292 {
293 INFO("- {}", name);
294 }
295 }
296
297 auto const zero_mesh_field_data_by_material_ids =
299 config.getConfigParameterOptional<std::vector<int>>(
300 "zero_mesh_field_data_by_material_ids");
301 if (zero_mesh_field_data_by_material_ids)
302 {
303 WARN(
304 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
305 "name may be changed, or it may be removed due to its "
306 "corresponding feature becomes a single tool. Please use it with "
307 "care!");
309 *meshes[0], *zero_mesh_field_data_by_material_ids);
310 }
311
313
314 return meshes;
315}
316
317std::vector<GeoLib::NamedRaster> readRasters(
318 BaseLib::ConfigTree const& config, std::string const& raster_directory,
319 GeoLib::MinMaxPoints const& min_max_points)
320{
321 INFO("readRasters ...");
322 std::vector<GeoLib::NamedRaster> named_rasters;
323
325 auto optional_rasters = config.getConfigSubtreeOptional("rasters");
326 if (optional_rasters)
327 {
329 auto const configs = optional_rasters->getConfigSubtreeList("raster");
330 std::transform(
331 configs.begin(), configs.end(), std::back_inserter(named_rasters),
332 [&raster_directory, &min_max_points](auto const& raster_config)
333 {
334 return GeoLib::IO::readRaster(raster_config, raster_directory,
335 min_max_points);
336 });
337 }
338 INFO("readRasters done");
339 return named_rasters;
340}
341
342// for debugging raster reading implementation
343// void writeRasters(std::vector<GeoLib::NamedRaster> const& named_rasters,
344// std::string const& output_directory)
345//{
346// for (auto const& named_raster : named_rasters)
347// {
348// #if defined(USE_PETSC)
349// int my_mpi_rank;
350// MPI_Comm_rank(MPI_COMM_WORLD, &my_mpi_rank);
351// #endif
352// FileIO::AsciiRasterInterface::writeRasterAsASC(
353// named_raster.raster, output_directory + "/" +
354// named_raster.raster_name +
355// #if defined(USE_PETSC)
356// "_" + std::to_string(my_mpi_rank) +
357// #endif
358// ".asc");
359// }
360//}
361
362} // namespace
363
364ProjectData::ProjectData() = default;
365
367 std::string const& project_directory,
368 std::string const& output_directory,
369 std::string const& mesh_directory,
370 [[maybe_unused]] std::string const& script_directory)
371 : _mesh_vec(readMeshes(project_config, mesh_directory, project_directory)),
372 _named_rasters(readRasters(project_config, project_directory,
373 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
374 _mesh_vec[0]->getNodes().end())
375 .getMinMaxPoints()))
376{
377 // for debugging raster reading implementation
378 // writeRasters(_named_rasters, output_directory);
379 if (auto const python_script =
381 project_config.getConfigParameterOptional<std::string>("python_script"))
382 {
383 namespace py = pybind11;
384
385#ifdef OGS_EMBED_PYTHON_INTERPRETER
386 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
387#endif
388
389 // Append to python's module search path
390 auto py_path = py::module::import("sys").attr("path");
391 py_path.attr("append")(script_directory); // .prj or -s directory
392
393 auto const script_path =
394 BaseLib::joinPaths(script_directory, *python_script);
395
396 // Evaluate in scope of main module
397 py::object scope = py::module::import("__main__").attr("__dict__");
398 // add (global) variables
399 auto globals = py::dict(scope);
400 globals["ogs_prj_directory"] = project_directory;
401 globals["ogs_mesh_directory"] = mesh_directory;
402 globals["ogs_script_directory"] = script_directory;
403 try
404 {
405 py::eval_file(script_path, scope);
406 }
407 catch (py::error_already_set const& e)
408 {
409 OGS_FATAL("Error evaluating python script {}: {}", script_path,
410 e.what());
411 }
412 }
413
415 parseCurves(project_config.getConfigSubtreeOptional("curves"));
416
417 auto parameter_names_for_transformation =
419 parseParameters(project_config.getConfigSubtree("parameters"));
420
423 project_config.getConfigSubtreeOptional("local_coordinate_system"),
425
426 for (auto& parameter : _parameters)
427 {
428 if (std::find(begin(parameter_names_for_transformation),
429 end(parameter_names_for_transformation),
430 parameter->name) !=
431 end(parameter_names_for_transformation))
432 {
434 {
435 OGS_FATAL(
436 "The parameter '{:s}' is using the local coordinate system "
437 "but no local coordinate system was provided.",
438 parameter->name);
439 }
440 parameter->setCoordinateSystem(*_local_coordinate_system);
441 }
442
443 parameter->initialize(_parameters);
444 }
445
447 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
448
450 parseMedia(project_config.getConfigSubtreeOptional("media"));
451
453 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
454
455 auto chemical_solver_interface = parseChemicalSolverInterface(
457 project_config.getConfigSubtreeOptional("chemical_system"),
458 output_directory);
459
461 parseProcesses(project_config.getConfigSubtree("processes"),
462 project_directory, output_directory,
463 std::move(chemical_solver_interface));
464
466 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
467
469 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
470 output_directory);
471}
472
474 BaseLib::ConfigTree const& process_variables_config)
475{
476 DBUG("Parse process variables:");
477
478 std::set<std::string> names;
479
480 for (auto var_config
482 : process_variables_config.getConfigSubtreeList("process_variable"))
483 {
484 // Either the mesh name is given, or the first mesh's name will be
485 // taken. Taking the first mesh's value is deprecated.
486 auto const mesh_name =
488 var_config.getConfigParameter<std::string>("mesh",
489 _mesh_vec[0]->getName());
490
491 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
492
493 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
495 if (!names.insert(pv.getName()).second)
496 {
497 OGS_FATAL("A process variable with name `{:s}' already exists.",
498 pv.getName());
499 }
500
501 _process_variables.push_back(std::move(pv));
502 }
503}
504
505std::vector<std::string> ProjectData::parseParameters(
506 BaseLib::ConfigTree const& parameters_config)
507{
508 using namespace ProcessLib;
509
510 std::set<std::string> names;
511 std::vector<std::string> parameter_names_for_transformation;
512
513 DBUG("Reading parameters:");
514 for (auto parameter_config :
516 parameters_config.getConfigSubtreeList("parameter"))
517 {
518 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
520 if (!names.insert(p->name).second)
521 {
522 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
523 }
524
525 auto const use_local_coordinate_system =
527 parameter_config.getConfigParameterOptional<bool>(
528 "use_local_coordinate_system");
529 if (!!use_local_coordinate_system && *use_local_coordinate_system)
530 {
531 parameter_names_for_transformation.push_back(p->name);
532 }
533
534 _parameters.push_back(std::move(p));
535 }
536
537 _parameters.push_back(
540 _parameters.push_back(
543
544 return parameter_names_for_transformation;
545}
546
548 std::optional<BaseLib::ConfigTree> const& media_config)
549{
550 if (!media_config)
551 {
552 return;
553 }
554
555 DBUG("Reading media:");
556
557 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
558 {
559 ERR("A mesh is required to define medium materials.");
560 return;
561 }
562
563 for (auto const& medium_config :
565 media_config->getConfigSubtreeList("medium"))
566 {
567 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
568 &medium_config, this](int const id)
569 {
571 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
573 _curves);
574 };
575
576 auto const material_id_string =
578 medium_config.getConfigAttribute<std::string>("id", "0");
579
580 std::vector<int> const material_ids_of_this_medium =
581 MaterialLib::parseMaterialIdString(material_id_string,
582 materialIDs(*_mesh_vec[0]));
583
584 for (auto const& id : material_ids_of_this_medium)
585 {
587 id, _media, material_ids_of_this_medium, create_medium);
588 }
589 }
590
591 if (_media.empty())
592 {
593 OGS_FATAL("No entity is found inside <media>.");
594 }
595}
596
597std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
599 std::optional<BaseLib::ConfigTree> const& config,
600 std::string const& output_directory)
601{
602 if (!config)
603 {
604 return nullptr;
605 }
606
607 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
608 chemical_solver_interface;
609#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
610 INFO(
611 "Ready for initializing interface to a chemical solver for water "
612 "chemistry calculation.");
613
614 auto const chemical_solver =
616 config->getConfigAttribute<std::string>("chemical_solver");
617
618 if (boost::iequals(chemical_solver, "Phreeqc"))
619 {
620 INFO(
621 "Configuring phreeqc interface for water chemistry calculation "
622 "using file-based approach.");
623
624 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
626 *config, output_directory);
627 }
628 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
629 {
630 OGS_FATAL(
631 "The chemical solver option of PhreeqcKernel is not accessible for "
632 "the time being. Please set 'Phreeqc'' as the chemical solver for "
633 "reactive transport modeling.");
634 }
635 else if (boost::iequals(chemical_solver, "SelfContained"))
636 {
637 INFO(
638 "Use self-contained chemical solver for water chemistry "
639 "calculation.");
640
641 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
643 _mesh_vec, _linear_solvers, *config, output_directory);
644 }
645 else
646 {
647 OGS_FATAL(
648 "Unknown chemical solver. Please specify either Phreeqc or "
649 "PhreeqcKernel as the solver for water chemistry calculation "
650 "instead.");
651 }
652#else
653 (void)output_directory;
654
655 OGS_FATAL(
656 "Found the type of the process to be solved is not component transport "
657 "process. Please specify the process type to ComponentTransport. At "
658 "the present, water chemistry calculation is only available for "
659 "component transport process.");
660#endif
661 return chemical_solver_interface;
662}
663
665 BaseLib::ConfigTree const& processes_config,
666 std::string const& project_directory,
667 std::string const& output_directory,
668 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
669 chemical_solver_interface)
670{
671 (void)project_directory; // to avoid compilation warning
672 (void)output_directory; // to avoid compilation warning
673
674 DBUG("Reading processes:");
676 for (auto process_config : processes_config.getConfigSubtreeList("process"))
677 {
678 auto const type =
680 process_config.peekConfigParameter<std::string>("type");
681
682 auto const name =
684 process_config.getConfigParameter<std::string>("name");
685
686 [[maybe_unused]] auto const integration_order =
688 process_config.getConfigParameter<int>("integration_order");
689
690 std::unique_ptr<ProcessLib::Process> process;
691
692 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
694 process_config.getConfigSubtreeOptional("jacobian_assembler"));
695
696#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
697 if (type == "STEADY_STATE_DIFFUSION")
698 {
699 // The existence check of the in the configuration referenced
700 // process variables is checked in the physical process.
701 // TODO at the moment we have only one mesh, later there can be
702 // several meshes. Then we have to assign the referenced mesh
703 // here.
704 process =
706 name, *_mesh_vec[0], std::move(jacobian_assembler),
707 _process_variables, _parameters, integration_order,
708 process_config, _mesh_vec, _media);
709 }
710 else
711#endif
712#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
713 if (type == "LIQUID_FLOW")
714 {
716 name, *_mesh_vec[0], std::move(jacobian_assembler),
717 _process_variables, _parameters, integration_order,
718 process_config, _mesh_vec, _media);
719 }
720 else
721#endif
722#ifdef OGS_BUILD_PROCESS_STOKESFLOW
723 if (type == "StokesFlow")
724 {
725 WARN(
726 "The StokesFlow process is deprecated and will be removed in "
727 "OGS-6.5.5.");
728 switch (_mesh_vec[0]->getDimension())
729 {
730 case 2:
731 process =
733 name, *_mesh_vec[0], std::move(jacobian_assembler),
734 _process_variables, _parameters, integration_order,
735 process_config, _media);
736 break;
737 default:
738 OGS_FATAL(
739 "StokesFlow process does not support given "
740 "dimension {:d}",
741 _mesh_vec[0]->getDimension());
742 }
743 }
744 else
745#endif
746#ifdef OGS_BUILD_PROCESS_TES
747 if (type == "TES")
748 {
749 WARN(
750 "The TES process is deprecated and will be removed in "
751 "OGS-6.5.5.");
753 name, *_mesh_vec[0], std::move(jacobian_assembler),
754 _process_variables, _parameters, integration_order,
755 process_config);
756 }
757 else
758#endif
759#ifdef OGS_BUILD_PROCESS_TH2M
760 if (type == "TH2M")
761 {
762 switch (_mesh_vec[0]->getDimension())
763 {
764 case 2:
766 name, *_mesh_vec[0], std::move(jacobian_assembler),
768 _local_coordinate_system, integration_order,
769 process_config, _media);
770 break;
771 case 3:
773 name, *_mesh_vec[0], std::move(jacobian_assembler),
775 _local_coordinate_system, integration_order,
776 process_config, _media);
777 break;
778 default:
779 OGS_FATAL("TH2M process does not support given dimension");
780 }
781 }
782 else
783#endif
784#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
785 if (type == "HEAT_CONDUCTION")
786 {
788 name, *_mesh_vec[0], std::move(jacobian_assembler),
789 _process_variables, _parameters, integration_order,
790 process_config, _media);
791 }
792 else
793#endif
794#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
795 if (type == "HEAT_TRANSPORT_BHE")
796 {
797 if (_mesh_vec[0]->getDimension() != 3)
798 {
799 OGS_FATAL(
800 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
801 "mesh! ");
802 }
803
804 process =
806 name, *_mesh_vec[0], std::move(jacobian_assembler),
807 _process_variables, _parameters, integration_order,
808 process_config, _curves, _media);
809 }
810 else
811#endif
812#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
813 if (type == "WELLBORE_SIMULATOR")
814 {
815 if (_mesh_vec[0]->getDimension() != 1)
816 {
817 OGS_FATAL(
818 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
819 "mesh!");
820 }
821
822 process =
824 name, *_mesh_vec[0], std::move(jacobian_assembler),
825 _process_variables, _parameters, integration_order,
826 process_config, _media);
827 }
828 else
829#endif
830#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
831 if (type == "HYDRO_MECHANICS")
832 {
833 if (
834 process_config.getConfigParameterOptional<int>("dimension"))
835 {
836 OGS_FATAL(
837 "The 'dimension' tag has been removed in the merge-request "
838 "!4766."
839 "The dimension is now taken from the main mesh and the tag "
840 "must be"
841 "removed. There is a python script in the merge-request "
842 "description"
843 "for automatic conversion.");
844 }
845 switch (_mesh_vec[0]->getDimension())
846 {
847 case 2:
848 process =
850 2>(name, *_mesh_vec[0],
851 std::move(jacobian_assembler),
853 _local_coordinate_system, integration_order,
854 process_config, _media);
855 break;
856 case 3:
857 process =
859 3>(name, *_mesh_vec[0],
860 std::move(jacobian_assembler),
862 _local_coordinate_system, integration_order,
863 process_config, _media);
864 break;
865 default:
866 OGS_FATAL(
867 "HYDRO_MECHANICS process does not support given "
868 "dimension");
869 }
870 }
871 else
872#endif
873#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
874 if (type == "LARGE_DEFORMATION")
875 {
876 switch (_mesh_vec[0]->getDimension())
877 {
878 case 2:
881 name, *_mesh_vec[0], std::move(jacobian_assembler),
883 _local_coordinate_system, integration_order,
884 process_config, _media);
885 break;
886 case 3:
889 name, *_mesh_vec[0], std::move(jacobian_assembler),
891 _local_coordinate_system, integration_order,
892 process_config, _media);
893 break;
894 default:
895 OGS_FATAL(
896 "LARGE_DEFORMATION process does not support given "
897 "dimension");
898 }
899 }
900 else
901#endif
902#ifdef OGS_BUILD_PROCESS_LIE_HM
903 if (type == "HYDRO_MECHANICS_WITH_LIE")
904 {
905 if (
906 process_config.getConfigParameterOptional<int>("dimension"))
907 {
908 OGS_FATAL(
909 "The 'dimension' tag has been removed in the merge-request "
910 "!4766."
911 "The dimension is now taken from the main mesh and the tag "
912 "must be"
913 "removed. There is a python script in the merge-request "
914 "description"
915 "for automatic conversion.");
916 }
917 switch (_mesh_vec[0]->getDimension())
918 {
919 case 2:
922 name, *_mesh_vec[0], std::move(jacobian_assembler),
924 _local_coordinate_system, integration_order,
925 process_config, _media);
926 break;
927 case 3:
930 name, *_mesh_vec[0], std::move(jacobian_assembler),
932 _local_coordinate_system, integration_order,
933 process_config, _media);
934 break;
935 default:
936 OGS_FATAL(
937 "HYDRO_MECHANICS_WITH_LIE process does not support "
938 "given dimension");
939 }
940 }
941 else
942#endif
943#ifdef OGS_BUILD_PROCESS_HT
944 if (type == "HT")
945 {
947 name, *_mesh_vec[0], std::move(jacobian_assembler),
948 _process_variables, _parameters, integration_order,
949 process_config, _mesh_vec, _media);
950 }
951 else
952#endif
953#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
954 if (type == "ComponentTransport")
955 {
956 process =
958 name, *_mesh_vec[0], std::move(jacobian_assembler),
959 _process_variables, _parameters, integration_order,
960 process_config, _mesh_vec, _media,
961 std::move(chemical_solver_interface));
962 }
963 else
964#endif
965#ifdef OGS_BUILD_PROCESS_PHASEFIELD
966 if (type == "PHASE_FIELD")
967 {
968 switch (_mesh_vec[0]->getDimension())
969 {
970 case 2:
971 process =
973 name, *_mesh_vec[0], std::move(jacobian_assembler),
975 _local_coordinate_system, integration_order,
976 process_config);
977 break;
978 case 3:
979 process =
981 name, *_mesh_vec[0], std::move(jacobian_assembler),
983 _local_coordinate_system, integration_order,
984 process_config);
985 break;
986 }
987 }
988 else
989#endif
990#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
991 if (type == "RichardsComponentTransport")
992 {
995 name, *_mesh_vec[0], std::move(jacobian_assembler),
996 _process_variables, _parameters, integration_order,
997 process_config, _media);
998 }
999 else
1000#endif
1001#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1002 if (type == "SMALL_DEFORMATION")
1003 {
1004 switch (_mesh_vec[0]->getDimension())
1005 {
1006 case 2:
1009 name, *_mesh_vec[0], std::move(jacobian_assembler),
1011 _local_coordinate_system, integration_order,
1012 process_config, _media);
1013 break;
1014 case 3:
1017 name, *_mesh_vec[0], std::move(jacobian_assembler),
1019 _local_coordinate_system, integration_order,
1020 process_config, _media);
1021 break;
1022 default:
1023 OGS_FATAL(
1024 "SMALL_DEFORMATION process does not support given "
1025 "dimension");
1026 }
1027 }
1028 else
1029#endif
1030#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1031 if (type == "SMALL_DEFORMATION_NONLOCAL")
1032 {
1033 WARN(
1034 "The SMALL_DEFORMATION_NONLOCAL process is deprecated and will "
1035 "be removed in OGS-6.5.5.");
1036 switch (_mesh_vec[0]->getDimension())
1037 {
1038 case 2:
1041 name, *_mesh_vec[0], std::move(jacobian_assembler),
1043 _local_coordinate_system, integration_order,
1044 process_config);
1045 break;
1046 case 3:
1049 name, *_mesh_vec[0], std::move(jacobian_assembler),
1051 _local_coordinate_system, integration_order,
1052 process_config);
1053 break;
1054 default:
1055 OGS_FATAL(
1056 "SMALL_DEFORMATION_NONLOCAL process does not support "
1057 "given dimension {:d}",
1058 _mesh_vec[0]->getDimension());
1059 }
1060 }
1061 else
1062#endif
1063#ifdef OGS_BUILD_PROCESS_LIE_M
1064 if (type == "SMALL_DEFORMATION_WITH_LIE")
1065 {
1066 if (
1067 process_config.getConfigParameterOptional<int>("dimension"))
1068 {
1069 OGS_FATAL(
1070 "The 'dimension' tag has been removed in the merge-request "
1071 "!4766."
1072 "The dimension is now taken from the main mesh and the tag "
1073 "must be"
1074 "removed. There is a python script in the merge-request "
1075 "description"
1076 "for automatic conversion.");
1077 }
1078 switch (_mesh_vec[0]->getDimension())
1079 {
1080 case 2:
1083 name, *_mesh_vec[0], std::move(jacobian_assembler),
1085 _local_coordinate_system, integration_order,
1086 process_config);
1087 break;
1088 case 3:
1091 name, *_mesh_vec[0], std::move(jacobian_assembler),
1093 _local_coordinate_system, integration_order,
1094 process_config);
1095 break;
1096 default:
1097 OGS_FATAL(
1098 "SMALL_DEFORMATION_WITH_LIE process does not support "
1099 "given dimension");
1100 }
1101 }
1102 else
1103#endif
1104#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1105 if (type == "THERMO_HYDRO_MECHANICS")
1106 {
1107 if (
1108 process_config.getConfigParameterOptional<int>("dimension"))
1109 {
1110 OGS_FATAL(
1111 "The 'dimension' tag has been removed in the merge-request "
1112 "!4766."
1113 "The dimension is now taken from the main mesh and the tag "
1114 "must be"
1115 "removed. There is a python script in the merge-request "
1116 "description"
1117 "for automatic conversion.");
1118 }
1119 switch (_mesh_vec[0]->getDimension())
1120 {
1121 case 2:
1124 name, *_mesh_vec[0], std::move(jacobian_assembler),
1126 _local_coordinate_system, integration_order,
1127 process_config, _media);
1128 break;
1129 case 3:
1132 name, *_mesh_vec[0], std::move(jacobian_assembler),
1134 _local_coordinate_system, integration_order,
1135 process_config, _media);
1136 break;
1137 default:
1138 OGS_FATAL(
1139 "THERMO_HYDRO_MECHANICS process does not support given "
1140 "dimension");
1141 }
1142 }
1143 else
1144#endif
1145#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1146 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1147 {
1148 WARN(
1149 "The THERMO_MECHANICAL_PHASE_FIELD process is deprecated and "
1150 "will be removed in OGS-6.5.5.");
1151 switch (_mesh_vec[0]->getDimension())
1152 {
1153 case 2:
1156 name, *_mesh_vec[0], std::move(jacobian_assembler),
1158 _local_coordinate_system, integration_order,
1159 process_config);
1160 break;
1161 case 3:
1164 name, *_mesh_vec[0], std::move(jacobian_assembler),
1166 _local_coordinate_system, integration_order,
1167 process_config);
1168 break;
1169 }
1170 }
1171 else
1172#endif
1173#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1174 if (type == "THERMO_MECHANICS")
1175 {
1176 switch (_mesh_vec[0]->getDimension())
1177 {
1178 case 2:
1181 name, *_mesh_vec[0], std::move(jacobian_assembler),
1183 _local_coordinate_system, integration_order,
1184 process_config, _media);
1185 break;
1186 case 3:
1189 name, *_mesh_vec[0], std::move(jacobian_assembler),
1191 _local_coordinate_system, integration_order,
1192 process_config, _media);
1193 break;
1194 }
1195 }
1196 else
1197#endif
1198#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1199 if (type == "RICHARDS_FLOW")
1200 {
1202 name, *_mesh_vec[0], std::move(jacobian_assembler),
1203 _process_variables, _parameters, integration_order,
1204 process_config, _media);
1205 }
1206 else
1207#endif
1208#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1209 if (type == "RICHARDS_MECHANICS")
1210 {
1211 if (
1212 process_config.getConfigParameterOptional<int>("dimension"))
1213 {
1214 OGS_FATAL(
1215 "The 'dimension' tag has been removed in the merge-request "
1216 "!4766."
1217 "The dimension is now taken from the main mesh and the tag "
1218 "must be"
1219 "removed. There is a python script in the merge-request "
1220 "description"
1221 "for automatic conversion.");
1222 }
1223 switch (_mesh_vec[0]->getDimension())
1224 {
1225 case 2:
1228 name, *_mesh_vec[0], std::move(jacobian_assembler),
1230 _local_coordinate_system, integration_order,
1231 process_config, _media);
1232 break;
1233 case 3:
1236 name, *_mesh_vec[0], std::move(jacobian_assembler),
1238 _local_coordinate_system, integration_order,
1239 process_config, _media);
1240 break;
1241 }
1242 }
1243 else
1244#endif
1245#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1246 if (type == "THERMO_RICHARDS_FLOW")
1247 {
1248 process =
1250 name, *_mesh_vec[0], std::move(jacobian_assembler),
1251 _process_variables, _parameters, integration_order,
1252 process_config, _media);
1253 }
1254 else
1255#endif
1256#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1257 if (type == "THERMO_RICHARDS_MECHANICS")
1258 {
1259 switch (_mesh_vec[0]->getDimension())
1260 {
1261 case 2:
1264 name, *_mesh_vec[0], std::move(jacobian_assembler),
1266 _local_coordinate_system, integration_order,
1267 process_config, _media);
1268 break;
1269 case 3:
1272 name, *_mesh_vec[0], std::move(jacobian_assembler),
1274 _local_coordinate_system, integration_order,
1275 process_config, _media);
1276 break;
1277 }
1278 }
1279 else
1280#endif
1281
1282#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1283 if (type == "TWOPHASE_FLOW_PP")
1284 {
1285 process =
1287 name, *_mesh_vec[0], std::move(jacobian_assembler),
1288 _process_variables, _parameters, integration_order,
1289 process_config, _media);
1290 }
1291 else
1292#endif
1293#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1294 if (type == "TWOPHASE_FLOW_PRHO")
1295 {
1296 WARN(
1297 "The TWOPHASE_FLOW_PRHO process is deprecated and will be "
1298 "removed in OGS-6.5.5.");
1301 name, *_mesh_vec[0], std::move(jacobian_assembler),
1302 _process_variables, _parameters, integration_order,
1303 process_config, _media);
1304 }
1305 else
1306#endif
1307#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1308 if (type == "THERMAL_TWOPHASE_WITH_PP")
1309 {
1312 name, *_mesh_vec[0], std::move(jacobian_assembler),
1313 _process_variables, _parameters, integration_order,
1314 process_config, _media);
1315 }
1316 else
1317#endif
1318 {
1319 OGS_FATAL("Unknown process type: {:s}", type);
1320 }
1321
1322 if (ranges::contains(_processes, name,
1323 [](std::unique_ptr<ProcessLib::Process> const& p)
1324 { return p->name; }))
1325 {
1326 OGS_FATAL("The process name '{:s}' is not unique.", name);
1327 }
1328 _processes.push_back(std::move(process));
1329 }
1330}
1331
1333 std::string const& output_directory)
1334{
1335 DBUG("Reading time loop configuration.");
1336
1337 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1338 std::begin(_process_variables),
1339 std::end(_process_variables),
1340 [](auto const& process_variable)
1341 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1342
1344 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1345 compensate_non_equilibrium_initial_residuum);
1346
1347 if (!_time_loop)
1348 {
1349 OGS_FATAL("Initialization of time loop failed.");
1350 }
1351}
1352
1354{
1355 DBUG("Reading linear solver configuration.");
1356
1358 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1359 {
1361 auto const name = conf.getConfigParameter<std::string>("name");
1362 auto const linear_solver_parser =
1364 auto const solver_options =
1365 linear_solver_parser.parseNameAndOptions("", &conf);
1366
1369 name,
1370 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1371 std::get<1>(solver_options)),
1372 "The linear solver name is not unique");
1373 }
1374}
1375
1377{
1378 DBUG("Reading non-linear solver configuration.");
1379
1381 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1382 {
1383 auto const ls_name =
1385 conf.getConfigParameter<std::string>("linear_solver");
1386 auto const& linear_solver = BaseLib::getOrError(
1387 _linear_solvers, ls_name,
1388 "A linear solver with the given name does not exist.");
1389
1391 auto const name = conf.getConfigParameter<std::string>("name");
1394 name,
1395 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1396 "The nonlinear solver name is not unique");
1397 }
1398}
1399
1400void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1401{
1402 if (!config)
1403 {
1404 return;
1405 }
1406
1407 DBUG("Reading curves configuration.");
1408
1410 for (auto conf : config->getConfigSubtreeList("curve"))
1411 {
1413 auto const name = conf.getConfigParameter<std::string>("name");
1415 _curves,
1416 name,
1419 "The curve name is not unique.");
1420 }
1421}
1422
1423MeshLib::Mesh& ProjectData::getMesh(std::string const& mesh_name) const
1424{
1425 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1426}
Definition of the AsciiRasterInterface class.
Definition of the BoostXmlGmlInterface class.
Functionality to build different search length algorithm objects from given config.
#define OGS_FATAL(...)
Definition Error.h:26
Filename manipulation routines.
Definition of the GEOObjects class.
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:35
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
Definition of the Mesh class.
Definition of the GeoLib::Raster class.
Base class for different search length strategies.
Definition of string helper functions.
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) 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
ConfigTree getConfigSubtree(std::string const &root) const
std::optional< T > getConfigAttributeOptional(std::string const &attr) const
Container class for geometric objects.
Definition GEOObjects.h:57
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:47
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
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.
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
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)
pybind11::scoped_interpreter setupEmbeddedPython()
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition Algorithm.h:104
bool IsFileExisting(const std::string &strFilename)
Returns true if given file exists.
Definition FileTools.cpp:50
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:118
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 > > const &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:229
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
Definition Mesh.cpp:364
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)
Definition Parameter.cpp:27
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)
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 > createSmallDeformationNonlocalProcess< 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 > createSmallDeformationNonlocalProcess< 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 > 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 > createStokesFlowProcess< 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, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createTESProcess(std::string 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)
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 > createThermoMechanicalPhaseFieldProcess< 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 > createThermoMechanicalPhaseFieldProcess< 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 > 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 > createTwoPhaseFlowWithPrhoProcess(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< std::unique_ptr< MeshLib::Mesh > > readMeshes(BaseLib::ConfigTree const &config, std::string const &directory, std::string const &project_directory)
void readGeometry(std::string const &fname, GeoLib::GEOObjects &geo_objects, std::string const &dir_first, std::string const &dir_second)
std::vector< GeoLib::NamedRaster > readRasters(BaseLib::ConfigTree const &config, std::string const &raster_directory, GeoLib::MinMaxPoints const &min_max_points)
std::unique_ptr< MeshLib::Mesh > readSingleMesh(BaseLib::ConfigTree const &mesh_config_parameter, std::string const &directory)
Definition of readMeshFromFile function.
Single, constant value parameter.
static PROCESSLIB_EXPORT const std::string zero_parameter_name