Loading [MathJax]/extensions/tex2jax.js
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_HMPHASEFIELD
119#endif
120#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
122#endif
123#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
125#endif
126#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
128#endif
129#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
131#endif
132#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
134#endif
135#ifdef OGS_BUILD_PROCESS_TES
137#endif
138#ifdef OGS_BUILD_PROCESS_TH2M
140#endif
141#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
143#endif
144#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
146#endif
147#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
149#endif
150#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
152#endif
153#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
155#endif
156#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
158#endif
159#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
161#endif
162
163namespace
164{
165void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects,
166 std::string const& dir_first, std::string const& dir_second)
167{
168 DBUG("Reading geometry file '{:s}'.", fname);
169 GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
170 std::string geometry_file = BaseLib::joinPaths(dir_first, fname);
171 if (!BaseLib::IsFileExisting(geometry_file))
172 {
173 // Fallback to reading gml from prj-file directory
174 geometry_file = BaseLib::joinPaths(dir_second, fname);
175 WARN("File {:s} not found in {:s}! Trying reading from {:s}.", fname,
176 dir_first, dir_second);
177 if (!BaseLib::IsFileExisting(geometry_file))
178 {
179 OGS_FATAL("Could not read geometry file {:s} in {:s}.", fname,
180 dir_second);
181 }
182 }
183 gml_reader.readFile(geometry_file);
184}
185
186std::unique_ptr<MeshLib::Mesh> readSingleMesh(
187 BaseLib::ConfigTree const& mesh_config_parameter,
188 std::string const& directory)
189{
190 std::string const mesh_file = BaseLib::joinPaths(
191 directory, mesh_config_parameter.getValue<std::string>());
192 DBUG("Reading mesh file '{:s}'.", mesh_file);
193
194 auto mesh = std::unique_ptr<MeshLib::Mesh>(MeshLib::IO::readMeshFromFile(
195 mesh_file, true /* compute_element_neighbors */));
196 if (!mesh)
197 {
198 std::filesystem::path abspath{mesh_file};
199 try
200 {
201 abspath = std::filesystem::absolute(mesh_file);
202 }
203 catch (std::filesystem::filesystem_error const& e)
204 {
205 ERR("Determining the absolute path of '{}' failed: {}", mesh_file,
206 e.what());
207 }
208
209 OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
210 abspath.string());
211 }
212
213#ifdef DOXYGEN_DOCU_ONLY
215 mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
216#endif // DOXYGEN_DOCU_ONLY
217
218 if (auto const axially_symmetric =
220 mesh_config_parameter.getConfigAttributeOptional<bool>(
221 "axially_symmetric"))
222 {
223 mesh->setAxiallySymmetric(*axially_symmetric);
224 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
225 {
226 OGS_FATAL("3D mesh cannot be axially symmetric.");
227 }
228 }
229
230 return mesh;
231}
232
233std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
234 BaseLib::ConfigTree const& config, std::string const& directory,
235 std::string const& project_directory)
236{
237 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
238
239 GeoLib::GEOObjects geoObjects;
240
242 auto optional_meshes = config.getConfigSubtreeOptional("meshes");
243 if (optional_meshes)
244 {
245 DBUG("Reading multiple meshes.");
247 auto const configs = optional_meshes->getConfigParameterList("mesh");
248 std::transform(configs.begin(), configs.end(),
249 std::back_inserter(meshes),
250 [&directory](auto const& mesh_config)
251 { return readSingleMesh(mesh_config, directory); });
252 if (auto const geometry_file_name =
254 config.getConfigParameterOptional<std::string>("geometry"))
255 {
256 readGeometry(*geometry_file_name, geoObjects, directory,
257 project_directory);
258 }
259 }
260 else
261 { // Read single mesh with geometry.
262 meshes.push_back(
264 readSingleMesh(config.getConfigParameter("mesh"), directory));
265
266 auto const geometry_file_name =
268 config.getConfigParameter<std::string>("geometry");
269 readGeometry(geometry_file_name, geoObjects, directory,
270 project_directory);
271 }
272
273 if (!geoObjects.getPoints().empty() || !geoObjects.getPolylines().empty() ||
274 !geoObjects.getSurfaces().empty())
275 { // generate meshes from geometries
276 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
278 bool const multiple_nodes_allowed = false;
279 auto additional_meshes =
281 geoObjects, *meshes[0], std::move(search_length_algorithm),
282 multiple_nodes_allowed);
283
284 std::move(begin(additional_meshes), end(additional_meshes),
285 std::back_inserter(meshes));
286 }
287
288 auto mesh_names = MeshLib::views::names | ranges::to<std::vector>() |
289 ranges::actions::sort;
290 auto const sorted_names = meshes | mesh_names;
291 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
292 if (unique_names.size() < sorted_names.size())
293 {
294 WARN(
295 "Mesh names aren't unique. From project file read mesh names are:");
296 for (auto const& name : meshes | MeshLib::views::names)
297 {
298 INFO("- {}", name);
299 }
300 }
301
302 auto const zero_mesh_field_data_by_material_ids =
304 config.getConfigParameterOptional<std::vector<int>>(
305 "zero_mesh_field_data_by_material_ids");
306 if (zero_mesh_field_data_by_material_ids)
307 {
308 WARN(
309 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
310 "name may be changed, or it may be removed due to its "
311 "corresponding feature becomes a single tool. Please use it with "
312 "care!");
314 *meshes[0], *zero_mesh_field_data_by_material_ids);
315 }
316
318
319 return meshes;
320}
321
322std::vector<GeoLib::NamedRaster> readRasters(
323 BaseLib::ConfigTree const& config, std::string const& raster_directory,
324 GeoLib::MinMaxPoints const& min_max_points)
325{
326 INFO("readRasters ...");
327 std::vector<GeoLib::NamedRaster> named_rasters;
328
330 auto optional_rasters = config.getConfigSubtreeOptional("rasters");
331 if (optional_rasters)
332 {
334 auto const configs = optional_rasters->getConfigSubtreeList("raster");
335 std::transform(
336 configs.begin(), configs.end(), std::back_inserter(named_rasters),
337 [&raster_directory, &min_max_points](auto const& raster_config)
338 {
339 return GeoLib::IO::readRaster(raster_config, raster_directory,
340 min_max_points);
341 });
342 }
343 INFO("readRasters done");
344 return named_rasters;
345}
346
347// for debugging raster reading implementation
348// void writeRasters(std::vector<GeoLib::NamedRaster> const& named_rasters,
349// std::string const& output_directory)
350//{
351// for (auto const& named_raster : named_rasters)
352// {
353// #if defined(USE_PETSC)
354// int my_mpi_rank;
355// MPI_Comm_rank(MPI_COMM_WORLD, &my_mpi_rank);
356// #endif
357// FileIO::AsciiRasterInterface::writeRasterAsASC(
358// named_raster.raster, output_directory + "/" +
359// named_raster.raster_name +
360// #if defined(USE_PETSC)
361// "_" + std::to_string(my_mpi_rank) +
362// #endif
363// ".asc");
364// }
365//}
366
367} // namespace
368
369ProjectData::ProjectData() = default;
370
372 std::string const& project_directory,
373 std::string const& output_directory,
374 std::string const& mesh_directory,
375 [[maybe_unused]] std::string const& script_directory)
376 : _mesh_vec(readMeshes(project_config, mesh_directory, project_directory)),
377 _named_rasters(readRasters(project_config, project_directory,
378 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
379 _mesh_vec[0]->getNodes().end())
380 .getMinMaxPoints()))
381{
382 // for debugging raster reading implementation
383 // writeRasters(_named_rasters, output_directory);
384 if (auto const python_script =
386 project_config.getConfigParameterOptional<std::string>("python_script"))
387 {
388 namespace py = pybind11;
389
390#ifdef OGS_EMBED_PYTHON_INTERPRETER
391 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
392#endif
393
394 // Append to python's module search path
395 auto py_path = py::module::import("sys").attr("path");
396 py_path.attr("append")(script_directory); // .prj or -s directory
397
398 auto const script_path =
399 BaseLib::joinPaths(script_directory, *python_script);
400
401 // Evaluate in scope of main module
402 py::object scope = py::module::import("__main__").attr("__dict__");
403 // add (global) variables
404 auto globals = py::dict(scope);
405 globals["ogs_prj_directory"] = project_directory;
406 globals["ogs_mesh_directory"] = mesh_directory;
407 globals["ogs_script_directory"] = script_directory;
408 try
409 {
410 py::eval_file(script_path, scope);
411 }
412 catch (py::error_already_set const& e)
413 {
414 OGS_FATAL("Error evaluating python script {}: {}", script_path,
415 e.what());
416 }
417 }
418
420 parseCurves(project_config.getConfigSubtreeOptional("curves"));
421
422 auto parameter_names_for_transformation =
424 parseParameters(project_config.getConfigSubtree("parameters"));
425
428 project_config.getConfigSubtreeOptional("local_coordinate_system"),
430
431 for (auto& parameter : _parameters)
432 {
433 if (std::find(begin(parameter_names_for_transformation),
434 end(parameter_names_for_transformation),
435 parameter->name) !=
436 end(parameter_names_for_transformation))
437 {
439 {
440 OGS_FATAL(
441 "The parameter '{:s}' is using the local coordinate system "
442 "but no local coordinate system was provided.",
443 parameter->name);
444 }
445 parameter->setCoordinateSystem(*_local_coordinate_system);
446 }
447
448 parameter->initialize(_parameters);
449 }
450
452 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
453
455 parseMedia(project_config.getConfigSubtreeOptional("media"));
456
458 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
459
460 auto chemical_solver_interface = parseChemicalSolverInterface(
462 project_config.getConfigSubtreeOptional("chemical_system"),
463 output_directory);
464
466 parseProcesses(project_config.getConfigSubtree("processes"),
467 project_directory, output_directory,
468 std::move(chemical_solver_interface));
469
471 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
472
474 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
475 output_directory);
476}
477
479 BaseLib::ConfigTree const& process_variables_config)
480{
481 DBUG("Parse process variables:");
482
483 std::set<std::string> names;
484
485 for (auto var_config
487 : process_variables_config.getConfigSubtreeList("process_variable"))
488 {
489 // Either the mesh name is given, or the first mesh's name will be
490 // taken. Taking the first mesh's value is deprecated.
491 auto const mesh_name =
493 var_config.getConfigParameter<std::string>("mesh",
494 _mesh_vec[0]->getName());
495
496 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
497
498 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
500 if (!names.insert(pv.getName()).second)
501 {
502 OGS_FATAL("A process variable with name `{:s}' already exists.",
503 pv.getName());
504 }
505
506 _process_variables.push_back(std::move(pv));
507 }
508}
509
510std::vector<std::string> ProjectData::parseParameters(
511 BaseLib::ConfigTree const& parameters_config)
512{
513 using namespace ProcessLib;
514
515 std::set<std::string> names;
516 std::vector<std::string> parameter_names_for_transformation;
517
518 DBUG("Reading parameters:");
519 for (auto parameter_config :
521 parameters_config.getConfigSubtreeList("parameter"))
522 {
523 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
525 if (!names.insert(p->name).second)
526 {
527 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
528 }
529
530 auto const use_local_coordinate_system =
532 parameter_config.getConfigParameterOptional<bool>(
533 "use_local_coordinate_system");
534 if (!!use_local_coordinate_system && *use_local_coordinate_system)
535 {
536 parameter_names_for_transformation.push_back(p->name);
537 }
538
539 _parameters.push_back(std::move(p));
540 }
541
542 _parameters.push_back(
545 _parameters.push_back(
548
549 return parameter_names_for_transformation;
550}
551
553 std::optional<BaseLib::ConfigTree> const& media_config)
554{
555 if (!media_config)
556 {
557 return;
558 }
559
560 DBUG("Reading media:");
561
562 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
563 {
564 ERR("A mesh is required to define medium materials.");
565 return;
566 }
567
568 for (auto const& medium_config :
570 media_config->getConfigSubtreeList("medium"))
571 {
572 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
573 &medium_config, this](int const id)
574 {
576 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
578 _curves);
579 };
580
581 auto const material_id_string =
583 medium_config.getConfigAttribute<std::string>("id", "0");
584
585 std::vector<int> const material_ids_of_this_medium =
586 MaterialLib::parseMaterialIdString(material_id_string,
587 materialIDs(*_mesh_vec[0]));
588
589 for (auto const& id : material_ids_of_this_medium)
590 {
592 id, _media, material_ids_of_this_medium, create_medium);
593 }
594 }
595
596 if (_media.empty())
597 {
598 OGS_FATAL("No entity is found inside <media>.");
599 }
600}
601
602std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
604 std::optional<BaseLib::ConfigTree> const& config,
605 std::string const& output_directory)
606{
607 if (!config)
608 {
609 return nullptr;
610 }
611
612 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
613 chemical_solver_interface;
614#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
615 INFO(
616 "Ready for initializing interface to a chemical solver for water "
617 "chemistry calculation.");
618
619 auto const chemical_solver =
621 config->getConfigAttribute<std::string>("chemical_solver");
622
623 if (boost::iequals(chemical_solver, "Phreeqc"))
624 {
625 INFO(
626 "Configuring phreeqc interface for water chemistry calculation "
627 "using file-based approach.");
628
629 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
631 *config, output_directory);
632 }
633 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
634 {
635 OGS_FATAL(
636 "The chemical solver option of PhreeqcKernel is not accessible for "
637 "the time being. Please set 'Phreeqc'' as the chemical solver for "
638 "reactive transport modeling.");
639 }
640 else if (boost::iequals(chemical_solver, "SelfContained"))
641 {
642 INFO(
643 "Use self-contained chemical solver for water chemistry "
644 "calculation.");
645
646 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
648 _mesh_vec, _linear_solvers, *config, output_directory);
649 }
650 else
651 {
652 OGS_FATAL(
653 "Unknown chemical solver. Please specify either Phreeqc or "
654 "PhreeqcKernel as the solver for water chemistry calculation "
655 "instead.");
656 }
657#else
658 (void)output_directory;
659
660 OGS_FATAL(
661 "Found the type of the process to be solved is not component transport "
662 "process. Please specify the process type to ComponentTransport. At "
663 "the present, water chemistry calculation is only available for "
664 "component transport process.");
665#endif
666 return chemical_solver_interface;
667}
668
670 BaseLib::ConfigTree const& processes_config,
671 std::string const& project_directory,
672 std::string const& output_directory,
673 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
674 chemical_solver_interface)
675{
676 (void)project_directory; // to avoid compilation warning
677 (void)output_directory; // to avoid compilation warning
678
679 DBUG("Reading processes:");
681 for (auto process_config : processes_config.getConfigSubtreeList("process"))
682 {
683 auto const type =
685 process_config.peekConfigParameter<std::string>("type");
686
687 auto const name =
689 process_config.getConfigParameter<std::string>("name");
690
691 [[maybe_unused]] auto const integration_order =
693 process_config.getConfigParameter<int>("integration_order");
694
695 std::unique_ptr<ProcessLib::Process> process;
696
697 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
699 process_config.getConfigSubtreeOptional("jacobian_assembler"));
700
701#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
702 if (type == "STEADY_STATE_DIFFUSION")
703 {
704 // The existence check of the in the configuration referenced
705 // process variables is checked in the physical process.
706 // TODO at the moment we have only one mesh, later there can be
707 // several meshes. Then we have to assign the referenced mesh
708 // here.
709 process =
711 name, *_mesh_vec[0], std::move(jacobian_assembler),
712 _process_variables, _parameters, integration_order,
713 process_config, _mesh_vec, _media);
714 }
715 else
716#endif
717#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
718 if (type == "LIQUID_FLOW")
719 {
721 name, *_mesh_vec[0], std::move(jacobian_assembler),
722 _process_variables, _parameters, integration_order,
723 process_config, _mesh_vec, _media);
724 }
725 else
726#endif
727#ifdef OGS_BUILD_PROCESS_STOKESFLOW
728 if (type == "StokesFlow")
729 {
730 WARN(
731 "The StokesFlow process is deprecated and will be removed in "
732 "OGS-6.5.5.");
733 switch (_mesh_vec[0]->getDimension())
734 {
735 case 2:
736 process =
738 name, *_mesh_vec[0], std::move(jacobian_assembler),
739 _process_variables, _parameters, integration_order,
740 process_config, _media);
741 break;
742 default:
743 OGS_FATAL(
744 "StokesFlow process does not support given "
745 "dimension {:d}",
746 _mesh_vec[0]->getDimension());
747 }
748 }
749 else
750#endif
751#ifdef OGS_BUILD_PROCESS_TES
752 if (type == "TES")
753 {
754 WARN(
755 "The TES process is deprecated and will be removed in "
756 "OGS-6.5.5.");
758 name, *_mesh_vec[0], std::move(jacobian_assembler),
759 _process_variables, _parameters, integration_order,
760 process_config);
761 }
762 else
763#endif
764#ifdef OGS_BUILD_PROCESS_TH2M
765 if (type == "TH2M")
766 {
767 switch (_mesh_vec[0]->getDimension())
768 {
769 case 2:
771 name, *_mesh_vec[0], std::move(jacobian_assembler),
773 _local_coordinate_system, integration_order,
774 process_config, _media);
775 break;
776 case 3:
778 name, *_mesh_vec[0], std::move(jacobian_assembler),
780 _local_coordinate_system, integration_order,
781 process_config, _media);
782 break;
783 default:
784 OGS_FATAL("TH2M process does not support given dimension");
785 }
786 }
787 else
788#endif
789#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
790 if (type == "HEAT_CONDUCTION")
791 {
793 name, *_mesh_vec[0], std::move(jacobian_assembler),
794 _process_variables, _parameters, integration_order,
795 process_config, _media);
796 }
797 else
798#endif
799#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
800 if (type == "HEAT_TRANSPORT_BHE")
801 {
802 if (_mesh_vec[0]->getDimension() != 3)
803 {
804 OGS_FATAL(
805 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
806 "mesh! ");
807 }
808
809 process =
811 name, *_mesh_vec[0], std::move(jacobian_assembler),
812 _process_variables, _parameters, integration_order,
813 process_config, _curves, _media);
814 }
815 else
816#endif
817#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
818 if (type == "WELLBORE_SIMULATOR")
819 {
820 if (_mesh_vec[0]->getDimension() != 1)
821 {
822 OGS_FATAL(
823 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
824 "mesh!");
825 }
826
827 process =
829 name, *_mesh_vec[0], std::move(jacobian_assembler),
830 _process_variables, _parameters, integration_order,
831 process_config, _media);
832 }
833 else
834#endif
835#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
836 if (type == "HYDRO_MECHANICS")
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. The dimension is now taken from the main mesh and "
844 "the tag must be removed. There is a python script in the "
845 "merge-request description for automatic conversion.");
846 }
847 switch (_mesh_vec[0]->getDimension())
848 {
849 case 2:
850 process =
852 2>(name, *_mesh_vec[0],
853 std::move(jacobian_assembler),
855 _local_coordinate_system, integration_order,
856 process_config, _media);
857 break;
858 case 3:
859 process =
861 3>(name, *_mesh_vec[0],
862 std::move(jacobian_assembler),
864 _local_coordinate_system, integration_order,
865 process_config, _media);
866 break;
867 default:
868 OGS_FATAL(
869 "HYDRO_MECHANICS process does not support given "
870 "dimension");
871 }
872 }
873 else
874#endif
875#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
876 if (type == "LARGE_DEFORMATION")
877 {
878 switch (_mesh_vec[0]->getDimension())
879 {
880 case 2:
883 name, *_mesh_vec[0], std::move(jacobian_assembler),
885 _local_coordinate_system, integration_order,
886 process_config, _media);
887 break;
888 case 3:
891 name, *_mesh_vec[0], std::move(jacobian_assembler),
893 _local_coordinate_system, integration_order,
894 process_config, _media);
895 break;
896 default:
897 OGS_FATAL(
898 "LARGE_DEFORMATION process does not support given "
899 "dimension");
900 }
901 }
902 else
903#endif
904#ifdef OGS_BUILD_PROCESS_LIE_HM
905 if (type == "HYDRO_MECHANICS_WITH_LIE")
906 {
907 if (
908 process_config.getConfigParameterOptional<int>("dimension"))
909 {
910 OGS_FATAL(
911 "The 'dimension' tag has been removed in the merge-request "
912 "!4766."
913 "The dimension is now taken from the main mesh and the tag "
914 "must be"
915 "removed. There is a python script in the merge-request "
916 "description"
917 "for automatic conversion.");
918 }
919 switch (_mesh_vec[0]->getDimension())
920 {
921 case 2:
924 name, *_mesh_vec[0], std::move(jacobian_assembler),
926 _local_coordinate_system, integration_order,
927 process_config, _media);
928 break;
929 case 3:
932 name, *_mesh_vec[0], std::move(jacobian_assembler),
934 _local_coordinate_system, integration_order,
935 process_config, _media);
936 break;
937 default:
938 OGS_FATAL(
939 "HYDRO_MECHANICS_WITH_LIE process does not support "
940 "given dimension");
941 }
942 }
943 else
944#endif
945#ifdef OGS_BUILD_PROCESS_HT
946 if (type == "HT")
947 {
949 name, *_mesh_vec[0], std::move(jacobian_assembler),
950 _process_variables, _parameters, integration_order,
951 process_config, _mesh_vec, _media);
952 }
953 else
954#endif
955#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
956 if (type == "ComponentTransport")
957 {
958 process =
960 name, *_mesh_vec[0], std::move(jacobian_assembler),
961 _process_variables, _parameters, integration_order,
962 process_config, _mesh_vec, _media,
963 std::move(chemical_solver_interface));
964 }
965 else
966#endif
967#ifdef OGS_BUILD_PROCESS_PHASEFIELD
968 if (type == "PHASE_FIELD")
969 {
970 switch (_mesh_vec[0]->getDimension())
971 {
972 case 2:
973 process =
975 name, *_mesh_vec[0], std::move(jacobian_assembler),
977 _local_coordinate_system, integration_order,
978 process_config);
979 break;
980 case 3:
981 process =
983 name, *_mesh_vec[0], std::move(jacobian_assembler),
985 _local_coordinate_system, integration_order,
986 process_config);
987 break;
988 }
989 }
990 else
991#endif
992#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
993 if (type == "HM_PHASE_FIELD")
994 {
995 switch (_mesh_vec[0]->getDimension())
996 {
997 case 2:
998 process =
1000 name, *_mesh_vec[0], std::move(jacobian_assembler),
1002 _local_coordinate_system, integration_order,
1003 process_config, _media);
1004 break;
1005 case 3:
1006 process =
1008 name, *_mesh_vec[0], std::move(jacobian_assembler),
1010 _local_coordinate_system, integration_order,
1011 process_config, _media);
1012 break;
1013 }
1014 }
1015 else
1016#endif
1017#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
1018 if (type == "RichardsComponentTransport")
1019 {
1022 name, *_mesh_vec[0], std::move(jacobian_assembler),
1023 _process_variables, _parameters, integration_order,
1024 process_config, _media);
1025 }
1026 else
1027#endif
1028#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1029 if (type == "SMALL_DEFORMATION")
1030 {
1031 switch (_mesh_vec[0]->getDimension())
1032 {
1033 case 2:
1036 name, *_mesh_vec[0], std::move(jacobian_assembler),
1038 _local_coordinate_system, integration_order,
1039 process_config, _media);
1040 break;
1041 case 3:
1044 name, *_mesh_vec[0], std::move(jacobian_assembler),
1046 _local_coordinate_system, integration_order,
1047 process_config, _media);
1048 break;
1049 default:
1050 OGS_FATAL(
1051 "SMALL_DEFORMATION process does not support given "
1052 "dimension");
1053 }
1054 }
1055 else
1056#endif
1057#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1058 if (type == "SMALL_DEFORMATION_NONLOCAL")
1059 {
1060 WARN(
1061 "The SMALL_DEFORMATION_NONLOCAL process is deprecated and will "
1062 "be removed in OGS-6.5.5.");
1063 switch (_mesh_vec[0]->getDimension())
1064 {
1065 case 2:
1068 name, *_mesh_vec[0], std::move(jacobian_assembler),
1070 _local_coordinate_system, integration_order,
1071 process_config);
1072 break;
1073 case 3:
1076 name, *_mesh_vec[0], std::move(jacobian_assembler),
1078 _local_coordinate_system, integration_order,
1079 process_config);
1080 break;
1081 default:
1082 OGS_FATAL(
1083 "SMALL_DEFORMATION_NONLOCAL process does not support "
1084 "given dimension {:d}",
1085 _mesh_vec[0]->getDimension());
1086 }
1087 }
1088 else
1089#endif
1090#ifdef OGS_BUILD_PROCESS_LIE_M
1091 if (type == "SMALL_DEFORMATION_WITH_LIE")
1092 {
1093 if (
1094 process_config.getConfigParameterOptional<int>("dimension"))
1095 {
1096 OGS_FATAL(
1097 "The 'dimension' tag has been removed in the merge-request "
1098 "!4766."
1099 "The dimension is now taken from the main mesh and the tag "
1100 "must be"
1101 "removed. There is a python script in the merge-request "
1102 "description"
1103 "for automatic conversion.");
1104 }
1105 switch (_mesh_vec[0]->getDimension())
1106 {
1107 case 2:
1110 name, *_mesh_vec[0], std::move(jacobian_assembler),
1112 _local_coordinate_system, integration_order,
1113 process_config);
1114 break;
1115 case 3:
1118 name, *_mesh_vec[0], std::move(jacobian_assembler),
1120 _local_coordinate_system, integration_order,
1121 process_config);
1122 break;
1123 default:
1124 OGS_FATAL(
1125 "SMALL_DEFORMATION_WITH_LIE process does not support "
1126 "given dimension");
1127 }
1128 }
1129 else
1130#endif
1131#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1132 if (type == "THERMO_HYDRO_MECHANICS")
1133 {
1134 if (
1135 process_config.getConfigParameterOptional<int>("dimension"))
1136 {
1137 OGS_FATAL(
1138 "The 'dimension' tag has been removed in the merge-request "
1139 "!4766."
1140 "The dimension is now taken from the main mesh and the tag "
1141 "must be"
1142 "removed. There is a python script in the merge-request "
1143 "description"
1144 "for automatic conversion.");
1145 }
1146 switch (_mesh_vec[0]->getDimension())
1147 {
1148 case 2:
1151 name, *_mesh_vec[0], std::move(jacobian_assembler),
1153 _local_coordinate_system, integration_order,
1154 process_config, _media);
1155 break;
1156 case 3:
1159 name, *_mesh_vec[0], std::move(jacobian_assembler),
1161 _local_coordinate_system, integration_order,
1162 process_config, _media);
1163 break;
1164 default:
1165 OGS_FATAL(
1166 "THERMO_HYDRO_MECHANICS process does not support given "
1167 "dimension");
1168 }
1169 }
1170 else
1171#endif
1172#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1173 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1174 {
1175 WARN(
1176 "The THERMO_MECHANICAL_PHASE_FIELD process is deprecated and "
1177 "will be removed in OGS-6.5.5.");
1178 switch (_mesh_vec[0]->getDimension())
1179 {
1180 case 2:
1183 name, *_mesh_vec[0], std::move(jacobian_assembler),
1185 _local_coordinate_system, integration_order,
1186 process_config);
1187 break;
1188 case 3:
1191 name, *_mesh_vec[0], std::move(jacobian_assembler),
1193 _local_coordinate_system, integration_order,
1194 process_config);
1195 break;
1196 }
1197 }
1198 else
1199#endif
1200#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1201 if (type == "THERMO_MECHANICS")
1202 {
1203 switch (_mesh_vec[0]->getDimension())
1204 {
1205 case 2:
1208 name, *_mesh_vec[0], std::move(jacobian_assembler),
1210 _local_coordinate_system, integration_order,
1211 process_config, _media);
1212 break;
1213 case 3:
1216 name, *_mesh_vec[0], std::move(jacobian_assembler),
1218 _local_coordinate_system, integration_order,
1219 process_config, _media);
1220 break;
1221 }
1222 }
1223 else
1224#endif
1225#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1226 if (type == "RICHARDS_FLOW")
1227 {
1229 name, *_mesh_vec[0], std::move(jacobian_assembler),
1230 _process_variables, _parameters, integration_order,
1231 process_config, _media);
1232 }
1233 else
1234#endif
1235#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1236 if (type == "RICHARDS_MECHANICS")
1237 {
1238 if (
1239 process_config.getConfigParameterOptional<int>("dimension"))
1240 {
1241 OGS_FATAL(
1242 "The 'dimension' tag has been removed in the merge-request "
1243 "!4766."
1244 "The dimension is now taken from the main mesh and the tag "
1245 "must be"
1246 "removed. There is a python script in the merge-request "
1247 "description"
1248 "for automatic conversion.");
1249 }
1250 switch (_mesh_vec[0]->getDimension())
1251 {
1252 case 2:
1255 name, *_mesh_vec[0], std::move(jacobian_assembler),
1257 _local_coordinate_system, integration_order,
1258 process_config, _media);
1259 break;
1260 case 3:
1263 name, *_mesh_vec[0], std::move(jacobian_assembler),
1265 _local_coordinate_system, integration_order,
1266 process_config, _media);
1267 break;
1268 }
1269 }
1270 else
1271#endif
1272#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1273 if (type == "THERMO_RICHARDS_FLOW")
1274 {
1275 process =
1277 name, *_mesh_vec[0], std::move(jacobian_assembler),
1278 _process_variables, _parameters, integration_order,
1279 process_config, _media);
1280 }
1281 else
1282#endif
1283#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1284 if (type == "THERMO_RICHARDS_MECHANICS")
1285 {
1286 switch (_mesh_vec[0]->getDimension())
1287 {
1288 case 2:
1291 name, *_mesh_vec[0], std::move(jacobian_assembler),
1293 _local_coordinate_system, integration_order,
1294 process_config, _media);
1295 break;
1296 case 3:
1299 name, *_mesh_vec[0], std::move(jacobian_assembler),
1301 _local_coordinate_system, integration_order,
1302 process_config, _media);
1303 break;
1304 }
1305 }
1306 else
1307#endif
1308
1309#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1310 if (type == "TWOPHASE_FLOW_PP")
1311 {
1312 process =
1314 name, *_mesh_vec[0], std::move(jacobian_assembler),
1315 _process_variables, _parameters, integration_order,
1316 process_config, _media);
1317 }
1318 else
1319#endif
1320#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1321 if (type == "TWOPHASE_FLOW_PRHO")
1322 {
1323 WARN(
1324 "The TWOPHASE_FLOW_PRHO process is deprecated and will be "
1325 "removed in OGS-6.5.5.");
1328 name, *_mesh_vec[0], std::move(jacobian_assembler),
1329 _process_variables, _parameters, integration_order,
1330 process_config, _media);
1331 }
1332 else
1333#endif
1334#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1335 if (type == "THERMAL_TWOPHASE_WITH_PP")
1336 {
1339 name, *_mesh_vec[0], std::move(jacobian_assembler),
1340 _process_variables, _parameters, integration_order,
1341 process_config, _media);
1342 }
1343 else
1344#endif
1345 {
1346 OGS_FATAL("Unknown process type: {:s}", type);
1347 }
1348
1349 if (ranges::contains(_processes, name,
1350 [](std::unique_ptr<ProcessLib::Process> const& p)
1351 { return p->name; }))
1352 {
1353 OGS_FATAL("The process name '{:s}' is not unique.", name);
1354 }
1355 _processes.push_back(std::move(process));
1356 }
1357}
1358
1360 std::string const& output_directory)
1361{
1362 DBUG("Reading time loop configuration.");
1363
1364 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1365 std::begin(_process_variables),
1366 std::end(_process_variables),
1367 [](auto const& process_variable)
1368 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1369
1371 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1372 compensate_non_equilibrium_initial_residuum);
1373
1374 if (!_time_loop)
1375 {
1376 OGS_FATAL("Initialization of time loop failed.");
1377 }
1378}
1379
1381{
1382 DBUG("Reading linear solver configuration.");
1383
1385 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1386 {
1388 auto const name = conf.getConfigParameter<std::string>("name");
1389 auto const linear_solver_parser =
1391 auto const solver_options =
1392 linear_solver_parser.parseNameAndOptions("", &conf);
1393
1396 name,
1397 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1398 std::get<1>(solver_options)),
1399 "The linear solver name is not unique");
1400 }
1401}
1402
1404{
1405 DBUG("Reading non-linear solver configuration.");
1406
1408 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1409 {
1410 auto const ls_name =
1412 conf.getConfigParameter<std::string>("linear_solver");
1413 auto const& linear_solver = BaseLib::getOrError(
1414 _linear_solvers, ls_name,
1415 "A linear solver with the given name does not exist.");
1416
1418 auto const name = conf.getConfigParameter<std::string>("name");
1421 name,
1422 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1423 "The nonlinear solver name is not unique");
1424 }
1425}
1426
1427void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1428{
1429 if (!config)
1430 {
1431 return;
1432 }
1433
1434 DBUG("Reading curves configuration.");
1435
1437 for (auto conf : config->getConfigSubtreeList("curve"))
1438 {
1440 auto const name = conf.getConfigParameter<std::string>("name");
1442 _curves,
1443 name,
1446 "The curve name is not unique.");
1447 }
1448}
1449
1450MeshLib::Mesh& ProjectData::getMesh(std::string const& mesh_name) const
1451{
1452 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1453}
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
std::vector< PolylineVec * > const & getPolylines() const
Read access to polylines w/o using a name.
Definition GEOObjects.h:299
std::vector< PointVec * > const & getPoints() const
Read access to points w/o using a name.
Definition GEOObjects.h:297
std::vector< SurfaceVec * > const & getSurfaces() const
Read access to surfaces w/o using a name.
Definition GEOObjects.h:301
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:231
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)
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 > 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