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_THERMORICHARDSMECHANICS
108#endif
109
110#ifdef OGS_BUILD_PROCESS_PHASEFIELD
112#endif
113#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
115#endif
116#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
118#endif
119#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
121#endif
122#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
124#endif
125#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
127#endif
128#ifdef OGS_BUILD_PROCESS_TH2M
130#endif
131#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
133#endif
134#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
136#endif
137#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
139#endif
140#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
142#endif
143#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
145#endif
146
147namespace
148{
149void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects,
150 std::string const& dir_first, std::string const& dir_second)
151{
152 DBUG("Reading geometry file '{:s}'.", fname);
153 GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
154 std::string geometry_file = BaseLib::joinPaths(dir_first, fname);
155 if (!BaseLib::IsFileExisting(geometry_file))
156 {
157 // Fallback to reading gml from prj-file directory
158 geometry_file = BaseLib::joinPaths(dir_second, fname);
159 WARN("File {:s} not found in {:s}! Trying reading from {:s}.", fname,
160 dir_first, dir_second);
161 if (!BaseLib::IsFileExisting(geometry_file))
162 {
163 OGS_FATAL("Could not read geometry file {:s} in {:s}.", fname,
164 dir_second);
165 }
166 }
167 gml_reader.readFile(geometry_file);
168}
169
170std::unique_ptr<MeshLib::Mesh> readSingleMesh(
171 BaseLib::ConfigTree const& mesh_config_parameter,
172 std::string const& directory)
173{
174 std::string const mesh_file = BaseLib::joinPaths(
175 directory, mesh_config_parameter.getValue<std::string>());
176 DBUG("Reading mesh file '{:s}'.", mesh_file);
177
178 auto mesh = std::unique_ptr<MeshLib::Mesh>(MeshLib::IO::readMeshFromFile(
179 mesh_file, true /* compute_element_neighbors */));
180 if (!mesh)
181 {
182 std::filesystem::path abspath{mesh_file};
183 try
184 {
185 abspath = std::filesystem::absolute(mesh_file);
186 }
187 catch (std::filesystem::filesystem_error const& e)
188 {
189 ERR("Determining the absolute path of '{}' failed: {}", mesh_file,
190 e.what());
191 }
192
193 OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
194 abspath.string());
195 }
196
197#ifdef DOXYGEN_DOCU_ONLY
199 mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
200#endif // DOXYGEN_DOCU_ONLY
201
202 if (auto const axially_symmetric =
204 mesh_config_parameter.getConfigAttributeOptional<bool>(
205 "axially_symmetric"))
206 {
207 mesh->setAxiallySymmetric(*axially_symmetric);
208 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
209 {
210 OGS_FATAL("3D mesh cannot be axially symmetric.");
211 }
212 }
213
214 return mesh;
215}
216
217std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
218 BaseLib::ConfigTree const& config, std::string const& directory,
219 std::string const& project_directory)
220{
221 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
222
223 GeoLib::GEOObjects geoObjects;
224
226 auto optional_meshes = config.getConfigSubtreeOptional("meshes");
227 if (optional_meshes)
228 {
229 DBUG("Reading multiple meshes.");
231 auto const configs = optional_meshes->getConfigParameterList("mesh");
232 std::transform(configs.begin(), configs.end(),
233 std::back_inserter(meshes),
234 [&directory](auto const& mesh_config)
235 { return readSingleMesh(mesh_config, directory); });
236 if (auto const geometry_file_name =
238 config.getConfigParameterOptional<std::string>("geometry"))
239 {
240 readGeometry(*geometry_file_name, geoObjects, directory,
241 project_directory);
242 }
243 }
244 else
245 { // Read single mesh with geometry.
246 meshes.push_back(
248 readSingleMesh(config.getConfigParameter("mesh"), directory));
249
250 auto const geometry_file_name =
252 config.getConfigParameter<std::string>("geometry");
253 readGeometry(geometry_file_name, geoObjects, directory,
254 project_directory);
255 }
256
257 if (!geoObjects.getPoints().empty() || !geoObjects.getPolylines().empty() ||
258 !geoObjects.getSurfaces().empty())
259 { // generate meshes from geometries
260 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
262 bool const multiple_nodes_allowed = false;
263 auto additional_meshes =
265 geoObjects, *meshes[0], std::move(search_length_algorithm),
266 multiple_nodes_allowed);
267
268 std::move(begin(additional_meshes), end(additional_meshes),
269 std::back_inserter(meshes));
270 }
271
272 auto mesh_names = MeshLib::views::names | ranges::to<std::vector>() |
273 ranges::actions::sort;
274 auto const sorted_names = meshes | mesh_names;
275 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
276 if (unique_names.size() < sorted_names.size())
277 {
278 WARN(
279 "Mesh names aren't unique. From project file read mesh names are:");
280 for (auto const& name : meshes | MeshLib::views::names)
281 {
282 INFO("- {}", name);
283 }
284 }
285
286 auto const zero_mesh_field_data_by_material_ids =
288 config.getConfigParameterOptional<std::vector<int>>(
289 "zero_mesh_field_data_by_material_ids");
290 if (zero_mesh_field_data_by_material_ids)
291 {
292 WARN(
293 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
294 "name may be changed, or it may be removed due to its "
295 "corresponding feature becomes a single tool. Please use it with "
296 "care!");
298 *meshes[0], *zero_mesh_field_data_by_material_ids);
299 }
300
302
303 return meshes;
304}
305
306std::vector<GeoLib::NamedRaster> readRasters(
307 BaseLib::ConfigTree const& config, std::string const& raster_directory,
308 GeoLib::MinMaxPoints const& min_max_points)
309{
310 INFO("readRasters ...");
311 std::vector<GeoLib::NamedRaster> named_rasters;
312
314 auto optional_rasters = config.getConfigSubtreeOptional("rasters");
315 if (optional_rasters)
316 {
318 auto const configs = optional_rasters->getConfigSubtreeList("raster");
319 std::transform(
320 configs.begin(), configs.end(), std::back_inserter(named_rasters),
321 [&raster_directory, &min_max_points](auto const& raster_config)
322 {
323 return GeoLib::IO::readRaster(raster_config, raster_directory,
324 min_max_points);
325 });
326 }
327 INFO("readRasters done");
328 return named_rasters;
329}
330
331// for debugging raster reading implementation
332// void writeRasters(std::vector<GeoLib::NamedRaster> const& named_rasters,
333// std::string const& output_directory)
334//{
335// for (auto const& named_raster : named_rasters)
336// {
337// #if defined(USE_PETSC)
338// int my_mpi_rank;
339// MPI_Comm_rank(MPI_COMM_WORLD, &my_mpi_rank);
340// #endif
341// FileIO::AsciiRasterInterface::writeRasterAsASC(
342// named_raster.raster, output_directory + "/" +
343// named_raster.raster_name +
344// #if defined(USE_PETSC)
345// "_" + std::to_string(my_mpi_rank) +
346// #endif
347// ".asc");
348// }
349//}
350
351} // namespace
352
353ProjectData::ProjectData() = default;
354
356 std::string const& project_directory,
357 std::string const& output_directory,
358 std::string const& mesh_directory,
359 [[maybe_unused]] std::string const& script_directory)
360 : _mesh_vec(readMeshes(project_config, mesh_directory, project_directory)),
361 _named_rasters(readRasters(project_config, project_directory,
362 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
363 _mesh_vec[0]->getNodes().end())
364 .getMinMaxPoints()))
365{
366 // for debugging raster reading implementation
367 // writeRasters(_named_rasters, output_directory);
368 if (auto const python_script =
370 project_config.getConfigParameterOptional<std::string>("python_script"))
371 {
372 namespace py = pybind11;
373
374#ifdef OGS_EMBED_PYTHON_INTERPRETER
375 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
376#endif
377
378 // Append to python's module search path
379 auto py_path = py::module::import("sys").attr("path");
380 py_path.attr("append")(script_directory); // .prj or -s directory
381
382 auto const script_path =
383 BaseLib::joinPaths(script_directory, *python_script);
384
385 // Evaluate in scope of main module
386 py::object scope = py::module::import("__main__").attr("__dict__");
387 // add (global) variables
388 auto globals = py::dict(scope);
389 globals["ogs_prj_directory"] = project_directory;
390 globals["ogs_mesh_directory"] = mesh_directory;
391 globals["ogs_script_directory"] = script_directory;
392 try
393 {
394 py::eval_file(script_path, scope);
395 }
396 catch (py::error_already_set const& e)
397 {
398 OGS_FATAL("Error evaluating python script {}: {}", script_path,
399 e.what());
400 }
401 }
402
404 parseCurves(project_config.getConfigSubtreeOptional("curves"));
405
406 auto parameter_names_for_transformation =
408 parseParameters(project_config.getConfigSubtree("parameters"));
409
412 project_config.getConfigSubtreeOptional("local_coordinate_system"),
414
415 for (auto& parameter : _parameters)
416 {
417 if (std::find(begin(parameter_names_for_transformation),
418 end(parameter_names_for_transformation),
419 parameter->name) !=
420 end(parameter_names_for_transformation))
421 {
423 {
424 OGS_FATAL(
425 "The parameter '{:s}' is using the local coordinate system "
426 "but no local coordinate system was provided.",
427 parameter->name);
428 }
429 parameter->setCoordinateSystem(*_local_coordinate_system);
430 }
431
432 parameter->initialize(_parameters);
433 }
434
436 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
437
439 parseMedia(project_config.getConfigSubtreeOptional("media"));
440
442 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
443
444 auto chemical_solver_interface = parseChemicalSolverInterface(
446 project_config.getConfigSubtreeOptional("chemical_system"),
447 output_directory);
448
450 parseProcesses(project_config.getConfigSubtree("processes"),
451 project_directory, output_directory,
452 std::move(chemical_solver_interface));
453
455 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
456
458 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
459 output_directory);
460}
461
463 BaseLib::ConfigTree const& process_variables_config)
464{
465 DBUG("Parse process variables:");
466
467 std::set<std::string> names;
468
469 for (auto var_config
471 : process_variables_config.getConfigSubtreeList("process_variable"))
472 {
473 // Either the mesh name is given, or the first mesh's name will be
474 // taken. Taking the first mesh's value is deprecated.
475 auto const mesh_name =
477 var_config.getConfigParameter<std::string>("mesh",
478 _mesh_vec[0]->getName());
479
480 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
481
482 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
484 if (!names.insert(pv.getName()).second)
485 {
486 OGS_FATAL("A process variable with name `{:s}' already exists.",
487 pv.getName());
488 }
489
490 _process_variables.push_back(std::move(pv));
491 }
492}
493
494std::vector<std::string> ProjectData::parseParameters(
495 BaseLib::ConfigTree const& parameters_config)
496{
497 using namespace ProcessLib;
498
499 std::set<std::string> names;
500 std::vector<std::string> parameter_names_for_transformation;
501
502 DBUG("Reading parameters:");
503 for (auto parameter_config :
505 parameters_config.getConfigSubtreeList("parameter"))
506 {
507 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
509 if (!names.insert(p->name).second)
510 {
511 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
512 }
513
514 auto const use_local_coordinate_system =
516 parameter_config.getConfigParameterOptional<bool>(
517 "use_local_coordinate_system");
518 if (!!use_local_coordinate_system && *use_local_coordinate_system)
519 {
520 parameter_names_for_transformation.push_back(p->name);
521 }
522
523 _parameters.push_back(std::move(p));
524 }
525
526 _parameters.push_back(
529 _parameters.push_back(
532
533 return parameter_names_for_transformation;
534}
535
537 std::optional<BaseLib::ConfigTree> const& media_config)
538{
539 if (!media_config)
540 {
541 return;
542 }
543
544 DBUG("Reading media:");
545
546 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
547 {
548 ERR("A mesh is required to define medium materials.");
549 return;
550 }
551
552 for (auto const& medium_config :
554 media_config->getConfigSubtreeList("medium"))
555 {
556 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
557 &medium_config, this](int const id)
558 {
560 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
562 _curves);
563 };
564
565 auto const material_id_string =
567 medium_config.getConfigAttribute<std::string>("id", "0");
568
569 std::vector<int> const material_ids_of_this_medium =
570 MaterialLib::parseMaterialIdString(material_id_string,
571 materialIDs(*_mesh_vec[0]));
572
573 for (auto const& id : material_ids_of_this_medium)
574 {
576 id, _media, material_ids_of_this_medium, create_medium);
577 }
578 }
579
580 if (_media.empty())
581 {
582 OGS_FATAL("No entity is found inside <media>.");
583 }
584}
585
586std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
588 std::optional<BaseLib::ConfigTree> const& config,
589 std::string const& output_directory)
590{
591 if (!config)
592 {
593 return nullptr;
594 }
595
596 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
597 chemical_solver_interface;
598#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
599 INFO(
600 "Ready for initializing interface to a chemical solver for water "
601 "chemistry calculation.");
602
603 auto const chemical_solver =
605 config->getConfigAttribute<std::string>("chemical_solver");
606
607 if (boost::iequals(chemical_solver, "Phreeqc"))
608 {
609 INFO(
610 "Configuring phreeqc interface for water chemistry calculation "
611 "using file-based approach.");
612
613 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
615 *config, output_directory);
616 }
617 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
618 {
619 OGS_FATAL(
620 "The chemical solver option of PhreeqcKernel is not accessible for "
621 "the time being. Please set 'Phreeqc'' as the chemical solver for "
622 "reactive transport modeling.");
623 }
624 else if (boost::iequals(chemical_solver, "SelfContained"))
625 {
626 INFO(
627 "Use self-contained chemical solver for water chemistry "
628 "calculation.");
629
630 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
632 _mesh_vec, _linear_solvers, *config, output_directory);
633 }
634 else
635 {
636 OGS_FATAL(
637 "Unknown chemical solver. Please specify either Phreeqc or "
638 "PhreeqcKernel as the solver for water chemistry calculation "
639 "instead.");
640 }
641#else
642 (void)output_directory;
643
644 OGS_FATAL(
645 "Found the type of the process to be solved is not component transport "
646 "process. Please specify the process type to ComponentTransport. At "
647 "the present, water chemistry calculation is only available for "
648 "component transport process.");
649#endif
650 return chemical_solver_interface;
651}
652
654 BaseLib::ConfigTree const& processes_config,
655 std::string const& project_directory,
656 std::string const& output_directory,
657 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
658 chemical_solver_interface)
659{
660 (void)project_directory; // to avoid compilation warning
661 (void)output_directory; // to avoid compilation warning
662
663 DBUG("Reading processes:");
665 for (auto process_config : processes_config.getConfigSubtreeList("process"))
666 {
667 auto const type =
669 process_config.peekConfigParameter<std::string>("type");
670
671 auto const name =
673 process_config.getConfigParameter<std::string>("name");
674
675 [[maybe_unused]] auto const integration_order =
677 process_config.getConfigParameter<int>("integration_order");
678
679 std::unique_ptr<ProcessLib::Process> process;
680
681 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
683 process_config.getConfigSubtreeOptional("jacobian_assembler"));
684
685#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
686 if (type == "STEADY_STATE_DIFFUSION")
687 {
688 // The existence check of the in the configuration referenced
689 // process variables is checked in the physical process.
690 // TODO at the moment we have only one mesh, later there can be
691 // several meshes. Then we have to assign the referenced mesh
692 // here.
693 process =
695 name, *_mesh_vec[0], std::move(jacobian_assembler),
696 _process_variables, _parameters, integration_order,
697 process_config, _mesh_vec, _media);
698 }
699 else
700#endif
701#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
702 if (type == "LIQUID_FLOW")
703 {
705 name, *_mesh_vec[0], std::move(jacobian_assembler),
706 _process_variables, _parameters, integration_order,
707 process_config, _mesh_vec, _media);
708 }
709 else
710#endif
711#ifdef OGS_BUILD_PROCESS_TH2M
712 if (type == "TH2M")
713 {
714 switch (_mesh_vec[0]->getDimension())
715 {
716 case 2:
718 name, *_mesh_vec[0], std::move(jacobian_assembler),
720 _local_coordinate_system, integration_order,
721 process_config, _media);
722 break;
723 case 3:
725 name, *_mesh_vec[0], std::move(jacobian_assembler),
727 _local_coordinate_system, integration_order,
728 process_config, _media);
729 break;
730 default:
731 OGS_FATAL("TH2M process does not support given dimension");
732 }
733 }
734 else
735#endif
736#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
737 if (type == "HEAT_CONDUCTION")
738 {
740 name, *_mesh_vec[0], std::move(jacobian_assembler),
741 _process_variables, _parameters, integration_order,
742 process_config, _media);
743 }
744 else
745#endif
746#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
747 if (type == "HEAT_TRANSPORT_BHE")
748 {
749 if (_mesh_vec[0]->getDimension() != 3)
750 {
751 OGS_FATAL(
752 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
753 "mesh! ");
754 }
755
756 process =
758 name, *_mesh_vec[0], std::move(jacobian_assembler),
759 _process_variables, _parameters, integration_order,
760 process_config, _curves, _media);
761 }
762 else
763#endif
764#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
765 if (type == "WELLBORE_SIMULATOR")
766 {
767 if (_mesh_vec[0]->getDimension() != 1)
768 {
769 OGS_FATAL(
770 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
771 "mesh!");
772 }
773
774 process =
776 name, *_mesh_vec[0], std::move(jacobian_assembler),
777 _process_variables, _parameters, integration_order,
778 process_config, _media);
779 }
780 else
781#endif
782#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
783 if (type == "HYDRO_MECHANICS")
784 {
785 if (
786 process_config.getConfigParameterOptional<int>("dimension"))
787 {
788 OGS_FATAL(
789 "The 'dimension' tag has been removed in the merge-request "
790 "!4766. The dimension is now taken from the main mesh and "
791 "the tag must be removed. There is a python script in the "
792 "merge-request description for automatic conversion.");
793 }
794 switch (_mesh_vec[0]->getDimension())
795 {
796 case 2:
797 process =
799 2>(name, *_mesh_vec[0],
800 std::move(jacobian_assembler),
802 _local_coordinate_system, integration_order,
803 process_config, _media);
804 break;
805 case 3:
806 process =
808 3>(name, *_mesh_vec[0],
809 std::move(jacobian_assembler),
811 _local_coordinate_system, integration_order,
812 process_config, _media);
813 break;
814 default:
815 OGS_FATAL(
816 "HYDRO_MECHANICS process does not support given "
817 "dimension");
818 }
819 }
820 else
821#endif
822#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
823 if (type == "LARGE_DEFORMATION")
824 {
825 switch (_mesh_vec[0]->getDimension())
826 {
827 case 2:
830 name, *_mesh_vec[0], std::move(jacobian_assembler),
832 _local_coordinate_system, integration_order,
833 process_config, _media);
834 break;
835 case 3:
838 name, *_mesh_vec[0], std::move(jacobian_assembler),
840 _local_coordinate_system, integration_order,
841 process_config, _media);
842 break;
843 default:
844 OGS_FATAL(
845 "LARGE_DEFORMATION process does not support given "
846 "dimension");
847 }
848 }
849 else
850#endif
851#ifdef OGS_BUILD_PROCESS_LIE_HM
852 if (type == "HYDRO_MECHANICS_WITH_LIE")
853 {
854 if (
855 process_config.getConfigParameterOptional<int>("dimension"))
856 {
857 OGS_FATAL(
858 "The 'dimension' tag has been removed in the merge-request "
859 "!4766."
860 "The dimension is now taken from the main mesh and the tag "
861 "must be"
862 "removed. There is a python script in the merge-request "
863 "description"
864 "for automatic conversion.");
865 }
866 switch (_mesh_vec[0]->getDimension())
867 {
868 case 2:
871 name, *_mesh_vec[0], std::move(jacobian_assembler),
873 _local_coordinate_system, integration_order,
874 process_config, _media);
875 break;
876 case 3:
879 name, *_mesh_vec[0], std::move(jacobian_assembler),
881 _local_coordinate_system, integration_order,
882 process_config, _media);
883 break;
884 default:
885 OGS_FATAL(
886 "HYDRO_MECHANICS_WITH_LIE process does not support "
887 "given dimension");
888 }
889 }
890 else
891#endif
892#ifdef OGS_BUILD_PROCESS_HT
893 if (type == "HT")
894 {
896 name, *_mesh_vec[0], std::move(jacobian_assembler),
897 _process_variables, _parameters, integration_order,
898 process_config, _mesh_vec, _media);
899 }
900 else
901#endif
902#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
903 if (type == "ComponentTransport")
904 {
905 process =
907 name, *_mesh_vec[0], std::move(jacobian_assembler),
908 _process_variables, _parameters, integration_order,
909 process_config, _mesh_vec, _media,
910 std::move(chemical_solver_interface));
911 }
912 else
913#endif
914#ifdef OGS_BUILD_PROCESS_PHASEFIELD
915 if (type == "PHASE_FIELD")
916 {
917 switch (_mesh_vec[0]->getDimension())
918 {
919 case 2:
920 process =
922 name, *_mesh_vec[0], std::move(jacobian_assembler),
924 _local_coordinate_system, integration_order,
925 process_config);
926 break;
927 case 3:
928 process =
930 name, *_mesh_vec[0], std::move(jacobian_assembler),
932 _local_coordinate_system, integration_order,
933 process_config);
934 break;
935 }
936 }
937 else
938#endif
939#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
940 if (type == "HM_PHASE_FIELD")
941 {
942 switch (_mesh_vec[0]->getDimension())
943 {
944 case 2:
945 process =
947 name, *_mesh_vec[0], std::move(jacobian_assembler),
949 _local_coordinate_system, integration_order,
950 process_config, _media);
951 break;
952 case 3:
953 process =
955 name, *_mesh_vec[0], std::move(jacobian_assembler),
957 _local_coordinate_system, integration_order,
958 process_config, _media);
959 break;
960 }
961 }
962 else
963#endif
964#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
965 if (type == "RichardsComponentTransport")
966 {
969 name, *_mesh_vec[0], std::move(jacobian_assembler),
970 _process_variables, _parameters, integration_order,
971 process_config, _media);
972 }
973 else
974#endif
975#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
976 if (type == "SMALL_DEFORMATION")
977 {
978 switch (_mesh_vec[0]->getDimension())
979 {
980 case 2:
983 name, *_mesh_vec[0], std::move(jacobian_assembler),
985 _local_coordinate_system, integration_order,
986 process_config, _media);
987 break;
988 case 3:
991 name, *_mesh_vec[0], std::move(jacobian_assembler),
993 _local_coordinate_system, integration_order,
994 process_config, _media);
995 break;
996 default:
997 OGS_FATAL(
998 "SMALL_DEFORMATION process does not support given "
999 "dimension");
1000 }
1001 }
1002 else
1003#endif
1004#ifdef OGS_BUILD_PROCESS_LIE_M
1005 if (type == "SMALL_DEFORMATION_WITH_LIE")
1006 {
1007 if (
1008 process_config.getConfigParameterOptional<int>("dimension"))
1009 {
1010 OGS_FATAL(
1011 "The 'dimension' tag has been removed in the merge-request "
1012 "!4766."
1013 "The dimension is now taken from the main mesh and the tag "
1014 "must be"
1015 "removed. There is a python script in the merge-request "
1016 "description"
1017 "for automatic conversion.");
1018 }
1019 switch (_mesh_vec[0]->getDimension())
1020 {
1021 case 2:
1024 name, *_mesh_vec[0], std::move(jacobian_assembler),
1026 _local_coordinate_system, integration_order,
1027 process_config);
1028 break;
1029 case 3:
1032 name, *_mesh_vec[0], std::move(jacobian_assembler),
1034 _local_coordinate_system, integration_order,
1035 process_config);
1036 break;
1037 default:
1038 OGS_FATAL(
1039 "SMALL_DEFORMATION_WITH_LIE process does not support "
1040 "given dimension");
1041 }
1042 }
1043 else
1044#endif
1045#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1046 if (type == "THERMO_HYDRO_MECHANICS")
1047 {
1048 if (
1049 process_config.getConfigParameterOptional<int>("dimension"))
1050 {
1051 OGS_FATAL(
1052 "The 'dimension' tag has been removed in the merge-request "
1053 "!4766."
1054 "The dimension is now taken from the main mesh and the tag "
1055 "must be"
1056 "removed. There is a python script in the merge-request "
1057 "description"
1058 "for automatic conversion.");
1059 }
1060 switch (_mesh_vec[0]->getDimension())
1061 {
1062 case 2:
1065 name, *_mesh_vec[0], std::move(jacobian_assembler),
1067 _local_coordinate_system, integration_order,
1068 process_config, _media);
1069 break;
1070 case 3:
1073 name, *_mesh_vec[0], std::move(jacobian_assembler),
1075 _local_coordinate_system, integration_order,
1076 process_config, _media);
1077 break;
1078 default:
1079 OGS_FATAL(
1080 "THERMO_HYDRO_MECHANICS process does not support given "
1081 "dimension");
1082 }
1083 }
1084 else
1085#endif
1086#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1087 if (type == "THERMO_MECHANICS")
1088 {
1089 switch (_mesh_vec[0]->getDimension())
1090 {
1091 case 2:
1094 name, *_mesh_vec[0], std::move(jacobian_assembler),
1096 _local_coordinate_system, integration_order,
1097 process_config, _media);
1098 break;
1099 case 3:
1102 name, *_mesh_vec[0], std::move(jacobian_assembler),
1104 _local_coordinate_system, integration_order,
1105 process_config, _media);
1106 break;
1107 }
1108 }
1109 else
1110#endif
1111#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1112 if (type == "RICHARDS_FLOW")
1113 {
1115 name, *_mesh_vec[0], std::move(jacobian_assembler),
1116 _process_variables, _parameters, integration_order,
1117 process_config, _media);
1118 }
1119 else
1120#endif
1121#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1122 if (type == "RICHARDS_MECHANICS")
1123 {
1124 if (
1125 process_config.getConfigParameterOptional<int>("dimension"))
1126 {
1127 OGS_FATAL(
1128 "The 'dimension' tag has been removed in the merge-request "
1129 "!4766."
1130 "The dimension is now taken from the main mesh and the tag "
1131 "must be"
1132 "removed. There is a python script in the merge-request "
1133 "description"
1134 "for automatic conversion.");
1135 }
1136 switch (_mesh_vec[0]->getDimension())
1137 {
1138 case 2:
1141 name, *_mesh_vec[0], std::move(jacobian_assembler),
1143 _local_coordinate_system, integration_order,
1144 process_config, _media);
1145 break;
1146 case 3:
1149 name, *_mesh_vec[0], std::move(jacobian_assembler),
1151 _local_coordinate_system, integration_order,
1152 process_config, _media);
1153 break;
1154 }
1155 }
1156 else
1157#endif
1158#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1159 if (type == "THERMO_RICHARDS_FLOW")
1160 {
1161 process =
1163 name, *_mesh_vec[0], std::move(jacobian_assembler),
1164 _process_variables, _parameters, integration_order,
1165 process_config, _media);
1166 }
1167 else
1168#endif
1169#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1170 if (type == "THERMO_RICHARDS_MECHANICS")
1171 {
1172 switch (_mesh_vec[0]->getDimension())
1173 {
1174 case 2:
1177 name, *_mesh_vec[0], std::move(jacobian_assembler),
1179 _local_coordinate_system, integration_order,
1180 process_config, _media);
1181 break;
1182 case 3:
1185 name, *_mesh_vec[0], std::move(jacobian_assembler),
1187 _local_coordinate_system, integration_order,
1188 process_config, _media);
1189 break;
1190 }
1191 }
1192 else
1193#endif
1194
1195#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1196 if (type == "TWOPHASE_FLOW_PP")
1197 {
1198 process =
1200 name, *_mesh_vec[0], std::move(jacobian_assembler),
1201 _process_variables, _parameters, integration_order,
1202 process_config, _media);
1203 }
1204 else
1205#endif
1206#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1207 if (type == "THERMAL_TWOPHASE_WITH_PP")
1208 {
1211 name, *_mesh_vec[0], std::move(jacobian_assembler),
1212 _process_variables, _parameters, integration_order,
1213 process_config, _media);
1214 }
1215 else
1216#endif
1217 {
1218 OGS_FATAL("Unknown process type: {:s}", type);
1219 }
1220
1221 if (ranges::contains(_processes, name,
1222 [](std::unique_ptr<ProcessLib::Process> const& p)
1223 { return p->name; }))
1224 {
1225 OGS_FATAL("The process name '{:s}' is not unique.", name);
1226 }
1227 _processes.push_back(std::move(process));
1228 }
1229}
1230
1232 std::string const& output_directory)
1233{
1234 DBUG("Reading time loop configuration.");
1235
1236 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1237 std::begin(_process_variables),
1238 std::end(_process_variables),
1239 [](auto const& process_variable)
1240 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1241
1243 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1244 compensate_non_equilibrium_initial_residuum);
1245
1246 if (!_time_loop)
1247 {
1248 OGS_FATAL("Initialization of time loop failed.");
1249 }
1250}
1251
1253{
1254 DBUG("Reading linear solver configuration.");
1255
1257 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1258 {
1260 auto const name = conf.getConfigParameter<std::string>("name");
1261 auto const linear_solver_parser =
1263 auto const solver_options =
1264 linear_solver_parser.parseNameAndOptions("", &conf);
1265
1268 name,
1269 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1270 std::get<1>(solver_options)),
1271 "The linear solver name is not unique");
1272 }
1273}
1274
1276{
1277 DBUG("Reading non-linear solver configuration.");
1278
1280 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1281 {
1282 auto const ls_name =
1284 conf.getConfigParameter<std::string>("linear_solver");
1285 auto const& linear_solver = BaseLib::getOrError(
1286 _linear_solvers, ls_name,
1287 "A linear solver with the given name does not exist.");
1288
1290 auto const name = conf.getConfigParameter<std::string>("name");
1293 name,
1294 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1295 "The nonlinear solver name is not unique");
1296 }
1297}
1298
1299void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1300{
1301 if (!config)
1302 {
1303 return;
1304 }
1305
1306 DBUG("Reading curves configuration.");
1307
1309 for (auto conf : config->getConfigSubtreeList("curve"))
1310 {
1312 auto const name = conf.getConfigParameter<std::string>("name");
1314 _curves,
1315 name,
1318 "The curve name is not unique.");
1319 }
1320}
1321
1322MeshLib::Mesh& ProjectData::getMesh(std::string const& mesh_name) const
1323{
1324 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1325}
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:48
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 > createSmallDeformationProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createSmallDeformationProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createSteadyStateDiffusion(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createTH2MProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createTH2MProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createThermalTwoPhaseFlowWithPPProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoHydroMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoHydroMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createThermoRichardsFlowProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createTwoPhaseFlowWithPPProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createWellboreSimulatorProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< TimeLoop > createTimeLoop(BaseLib::ConfigTree const &config, std::string const &output_directory, const std::vector< std::unique_ptr< Process > > &processes, const std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > &nonlinear_solvers, std::vector< std::unique_ptr< MeshLib::Mesh > > &meshes, bool const compensate_non_equilibrium_initial_residuum)
Builds a TimeLoop from the given configuration.
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(std::optional< BaseLib::ConfigTree > const &config)
std::vector< 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