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 <set>
27
28#include "BaseLib/Algorithm.h"
29#include "BaseLib/ConfigTree.h"
30#include "BaseLib/FileTools.h"
31#include "BaseLib/Logging.h"
32#include "BaseLib/StringTools.h"
33#include "GeoLib/GEOObjects.h"
36#include "GeoLib/Raster.h"
37#include "InfoLib/CMakeInfo.h"
40#if defined(USE_LIS)
42#elif defined(USE_PETSC)
44#else
46#endif
50#include "MeshLib/Mesh.h"
56
57// FileIO
62#include "ParameterLib/Utils.h"
64#include "ProcessLib/TimeLoop.h"
65
66#ifdef OGS_EMBED_PYTHON_INTERPRETER
68#endif
69
70#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
73#endif
74#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
76#endif
77#ifdef OGS_BUILD_PROCESS_HT
79#endif
80#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
82#endif
83#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
85#endif
86#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
88#endif
89#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
91#endif
92#ifdef OGS_BUILD_PROCESS_LIE
95#endif
96#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
98#endif
99#ifdef OGS_BUILD_PROCESS_STOKESFLOW
101#endif
102
103#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
105#endif
106
107#ifdef OGS_BUILD_PROCESS_PHASEFIELD
109#endif
110#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
112#endif
113#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
115#endif
116#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
118#endif
119#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
121#endif
122#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
124#endif
125#ifdef OGS_BUILD_PROCESS_TES
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_THERMOMECHANICALPHASEFIELD
139#endif
140#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
142#endif
143#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
145#endif
146#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
148#endif
149#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
151#endif
152
153namespace
154{
155void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects,
156 std::string const& dir_first, std::string const& dir_second)
157{
158 DBUG("Reading geometry file '{:s}'.", fname);
159 GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
160 std::string geometry_file = BaseLib::copyPathToFileName(fname, dir_first);
161 if (!BaseLib::IsFileExisting(geometry_file))
162 {
163 // Fallback to reading gml from prj-file directory
164 geometry_file = BaseLib::copyPathToFileName(fname, dir_second);
165 WARN("File {:s} not found in {:s}! Trying reading from {:s}.", fname,
166 dir_first, dir_second);
167 if (!BaseLib::IsFileExisting(geometry_file))
168 {
169 OGS_FATAL("Could not read geometry file {:s} in {:s}.", fname,
170 dir_second);
171 }
172 }
173 gml_reader.readFile(geometry_file);
174}
175
176std::unique_ptr<MeshLib::Mesh> readSingleMesh(
177 BaseLib::ConfigTree const& mesh_config_parameter,
178 std::string const& directory)
179{
180 std::string const mesh_file = BaseLib::copyPathToFileName(
181 mesh_config_parameter.getValue<std::string>(), directory);
182 DBUG("Reading mesh file '{:s}'.", mesh_file);
183
184 auto mesh = std::unique_ptr<MeshLib::Mesh>(MeshLib::IO::readMeshFromFile(
185 mesh_file, true /* compute_element_neighbors */));
186 if (!mesh)
187 {
188 OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
189 mesh_file);
190 }
191
192#ifdef DOXYGEN_DOCU_ONLY
194 mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
195#endif // DOXYGEN_DOCU_ONLY
196
197 if (auto const axially_symmetric =
199 mesh_config_parameter.getConfigAttributeOptional<bool>(
200 "axially_symmetric"))
201 {
202 mesh->setAxiallySymmetric(*axially_symmetric);
203 }
204
205 return mesh;
206}
207
208std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
209 BaseLib::ConfigTree const& config, std::string const& directory,
210 std::string const& project_directory)
211{
212 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
213
214 GeoLib::GEOObjects geoObjects;
215
217 auto optional_meshes = config.getConfigSubtreeOptional("meshes");
218 if (optional_meshes)
219 {
220 DBUG("Reading multiple meshes.");
222 auto const configs = optional_meshes->getConfigParameterList("mesh");
223 std::transform(configs.begin(), configs.end(),
224 std::back_inserter(meshes),
225 [&directory](auto const& mesh_config)
226 { return readSingleMesh(mesh_config, directory); });
227 if (auto const geometry_file_name =
229 config.getConfigParameterOptional<std::string>("geometry"))
230 {
231 readGeometry(*geometry_file_name, geoObjects, directory,
232 project_directory);
233 }
234 }
235 else
236 { // Read single mesh with geometry.
237 meshes.push_back(
239 readSingleMesh(config.getConfigParameter("mesh"), directory));
240
241 auto const geometry_file_name =
243 config.getConfigParameter<std::string>("geometry");
244 readGeometry(geometry_file_name, geoObjects, directory,
245 project_directory);
246 }
247
248 { // generate meshes from geometries
249 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
251 bool const multiple_nodes_allowed = false;
252 auto additional_meshes =
254 geoObjects, *meshes[0], std::move(search_length_algorithm),
255 multiple_nodes_allowed);
256
257 std::move(begin(additional_meshes), end(additional_meshes),
258 std::back_inserter(meshes));
259 }
260
261 auto mesh_names = MeshLib::views::names | ranges::to<std::vector>() |
262 ranges::actions::sort;
263 auto const sorted_names = meshes | mesh_names;
264 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
265 if (unique_names.size() < sorted_names.size())
266 {
267 WARN(
268 "Mesh names aren't unique. From project file read mesh names are:");
269 for (auto const& name : meshes | MeshLib::views::names)
270 {
271 INFO("- {}", name);
272 }
273 }
274
275 auto const zero_mesh_field_data_by_material_ids =
277 config.getConfigParameterOptional<std::vector<int>>(
278 "zero_mesh_field_data_by_material_ids");
279 if (zero_mesh_field_data_by_material_ids)
280 {
281 WARN(
282 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
283 "name may be changed, or it may be removed due to its "
284 "corresponding feature becomes a single tool. Please use it with "
285 "care!");
287 *meshes[0], *zero_mesh_field_data_by_material_ids);
288 }
289
291
292 return meshes;
293}
294
295std::vector<GeoLib::NamedRaster> readRasters(
296 BaseLib::ConfigTree const& config, std::string const& raster_directory,
297 GeoLib::MinMaxPoints const& min_max_points)
298{
299 INFO("readRasters ...");
300 std::vector<GeoLib::NamedRaster> named_rasters;
301
303 auto optional_rasters = config.getConfigSubtreeOptional("rasters");
304 if (optional_rasters)
305 {
307 auto const configs = optional_rasters->getConfigSubtreeList("raster");
308 std::transform(
309 configs.begin(), configs.end(), std::back_inserter(named_rasters),
310 [&raster_directory, &min_max_points](auto const& raster_config)
311 {
312 return GeoLib::IO::readRaster(raster_config, raster_directory,
313 min_max_points);
314 });
315 }
316 INFO("readRasters done");
317 return named_rasters;
318}
319
320// for debugging raster reading implementation
321// void writeRasters(std::vector<GeoLib::NamedRaster> const& named_rasters,
322// std::string const& output_directory)
323//{
324// for (auto const& named_raster : named_rasters)
325// {
326// #if defined(USE_PETSC)
327// int my_mpi_rank;
328// MPI_Comm_rank(MPI_COMM_WORLD, &my_mpi_rank);
329// #endif
330// FileIO::AsciiRasterInterface::writeRasterAsASC(
331// named_raster.raster, output_directory + "/" +
332// named_raster.raster_name +
333// #if defined(USE_PETSC)
334// "_" + std::to_string(my_mpi_rank) +
335// #endif
336// ".asc");
337// }
338//}
339
340} // namespace
341
342ProjectData::ProjectData() = default;
343
345 std::string const& project_directory,
346 std::string const& output_directory,
347 std::string const& mesh_directory,
348 [[maybe_unused]] std::string const& script_directory)
349 : _mesh_vec(readMeshes(project_config, mesh_directory, project_directory)),
350 _named_rasters(readRasters(project_config, project_directory,
351 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
352 _mesh_vec[0]->getNodes().end())
353 .getMinMaxPoints()))
354{
355 // for debugging raster reading implementation
356 // writeRasters(_named_rasters, output_directory);
357 if (auto const python_script =
359 project_config.getConfigParameterOptional<std::string>("python_script"))
360 {
361 namespace py = pybind11;
362
363#ifdef OGS_EMBED_PYTHON_INTERPRETER
364 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
365#endif
366
367 // Append to python's module search path
368 auto py_path = py::module::import("sys").attr("path");
369 py_path.attr("append")(script_directory); // .prj or -s directory
370 // virtualenv
371 py_path.attr("append")(
372 CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
373
374 auto const script_path =
375 BaseLib::copyPathToFileName(*python_script, script_directory);
376
377 // Evaluate in scope of main module
378 py::object scope = py::module::import("__main__").attr("__dict__");
379 // add (global) variables
380 auto globals = py::dict(scope);
381 globals["ogs_prj_directory"] = project_directory;
382 globals["ogs_mesh_directory"] = mesh_directory;
383 globals["ogs_script_directory"] = script_directory;
384 try
385 {
386 py::eval_file(script_path, scope);
387 }
388 catch (py::error_already_set const& e)
389 {
390 OGS_FATAL("Error evaluating python script {}: {}", script_path,
391 e.what());
392 }
393 }
394
396 parseCurves(project_config.getConfigSubtreeOptional("curves"));
397
398 auto parameter_names_for_transformation =
400 parseParameters(project_config.getConfigSubtree("parameters"));
401
404 project_config.getConfigSubtreeOptional("local_coordinate_system"),
406
407 for (auto& parameter : _parameters)
408 {
409 if (std::find(begin(parameter_names_for_transformation),
410 end(parameter_names_for_transformation),
411 parameter->name) !=
412 end(parameter_names_for_transformation))
413 {
415 {
416 OGS_FATAL(
417 "The parameter '{:s}' is using the local coordinate system "
418 "but no local coordinate system was provided.",
419 parameter->name);
420 }
421 parameter->setCoordinateSystem(*_local_coordinate_system);
422 }
423
424 parameter->initialize(_parameters);
425 }
426
428 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
429
431 parseMedia(project_config.getConfigSubtreeOptional("media"));
432
434 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
435
436 auto chemical_solver_interface = parseChemicalSolverInterface(
438 project_config.getConfigSubtreeOptional("chemical_system"),
439 output_directory);
440
442 parseProcesses(project_config.getConfigSubtree("processes"),
443 project_directory, output_directory,
444 std::move(chemical_solver_interface));
445
447 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
448
450 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
451 output_directory);
452}
453
455 BaseLib::ConfigTree const& process_variables_config)
456{
457 DBUG("Parse process variables:");
458
459 std::set<std::string> names;
460
461 for (auto var_config
463 : process_variables_config.getConfigSubtreeList("process_variable"))
464 {
465 // Either the mesh name is given, or the first mesh's name will be
466 // taken. Taking the first mesh's value is deprecated.
467 auto const mesh_name =
469 var_config.getConfigParameter<std::string>("mesh",
470 _mesh_vec[0]->getName());
471
472 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
473
474 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
476 if (!names.insert(pv.getName()).second)
477 {
478 OGS_FATAL("A process variable with name `{:s}' already exists.",
479 pv.getName());
480 }
481
482 _process_variables.push_back(std::move(pv));
483 }
484}
485
486std::vector<std::string> ProjectData::parseParameters(
487 BaseLib::ConfigTree const& parameters_config)
488{
489 using namespace ProcessLib;
490
491 std::set<std::string> names;
492 std::vector<std::string> parameter_names_for_transformation;
493
494 DBUG("Reading parameters:");
495 for (auto parameter_config :
497 parameters_config.getConfigSubtreeList("parameter"))
498 {
499 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
501 if (!names.insert(p->name).second)
502 {
503 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
504 }
505
506 auto const use_local_coordinate_system =
508 parameter_config.getConfigParameterOptional<bool>(
509 "use_local_coordinate_system");
510 if (!!use_local_coordinate_system && *use_local_coordinate_system)
511 {
512 parameter_names_for_transformation.push_back(p->name);
513 }
514
515 _parameters.push_back(std::move(p));
516 }
517
518 _parameters.push_back(
521 _parameters.push_back(
524
525 return parameter_names_for_transformation;
526}
527
529 std::optional<BaseLib::ConfigTree> const& media_config)
530{
531 if (!media_config)
532 {
533 return;
534 }
535
536 DBUG("Reading media:");
537
538 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
539 {
540 ERR("A mesh is required to define medium materials.");
541 return;
542 }
543
544 for (auto const& medium_config :
546 media_config->getConfigSubtreeList("medium"))
547 {
548 auto material_id_string =
550 medium_config.getConfigAttribute<std::string>("id", "0");
551
552 auto const material_ids_of_this_medium =
553 BaseLib::splitMaterialIdString(material_id_string);
554
555 for (auto const& id : material_ids_of_this_medium)
556 {
557 if (_media.find(id) != end(_media))
558 {
559 OGS_FATAL(
560 "Multiple media were specified for the same material id "
561 "'{:d}'. Keep in mind, that if no material id is "
562 "specified, it is assumed to be 0 by default.",
563 id);
564 }
565
566 if (id == material_ids_of_this_medium[0])
567 {
569 id, _mesh_vec[0]->getDimension(), medium_config,
572 : nullptr,
573 _curves);
574 }
575 else
576 {
577 // This medium has multiple material IDs assigned and this is
578 // not the first material ID. Therefore we can reuse the medium
579 // we created before.
580 _media[id] = _media[material_ids_of_this_medium[0]];
581 }
582 }
583 }
584
585 if (_media.empty())
586 {
587 OGS_FATAL("No entity is found inside <media>.");
588 }
589}
590
591std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
593 std::optional<BaseLib::ConfigTree> const& config,
594 std::string const& output_directory)
595{
596 if (!config)
597 {
598 return nullptr;
599 }
600
601 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
602 chemical_solver_interface;
603#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
604 INFO(
605 "Ready for initializing interface to a chemical solver for water "
606 "chemistry calculation.");
607
608 auto const chemical_solver =
610 config->getConfigAttribute<std::string>("chemical_solver");
611
612 if (boost::iequals(chemical_solver, "Phreeqc"))
613 {
614 INFO(
615 "Configuring phreeqc interface for water chemistry calculation "
616 "using file-based approach.");
617
618 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
620 *config, output_directory);
621 }
622 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
623 {
624 OGS_FATAL(
625 "The chemical solver option of PhreeqcKernel is not accessible for "
626 "the time being. Please set 'Phreeqc'' as the chemical solver for "
627 "reactive transport modeling.");
628 }
629 else if (boost::iequals(chemical_solver, "SelfContained"))
630 {
631 INFO(
632 "Use self-contained chemical solver for water chemistry "
633 "calculation.");
634
635 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
637 _mesh_vec, _linear_solvers, *config, output_directory);
638 }
639 else
640 {
641 OGS_FATAL(
642 "Unknown chemical solver. Please specify either Phreeqc or "
643 "PhreeqcKernel as the solver for water chemistry calculation "
644 "instead.");
645 }
646#else
647 (void)output_directory;
648
649 OGS_FATAL(
650 "Found the type of the process to be solved is not component transport "
651 "process. Please specify the process type to ComponentTransport. At "
652 "the present, water chemistry calculation is only available for "
653 "component transport process.");
654#endif
655 return chemical_solver_interface;
656}
657
659 BaseLib::ConfigTree const& processes_config,
660 std::string const& project_directory,
661 std::string const& output_directory,
662 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
663 chemical_solver_interface)
664{
665 (void)project_directory; // to avoid compilation warning
666 (void)output_directory; // to avoid compilation warning
667
668 DBUG("Reading processes:");
670 for (auto process_config : processes_config.getConfigSubtreeList("process"))
671 {
672 auto const type =
674 process_config.peekConfigParameter<std::string>("type");
675
676 auto const name =
678 process_config.getConfigParameter<std::string>("name");
679
680 [[maybe_unused]] auto const integration_order =
682 process_config.getConfigParameter<int>("integration_order");
683
684 std::unique_ptr<ProcessLib::Process> process;
685
686 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
688 process_config.getConfigSubtreeOptional("jacobian_assembler"));
689
690#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
691 if (type == "STEADY_STATE_DIFFUSION")
692 {
693 // The existence check of the in the configuration referenced
694 // process variables is checked in the physical process.
695 // TODO at the moment we have only one mesh, later there can be
696 // several meshes. Then we have to assign the referenced mesh
697 // here.
698 process =
700 name, *_mesh_vec[0], std::move(jacobian_assembler),
701 _process_variables, _parameters, integration_order,
702 process_config, _mesh_vec, _media);
703 }
704 else
705#endif
706#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
707 if (type == "LIQUID_FLOW")
708 {
710 name, *_mesh_vec[0], std::move(jacobian_assembler),
711 _process_variables, _parameters, integration_order,
712 process_config, _mesh_vec, _media);
713 }
714 else
715#endif
716#ifdef OGS_BUILD_PROCESS_STOKESFLOW
717 if (type == "StokesFlow")
718 {
719 switch (_mesh_vec[0]->getDimension())
720 {
721 case 2:
722 process =
724 name, *_mesh_vec[0], std::move(jacobian_assembler),
725 _process_variables, _parameters, integration_order,
726 process_config, _media);
727 break;
728 default:
729 OGS_FATAL(
730 "StokesFlow process does not support given "
731 "dimension {:d}",
732 _mesh_vec[0]->getDimension());
733 }
734 }
735 else
736#endif
737#ifdef OGS_BUILD_PROCESS_TES
738 if (type == "TES")
739 {
741 name, *_mesh_vec[0], std::move(jacobian_assembler),
742 _process_variables, _parameters, integration_order,
743 process_config);
744 }
745 else
746#endif
747#ifdef OGS_BUILD_PROCESS_TH2M
748 if (type == "TH2M")
749 {
750 switch (_mesh_vec[0]->getDimension())
751 {
752 case 2:
754 name, *_mesh_vec[0], std::move(jacobian_assembler),
756 _local_coordinate_system, integration_order,
757 process_config, _media);
758 break;
759 case 3:
761 name, *_mesh_vec[0], std::move(jacobian_assembler),
763 _local_coordinate_system, integration_order,
764 process_config, _media);
765 break;
766 default:
767 OGS_FATAL("TH2M process does not support given dimension");
768 }
769 }
770 else
771#endif
772#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
773 if (type == "HEAT_CONDUCTION")
774 {
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_HEATTRANSPORTBHE
783 if (type == "HEAT_TRANSPORT_BHE")
784 {
785 if (_mesh_vec[0]->getDimension() != 3)
786 {
787 OGS_FATAL(
788 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
789 "mesh! ");
790 }
791
792 process =
794 name, *_mesh_vec[0], std::move(jacobian_assembler),
795 _process_variables, _parameters, integration_order,
796 process_config, _curves, _media);
797 }
798 else
799#endif
800#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
801 if (type == "HYDRO_MECHANICS")
802 {
803 if (
804 process_config.getConfigParameterOptional<int>("dimension"))
805 {
806 OGS_FATAL(
807 "The 'dimension' tag has been removed in the merge-request "
808 "!4766."
809 "The dimension is now taken from the main mesh and the tag "
810 "must be"
811 "removed. There is a python script in the merge-request "
812 "description"
813 "for automatic conversion.");
814 }
815 switch (_mesh_vec[0]->getDimension())
816 {
817 case 2:
818 process =
820 2>(name, *_mesh_vec[0],
821 std::move(jacobian_assembler),
823 _local_coordinate_system, integration_order,
824 process_config, _media);
825 break;
826 case 3:
827 process =
829 3>(name, *_mesh_vec[0],
830 std::move(jacobian_assembler),
832 _local_coordinate_system, integration_order,
833 process_config, _media);
834 break;
835 default:
836 OGS_FATAL(
837 "HYDRO_MECHANICS process does not support given "
838 "dimension");
839 }
840 }
841 else
842#endif
843#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
844 if (type == "LARGE_DEFORMATION")
845 {
846 switch (_mesh_vec[0]->getDimension())
847 {
848 case 2:
851 name, *_mesh_vec[0], std::move(jacobian_assembler),
853 _local_coordinate_system, integration_order,
854 process_config, _media);
855 break;
856 case 3:
859 name, *_mesh_vec[0], std::move(jacobian_assembler),
861 _local_coordinate_system, integration_order,
862 process_config, _media);
863 break;
864 default:
865 OGS_FATAL(
866 "LARGE_DEFORMATION process does not support given "
867 "dimension");
868 }
869 }
870 else
871#endif
872#ifdef OGS_BUILD_PROCESS_LIE
873 if (type == "HYDRO_MECHANICS_WITH_LIE")
874 {
875 if (
876 process_config.getConfigParameterOptional<int>("dimension"))
877 {
878 OGS_FATAL(
879 "The 'dimension' tag has been removed in the merge-request "
880 "!4766."
881 "The dimension is now taken from the main mesh and the tag "
882 "must be"
883 "removed. There is a python script in the merge-request "
884 "description"
885 "for automatic conversion.");
886 }
887 switch (_mesh_vec[0]->getDimension())
888 {
889 case 2:
892 name, *_mesh_vec[0], std::move(jacobian_assembler),
894 _local_coordinate_system, integration_order,
895 process_config);
896 break;
897 case 3:
900 name, *_mesh_vec[0], std::move(jacobian_assembler),
902 _local_coordinate_system, integration_order,
903 process_config);
904 break;
905 default:
906 OGS_FATAL(
907 "HYDRO_MECHANICS_WITH_LIE process does not support "
908 "given dimension");
909 }
910 }
911 else
912#endif
913#ifdef OGS_BUILD_PROCESS_HT
914 if (type == "HT")
915 {
917 name, *_mesh_vec[0], std::move(jacobian_assembler),
918 _process_variables, _parameters, integration_order,
919 process_config, _mesh_vec, _media);
920 }
921 else
922#endif
923#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
924 if (type == "ComponentTransport")
925 {
926 process =
928 name, *_mesh_vec[0], std::move(jacobian_assembler),
929 _process_variables, _parameters, integration_order,
930 process_config, _mesh_vec, _media,
931 std::move(chemical_solver_interface));
932 }
933 else
934#endif
935#ifdef OGS_BUILD_PROCESS_PHASEFIELD
936 if (type == "PHASE_FIELD")
937 {
938 switch (_mesh_vec[0]->getDimension())
939 {
940 case 2:
941 process =
943 name, *_mesh_vec[0], std::move(jacobian_assembler),
945 _local_coordinate_system, integration_order,
946 process_config);
947 break;
948 case 3:
949 process =
951 name, *_mesh_vec[0], std::move(jacobian_assembler),
953 _local_coordinate_system, integration_order,
954 process_config);
955 break;
956 }
957 }
958 else
959#endif
960#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
961 if (type == "RichardsComponentTransport")
962 {
965 name, *_mesh_vec[0], std::move(jacobian_assembler),
966 _process_variables, _parameters, integration_order,
967 process_config, _media);
968 }
969 else
970#endif
971#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
972 if (type == "SMALL_DEFORMATION")
973 {
974 switch (_mesh_vec[0]->getDimension())
975 {
976 case 2:
979 name, *_mesh_vec[0], std::move(jacobian_assembler),
981 _local_coordinate_system, integration_order,
982 process_config, _media);
983 break;
984 case 3:
987 name, *_mesh_vec[0], std::move(jacobian_assembler),
989 _local_coordinate_system, integration_order,
990 process_config, _media);
991 break;
992 default:
993 OGS_FATAL(
994 "SMALL_DEFORMATION process does not support given "
995 "dimension");
996 }
997 }
998 else
999#endif
1000#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1001 if (type == "SMALL_DEFORMATION_NONLOCAL")
1002 {
1003 switch (_mesh_vec[0]->getDimension())
1004 {
1005 case 2:
1008 name, *_mesh_vec[0], std::move(jacobian_assembler),
1010 _local_coordinate_system, integration_order,
1011 process_config);
1012 break;
1013 case 3:
1016 name, *_mesh_vec[0], std::move(jacobian_assembler),
1018 _local_coordinate_system, integration_order,
1019 process_config);
1020 break;
1021 default:
1022 OGS_FATAL(
1023 "SMALL_DEFORMATION_NONLOCAL process does not support "
1024 "given dimension {:d}",
1025 _mesh_vec[0]->getDimension());
1026 }
1027 }
1028 else
1029#endif
1030#ifdef OGS_BUILD_PROCESS_LIE
1031 if (type == "SMALL_DEFORMATION_WITH_LIE")
1032 {
1033 if (
1034 process_config.getConfigParameterOptional<int>("dimension"))
1035 {
1036 OGS_FATAL(
1037 "The 'dimension' tag has been removed in the merge-request "
1038 "!4766."
1039 "The dimension is now taken from the main mesh and the tag "
1040 "must be"
1041 "removed. There is a python script in the merge-request "
1042 "description"
1043 "for automatic conversion.");
1044 }
1045 switch (_mesh_vec[0]->getDimension())
1046 {
1047 case 2:
1050 name, *_mesh_vec[0], std::move(jacobian_assembler),
1052 _local_coordinate_system, integration_order,
1053 process_config);
1054 break;
1055 case 3:
1058 name, *_mesh_vec[0], std::move(jacobian_assembler),
1060 _local_coordinate_system, integration_order,
1061 process_config);
1062 break;
1063 default:
1064 OGS_FATAL(
1065 "SMALL_DEFORMATION_WITH_LIE process does not support "
1066 "given dimension");
1067 }
1068 }
1069 else
1070#endif
1071#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1072 if (type == "THERMO_HYDRO_MECHANICS")
1073 {
1074 if (
1075 process_config.getConfigParameterOptional<int>("dimension"))
1076 {
1077 OGS_FATAL(
1078 "The 'dimension' tag has been removed in the merge-request "
1079 "!4766."
1080 "The dimension is now taken from the main mesh and the tag "
1081 "must be"
1082 "removed. There is a python script in the merge-request "
1083 "description"
1084 "for automatic conversion.");
1085 }
1086 switch (_mesh_vec[0]->getDimension())
1087 {
1088 case 2:
1091 name, *_mesh_vec[0], std::move(jacobian_assembler),
1093 _local_coordinate_system, integration_order,
1094 process_config, _media);
1095 break;
1096 case 3:
1099 name, *_mesh_vec[0], std::move(jacobian_assembler),
1101 _local_coordinate_system, integration_order,
1102 process_config, _media);
1103 break;
1104 default:
1105 OGS_FATAL(
1106 "THERMO_HYDRO_MECHANICS process does not support given "
1107 "dimension");
1108 }
1109 }
1110 else
1111#endif
1112#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1113 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1114 {
1115 switch (_mesh_vec[0]->getDimension())
1116 {
1117 case 2:
1120 name, *_mesh_vec[0], std::move(jacobian_assembler),
1122 _local_coordinate_system, integration_order,
1123 process_config);
1124 break;
1125 case 3:
1128 name, *_mesh_vec[0], std::move(jacobian_assembler),
1130 _local_coordinate_system, integration_order,
1131 process_config);
1132 break;
1133 }
1134 }
1135 else
1136#endif
1137#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1138 if (type == "THERMO_MECHANICS")
1139 {
1140 switch (_mesh_vec[0]->getDimension())
1141 {
1142 case 2:
1145 name, *_mesh_vec[0], std::move(jacobian_assembler),
1147 _local_coordinate_system, integration_order,
1148 process_config, _media);
1149 break;
1150 case 3:
1153 name, *_mesh_vec[0], std::move(jacobian_assembler),
1155 _local_coordinate_system, integration_order,
1156 process_config, _media);
1157 break;
1158 }
1159 }
1160 else
1161#endif
1162#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1163 if (type == "RICHARDS_FLOW")
1164 {
1166 name, *_mesh_vec[0], std::move(jacobian_assembler),
1167 _process_variables, _parameters, integration_order,
1168 process_config, _media);
1169 }
1170 else
1171#endif
1172#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1173 if (type == "RICHARDS_MECHANICS")
1174 {
1175 if (
1176 process_config.getConfigParameterOptional<int>("dimension"))
1177 {
1178 OGS_FATAL(
1179 "The 'dimension' tag has been removed in the merge-request "
1180 "!4766."
1181 "The dimension is now taken from the main mesh and the tag "
1182 "must be"
1183 "removed. There is a python script in the merge-request "
1184 "description"
1185 "for automatic conversion.");
1186 }
1187 switch (_mesh_vec[0]->getDimension())
1188 {
1189 case 2:
1192 name, *_mesh_vec[0], std::move(jacobian_assembler),
1194 _local_coordinate_system, integration_order,
1195 process_config, _media);
1196 break;
1197 case 3:
1200 name, *_mesh_vec[0], std::move(jacobian_assembler),
1202 _local_coordinate_system, integration_order,
1203 process_config, _media);
1204 break;
1205 }
1206 }
1207 else
1208#endif
1209#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1210 if (type == "THERMO_RICHARDS_FLOW")
1211 {
1212 process =
1214 name, *_mesh_vec[0], std::move(jacobian_assembler),
1215 _process_variables, _parameters, integration_order,
1216 process_config, _media);
1217 }
1218 else
1219#endif
1220#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1221 if (type == "THERMO_RICHARDS_MECHANICS")
1222 {
1223 switch (_mesh_vec[0]->getDimension())
1224 {
1225 case 2:
1228 name, *_mesh_vec[0], std::move(jacobian_assembler),
1230 _local_coordinate_system, integration_order,
1231 process_config, _media);
1232 break;
1233 case 3:
1236 name, *_mesh_vec[0], std::move(jacobian_assembler),
1238 _local_coordinate_system, integration_order,
1239 process_config, _media);
1240 break;
1241 }
1242 }
1243 else
1244#endif
1245
1246#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1247 if (type == "TWOPHASE_FLOW_PP")
1248 {
1249 process =
1251 name, *_mesh_vec[0], std::move(jacobian_assembler),
1252 _process_variables, _parameters, integration_order,
1253 process_config, _media);
1254 }
1255 else
1256#endif
1257#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1258 if (type == "TWOPHASE_FLOW_PRHO")
1259 {
1262 name, *_mesh_vec[0], std::move(jacobian_assembler),
1263 _process_variables, _parameters, integration_order,
1264 process_config, _media);
1265 }
1266 else
1267#endif
1268#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1269 if (type == "THERMAL_TWOPHASE_WITH_PP")
1270 {
1273 name, *_mesh_vec[0], std::move(jacobian_assembler),
1274 _process_variables, _parameters, integration_order,
1275 process_config, _media);
1276 }
1277 else
1278#endif
1279 {
1280 OGS_FATAL("Unknown process type: {:s}", type);
1281 }
1282
1283 if (ranges::contains(_processes, name,
1284 [](std::unique_ptr<ProcessLib::Process> const& p)
1285 { return p->name; }))
1286 {
1287 OGS_FATAL("The process name '{:s}' is not unique.", name);
1288 }
1289 _processes.push_back(std::move(process));
1290 }
1291}
1292
1294 std::string const& output_directory)
1295{
1296 DBUG("Reading time loop configuration.");
1297
1298 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1299 std::begin(_process_variables),
1300 std::end(_process_variables),
1301 [](auto const& process_variable)
1302 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1303
1305 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1306 compensate_non_equilibrium_initial_residuum);
1307
1308 if (!_time_loop)
1309 {
1310 OGS_FATAL("Initialization of time loop failed.");
1311 }
1312}
1313
1315{
1316 DBUG("Reading linear solver configuration.");
1317
1319 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1320 {
1322 auto const name = conf.getConfigParameter<std::string>("name");
1323 auto const linear_solver_parser =
1325 auto const solver_options =
1326 linear_solver_parser.parseNameAndOptions("", &conf);
1327
1330 name,
1331 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1332 std::get<1>(solver_options)),
1333 "The linear solver name is not unique");
1334 }
1335}
1336
1338{
1339 DBUG("Reading non-linear solver configuration.");
1340
1342 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1343 {
1344 auto const ls_name =
1346 conf.getConfigParameter<std::string>("linear_solver");
1347 auto const& linear_solver = BaseLib::getOrError(
1348 _linear_solvers, ls_name,
1349 "A linear solver with the given name does not exist.");
1350
1352 auto const name = conf.getConfigParameter<std::string>("name");
1355 name,
1356 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1357 "The nonlinear solver name is not unique");
1358 }
1359}
1360
1361void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1362{
1363 if (!config)
1364 {
1365 return;
1366 }
1367
1368 DBUG("Reading curves configuration.");
1369
1371 for (auto conf : config->getConfigSubtreeList("curve"))
1372 {
1374 auto const name = conf.getConfigParameter<std::string>("name");
1376 _curves,
1377 name,
1380 "The curve name is not unique.");
1381 }
1382}
1383
1384MeshLib::Mesh& ProjectData::getMesh(std::string const& mesh_name) const
1385{
1386 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1387}
Definition of the AsciiRasterInterface class.
Definition of the BoostXmlGmlInterface class.
Functionality to build different search length algorithm objects from given config.
#define OGS_FATAL(...)
Definition Error.h:26
Filename manipulation routines.
Definition of the GEOObjects class.
std::vector< std::size_t > getNodes(GeoLib::Point const &pnt, std::vector< MeshLib::Node * > const &nodes, MeshLib::PropertyVector< int > const &mat_ids, std::pair< int, int > const &mat_limits, std::pair< double, double > const &elevation_limits, MeshLib::Mesh const &mesh)
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
Definition of the Mesh class.
Definition of the GeoLib::Raster class.
Base class for different search length strategies.
Definition of string helper functions.
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
std::optional< T > getConfigParameterOptional(std::string const &param) const
T getConfigParameter(std::string const &param) const
Range< SubtreeIterator > getConfigSubtreeList(std::string const &root) const
ConfigTree getConfigSubtree(std::string const &root) const
std::optional< T > getConfigAttributeOptional(std::string const &attr) const
Container class for geometric objects.
Definition GEOObjects.h:57
bool readFile(const std::string &fname) override
Reads an xml-file containing OGS geometry.
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:47
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
MeshLib::Mesh & getMesh(std::string const &mesh_name) const
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &project_directory, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > parseChemicalSolverInterface(std::optional< BaseLib::ConfigTree > const &config, const std::string &output_directory)
void parseMedia(std::optional< BaseLib::ConfigTree > const &media_config)
Parses media configuration and saves them in an object.
void parseLinearSolvers(BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
std::vector< GeoLib::NamedRaster > _named_rasters
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
void parseTimeLoop(BaseLib::ConfigTree const &config, const std::string &output_directory)
Parses the time loop configuration.
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > _media
std::vector< std::string > parseParameters(BaseLib::ConfigTree const &parameters_config)
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project's processes.
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
pybind11::scoped_interpreter setupEmbeddedPython()
std::vector< int > splitMaterialIdString(std::string const &material_id_string)
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition Algorithm.h:100
bool IsFileExisting(const std::string &strFilename)
Returns true if given file exists.
Definition FileTools.cpp:47
std::string copyPathToFileName(const std::string &file_name, const std::string &source)
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:114
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)
std::unique_ptr< Medium > createMedium(int const material_id, int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)
std::unique_ptr< MeshGeoToolsLib::SearchLength > createSearchLengthAlgorithm(BaseLib::ConfigTree const &external_config, MeshLib::Mesh const &mesh)
std::vector< std::unique_ptr< MeshLib::Mesh > > constructAdditionalMeshesFromGeoObjects(GeoLib::GEOObjects const &geo_objects, MeshLib::Mesh const &mesh, std::unique_ptr< SearchLength > search_length_algorithm, bool const multiple_nodes_allowed)
MeshLib::Mesh * readMeshFromFile(const std::string &file_name, bool const compute_element_neighbors)
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:229
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
Definition Mesh.cpp:363
void setMeshSpaceDimension(std::vector< std::unique_ptr< Mesh > > const &meshes)
void zeroMeshFieldDataByMaterialIDs(MeshLib::Mesh &mesh, std::vector< int > const &selected_material_ids)
std::optional< ParameterLib::CoordinateSystem > createCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::unique_ptr< ParameterBase > createParameter(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< GeoLib::NamedRaster > const &named_rasters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
Definition Parameter.cpp:27
std::unique_ptr< Process > createComponentTransportProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< Process > createHTProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHeatConductionProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHeatTransportBHEProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHydroMechanicsProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createHydroMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
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)
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< 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