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 py::eval_file(script_path, scope);
385 }
386
388 parseCurves(project_config.getConfigSubtreeOptional("curves"));
389
390 auto parameter_names_for_transformation =
392 parseParameters(project_config.getConfigSubtree("parameters"));
393
396 project_config.getConfigSubtreeOptional("local_coordinate_system"),
398
399 for (auto& parameter : _parameters)
400 {
401 if (std::find(begin(parameter_names_for_transformation),
402 end(parameter_names_for_transformation),
403 parameter->name) !=
404 end(parameter_names_for_transformation))
405 {
407 {
408 OGS_FATAL(
409 "The parameter '{:s}' is using the local coordinate system "
410 "but no local coordinate system was provided.",
411 parameter->name);
412 }
413 parameter->setCoordinateSystem(*_local_coordinate_system);
414 }
415
416 parameter->initialize(_parameters);
417 }
418
420 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
421
423 parseMedia(project_config.getConfigSubtreeOptional("media"));
424
426 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
427
428 auto chemical_solver_interface = parseChemicalSolverInterface(
430 project_config.getConfigSubtreeOptional("chemical_system"),
431 output_directory);
432
434 parseProcesses(project_config.getConfigSubtree("processes"),
435 project_directory, output_directory,
436 std::move(chemical_solver_interface));
437
439 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
440
442 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
443 output_directory);
444}
445
447 BaseLib::ConfigTree const& process_variables_config)
448{
449 DBUG("Parse process variables:");
450
451 std::set<std::string> names;
452
453 for (auto var_config
455 : process_variables_config.getConfigSubtreeList("process_variable"))
456 {
457 // Either the mesh name is given, or the first mesh's name will be
458 // taken. Taking the first mesh's value is deprecated.
459 auto const mesh_name =
461 var_config.getConfigParameter<std::string>("mesh",
462 _mesh_vec[0]->getName());
463
464 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
465
466 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
468 if (!names.insert(pv.getName()).second)
469 {
470 OGS_FATAL("A process variable with name `{:s}' already exists.",
471 pv.getName());
472 }
473
474 _process_variables.push_back(std::move(pv));
475 }
476}
477
478std::vector<std::string> ProjectData::parseParameters(
479 BaseLib::ConfigTree const& parameters_config)
480{
481 using namespace ProcessLib;
482
483 std::set<std::string> names;
484 std::vector<std::string> parameter_names_for_transformation;
485
486 DBUG("Reading parameters:");
487 for (auto parameter_config :
489 parameters_config.getConfigSubtreeList("parameter"))
490 {
491 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
493 if (!names.insert(p->name).second)
494 {
495 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
496 }
497
498 auto const use_local_coordinate_system =
500 parameter_config.getConfigParameterOptional<bool>(
501 "use_local_coordinate_system");
502 if (!!use_local_coordinate_system && *use_local_coordinate_system)
503 {
504 parameter_names_for_transformation.push_back(p->name);
505 }
506
507 _parameters.push_back(std::move(p));
508 }
509
510 _parameters.push_back(
513 _parameters.push_back(
516
517 return parameter_names_for_transformation;
518}
519
521 std::optional<BaseLib::ConfigTree> const& media_config)
522{
523 if (!media_config)
524 {
525 return;
526 }
527
528 DBUG("Reading media:");
529
530 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
531 {
532 ERR("A mesh is required to define medium materials.");
533 return;
534 }
535
536 for (auto const& medium_config :
538 media_config->getConfigSubtreeList("medium"))
539 {
540 auto material_id_string =
542 medium_config.getConfigAttribute<std::string>("id", "0");
543
544 auto const material_ids_of_this_medium =
545 BaseLib::splitMaterialIdString(material_id_string);
546
547 for (auto const& id : material_ids_of_this_medium)
548 {
549 if (_media.find(id) != end(_media))
550 {
551 OGS_FATAL(
552 "Multiple media were specified for the same material id "
553 "'{:d}'. Keep in mind, that if no material id is "
554 "specified, it is assumed to be 0 by default.",
555 id);
556 }
557
558 if (id == material_ids_of_this_medium[0])
559 {
561 id, _mesh_vec[0]->getDimension(), medium_config,
564 : nullptr,
565 _curves);
566 }
567 else
568 {
569 // This medium has multiple material IDs assigned and this is
570 // not the first material ID. Therefore we can reuse the medium
571 // we created before.
572 _media[id] = _media[material_ids_of_this_medium[0]];
573 }
574 }
575 }
576
577 if (_media.empty())
578 {
579 OGS_FATAL("No entity is found inside <media>.");
580 }
581}
582
583std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
585 std::optional<BaseLib::ConfigTree> const& config,
586 std::string const& output_directory)
587{
588 if (!config)
589 {
590 return nullptr;
591 }
592
593 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
594 chemical_solver_interface;
595#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
596 INFO(
597 "Ready for initializing interface to a chemical solver for water "
598 "chemistry calculation.");
599
600 auto const chemical_solver =
602 config->getConfigAttribute<std::string>("chemical_solver");
603
604 if (boost::iequals(chemical_solver, "Phreeqc"))
605 {
606 INFO(
607 "Configuring phreeqc interface for water chemistry calculation "
608 "using file-based approach.");
609
610 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
612 *config, output_directory);
613 }
614 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
615 {
616 OGS_FATAL(
617 "The chemical solver option of PhreeqcKernel is not accessible for "
618 "the time being. Please set 'Phreeqc'' as the chemical solver for "
619 "reactive transport modeling.");
620 }
621 else if (boost::iequals(chemical_solver, "SelfContained"))
622 {
623 INFO(
624 "Use self-contained chemical solver for water chemistry "
625 "calculation.");
626
627 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
629 _mesh_vec, _linear_solvers, *config, output_directory);
630 }
631 else
632 {
633 OGS_FATAL(
634 "Unknown chemical solver. Please specify either Phreeqc or "
635 "PhreeqcKernel as the solver for water chemistry calculation "
636 "instead.");
637 }
638#else
639 (void)output_directory;
640
641 OGS_FATAL(
642 "Found the type of the process to be solved is not component transport "
643 "process. Please specify the process type to ComponentTransport. At "
644 "the present, water chemistry calculation is only available for "
645 "component transport process.");
646#endif
647 return chemical_solver_interface;
648}
649
651 BaseLib::ConfigTree const& processes_config,
652 std::string const& project_directory,
653 std::string const& output_directory,
654 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
655 chemical_solver_interface)
656{
657 (void)project_directory; // to avoid compilation warning
658 (void)output_directory; // to avoid compilation warning
659
660 DBUG("Reading processes:");
662 for (auto process_config : processes_config.getConfigSubtreeList("process"))
663 {
664 auto const type =
666 process_config.peekConfigParameter<std::string>("type");
667
668 auto const name =
670 process_config.getConfigParameter<std::string>("name");
671
672 [[maybe_unused]] auto const integration_order =
674 process_config.getConfigParameter<int>("integration_order");
675
676 std::unique_ptr<ProcessLib::Process> process;
677
678 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
680 process_config.getConfigSubtreeOptional("jacobian_assembler"));
681
682#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
683 if (type == "STEADY_STATE_DIFFUSION")
684 {
685 // The existence check of the in the configuration referenced
686 // process variables is checked in the physical process.
687 // TODO at the moment we have only one mesh, later there can be
688 // several meshes. Then we have to assign the referenced mesh
689 // here.
690 process =
692 name, *_mesh_vec[0], std::move(jacobian_assembler),
693 _process_variables, _parameters, integration_order,
694 process_config, _mesh_vec, _media);
695 }
696 else
697#endif
698#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
699 if (type == "LIQUID_FLOW")
700 {
702 name, *_mesh_vec[0], std::move(jacobian_assembler),
703 _process_variables, _parameters, integration_order,
704 process_config, _mesh_vec, _media);
705 }
706 else
707#endif
708#ifdef OGS_BUILD_PROCESS_STOKESFLOW
709 if (type == "StokesFlow")
710 {
711 switch (_mesh_vec[0]->getDimension())
712 {
713 case 2:
714 process =
716 name, *_mesh_vec[0], std::move(jacobian_assembler),
717 _process_variables, _parameters, integration_order,
718 process_config, _media);
719 break;
720 default:
721 OGS_FATAL(
722 "StokesFlow process does not support given "
723 "dimension {:d}",
724 _mesh_vec[0]->getDimension());
725 }
726 }
727 else
728#endif
729#ifdef OGS_BUILD_PROCESS_TES
730 if (type == "TES")
731 {
733 name, *_mesh_vec[0], std::move(jacobian_assembler),
734 _process_variables, _parameters, integration_order,
735 process_config);
736 }
737 else
738#endif
739#ifdef OGS_BUILD_PROCESS_TH2M
740 if (type == "TH2M")
741 {
742 switch (_mesh_vec[0]->getDimension())
743 {
744 case 2:
746 name, *_mesh_vec[0], std::move(jacobian_assembler),
748 _local_coordinate_system, integration_order,
749 process_config, _media);
750 break;
751 case 3:
753 name, *_mesh_vec[0], std::move(jacobian_assembler),
755 _local_coordinate_system, integration_order,
756 process_config, _media);
757 break;
758 default:
759 OGS_FATAL("TH2M process does not support given dimension");
760 }
761 }
762 else
763#endif
764#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
765 if (type == "HEAT_CONDUCTION")
766 {
768 name, *_mesh_vec[0], std::move(jacobian_assembler),
769 _process_variables, _parameters, integration_order,
770 process_config, _media);
771 }
772 else
773#endif
774#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
775 if (type == "HEAT_TRANSPORT_BHE")
776 {
777 if (_mesh_vec[0]->getDimension() != 3)
778 {
779 OGS_FATAL(
780 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
781 "mesh! ");
782 }
783
784 process =
786 name, *_mesh_vec[0], std::move(jacobian_assembler),
787 _process_variables, _parameters, integration_order,
788 process_config, _curves, _media);
789 }
790 else
791#endif
792#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
793 if (type == "HYDRO_MECHANICS")
794 {
795 if (
796 process_config.getConfigParameterOptional<int>("dimension"))
797 {
798 OGS_FATAL(
799 "The 'dimension' tag has been removed in the merge-request "
800 "!4766."
801 "The dimension is now taken from the main mesh and the tag "
802 "must be"
803 "removed. There is a python script in the merge-request "
804 "description"
805 "for automatic conversion.");
806 }
807 switch (_mesh_vec[0]->getDimension())
808 {
809 case 2:
810 process =
812 2>(name, *_mesh_vec[0],
813 std::move(jacobian_assembler),
815 _local_coordinate_system, integration_order,
816 process_config, _media);
817 break;
818 case 3:
819 process =
821 3>(name, *_mesh_vec[0],
822 std::move(jacobian_assembler),
824 _local_coordinate_system, integration_order,
825 process_config, _media);
826 break;
827 default:
828 OGS_FATAL(
829 "HYDRO_MECHANICS process does not support given "
830 "dimension");
831 }
832 }
833 else
834#endif
835#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
836 if (type == "LARGE_DEFORMATION")
837 {
838 switch (_mesh_vec[0]->getDimension())
839 {
840 case 2:
843 name, *_mesh_vec[0], std::move(jacobian_assembler),
845 _local_coordinate_system, integration_order,
846 process_config, _media);
847 break;
848 case 3:
851 name, *_mesh_vec[0], std::move(jacobian_assembler),
853 _local_coordinate_system, integration_order,
854 process_config, _media);
855 break;
856 default:
857 OGS_FATAL(
858 "LARGE_DEFORMATION process does not support given "
859 "dimension");
860 }
861 }
862 else
863#endif
864#ifdef OGS_BUILD_PROCESS_LIE
865 if (type == "HYDRO_MECHANICS_WITH_LIE")
866 {
867 if (
868 process_config.getConfigParameterOptional<int>("dimension"))
869 {
870 OGS_FATAL(
871 "The 'dimension' tag has been removed in the merge-request "
872 "!4766."
873 "The dimension is now taken from the main mesh and the tag "
874 "must be"
875 "removed. There is a python script in the merge-request "
876 "description"
877 "for automatic conversion.");
878 }
879 switch (_mesh_vec[0]->getDimension())
880 {
881 case 2:
884 name, *_mesh_vec[0], std::move(jacobian_assembler),
886 _local_coordinate_system, integration_order,
887 process_config);
888 break;
889 case 3:
892 name, *_mesh_vec[0], std::move(jacobian_assembler),
894 _local_coordinate_system, integration_order,
895 process_config);
896 break;
897 default:
898 OGS_FATAL(
899 "HYDRO_MECHANICS_WITH_LIE process does not support "
900 "given dimension");
901 }
902 }
903 else
904#endif
905#ifdef OGS_BUILD_PROCESS_HT
906 if (type == "HT")
907 {
909 name, *_mesh_vec[0], std::move(jacobian_assembler),
910 _process_variables, _parameters, integration_order,
911 process_config, _mesh_vec, _media);
912 }
913 else
914#endif
915#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
916 if (type == "ComponentTransport")
917 {
918 process =
920 name, *_mesh_vec[0], std::move(jacobian_assembler),
921 _process_variables, _parameters, integration_order,
922 process_config, _mesh_vec, _media,
923 std::move(chemical_solver_interface));
924 }
925 else
926#endif
927#ifdef OGS_BUILD_PROCESS_PHASEFIELD
928 if (type == "PHASE_FIELD")
929 {
930 switch (_mesh_vec[0]->getDimension())
931 {
932 case 2:
933 process =
935 name, *_mesh_vec[0], std::move(jacobian_assembler),
937 _local_coordinate_system, integration_order,
938 process_config);
939 break;
940 case 3:
941 process =
943 name, *_mesh_vec[0], std::move(jacobian_assembler),
945 _local_coordinate_system, integration_order,
946 process_config);
947 break;
948 }
949 }
950 else
951#endif
952#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
953 if (type == "RichardsComponentTransport")
954 {
957 name, *_mesh_vec[0], std::move(jacobian_assembler),
958 _process_variables, _parameters, integration_order,
959 process_config, _media);
960 }
961 else
962#endif
963#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
964 if (type == "SMALL_DEFORMATION")
965 {
966 switch (_mesh_vec[0]->getDimension())
967 {
968 case 2:
971 name, *_mesh_vec[0], std::move(jacobian_assembler),
973 _local_coordinate_system, integration_order,
974 process_config, _media);
975 break;
976 case 3:
979 name, *_mesh_vec[0], std::move(jacobian_assembler),
981 _local_coordinate_system, integration_order,
982 process_config, _media);
983 break;
984 default:
985 OGS_FATAL(
986 "SMALL_DEFORMATION process does not support given "
987 "dimension");
988 }
989 }
990 else
991#endif
992#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
993 if (type == "SMALL_DEFORMATION_NONLOCAL")
994 {
995 switch (_mesh_vec[0]->getDimension())
996 {
997 case 2:
1000 name, *_mesh_vec[0], std::move(jacobian_assembler),
1002 _local_coordinate_system, integration_order,
1003 process_config);
1004 break;
1005 case 3:
1008 name, *_mesh_vec[0], std::move(jacobian_assembler),
1010 _local_coordinate_system, integration_order,
1011 process_config);
1012 break;
1013 default:
1014 OGS_FATAL(
1015 "SMALL_DEFORMATION_NONLOCAL process does not support "
1016 "given dimension {:d}",
1017 _mesh_vec[0]->getDimension());
1018 }
1019 }
1020 else
1021#endif
1022#ifdef OGS_BUILD_PROCESS_LIE
1023 if (type == "SMALL_DEFORMATION_WITH_LIE")
1024 {
1025 if (
1026 process_config.getConfigParameterOptional<int>("dimension"))
1027 {
1028 OGS_FATAL(
1029 "The 'dimension' tag has been removed in the merge-request "
1030 "!4766."
1031 "The dimension is now taken from the main mesh and the tag "
1032 "must be"
1033 "removed. There is a python script in the merge-request "
1034 "description"
1035 "for automatic conversion.");
1036 }
1037 switch (_mesh_vec[0]->getDimension())
1038 {
1039 case 2:
1042 name, *_mesh_vec[0], std::move(jacobian_assembler),
1044 _local_coordinate_system, integration_order,
1045 process_config);
1046 break;
1047 case 3:
1050 name, *_mesh_vec[0], std::move(jacobian_assembler),
1052 _local_coordinate_system, integration_order,
1053 process_config);
1054 break;
1055 default:
1056 OGS_FATAL(
1057 "SMALL_DEFORMATION_WITH_LIE process does not support "
1058 "given dimension");
1059 }
1060 }
1061 else
1062#endif
1063#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1064 if (type == "THERMO_HYDRO_MECHANICS")
1065 {
1066 if (
1067 process_config.getConfigParameterOptional<int>("dimension"))
1068 {
1069 OGS_FATAL(
1070 "The 'dimension' tag has been removed in the merge-request "
1071 "!4766."
1072 "The dimension is now taken from the main mesh and the tag "
1073 "must be"
1074 "removed. There is a python script in the merge-request "
1075 "description"
1076 "for automatic conversion.");
1077 }
1078 switch (_mesh_vec[0]->getDimension())
1079 {
1080 case 2:
1083 name, *_mesh_vec[0], std::move(jacobian_assembler),
1085 _local_coordinate_system, integration_order,
1086 process_config, _media);
1087 break;
1088 case 3:
1091 name, *_mesh_vec[0], std::move(jacobian_assembler),
1093 _local_coordinate_system, integration_order,
1094 process_config, _media);
1095 break;
1096 default:
1097 OGS_FATAL(
1098 "THERMO_HYDRO_MECHANICS process does not support given "
1099 "dimension");
1100 }
1101 }
1102 else
1103#endif
1104#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1105 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1106 {
1107 switch (_mesh_vec[0]->getDimension())
1108 {
1109 case 2:
1112 name, *_mesh_vec[0], std::move(jacobian_assembler),
1114 _local_coordinate_system, integration_order,
1115 process_config);
1116 break;
1117 case 3:
1120 name, *_mesh_vec[0], std::move(jacobian_assembler),
1122 _local_coordinate_system, integration_order,
1123 process_config);
1124 break;
1125 }
1126 }
1127 else
1128#endif
1129#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1130 if (type == "THERMO_MECHANICS")
1131 {
1132 switch (_mesh_vec[0]->getDimension())
1133 {
1134 case 2:
1137 name, *_mesh_vec[0], std::move(jacobian_assembler),
1139 _local_coordinate_system, integration_order,
1140 process_config, _media);
1141 break;
1142 case 3:
1145 name, *_mesh_vec[0], std::move(jacobian_assembler),
1147 _local_coordinate_system, integration_order,
1148 process_config, _media);
1149 break;
1150 }
1151 }
1152 else
1153#endif
1154#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1155 if (type == "RICHARDS_FLOW")
1156 {
1158 name, *_mesh_vec[0], std::move(jacobian_assembler),
1159 _process_variables, _parameters, integration_order,
1160 process_config, _media);
1161 }
1162 else
1163#endif
1164#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1165 if (type == "RICHARDS_MECHANICS")
1166 {
1167 if (
1168 process_config.getConfigParameterOptional<int>("dimension"))
1169 {
1170 OGS_FATAL(
1171 "The 'dimension' tag has been removed in the merge-request "
1172 "!4766."
1173 "The dimension is now taken from the main mesh and the tag "
1174 "must be"
1175 "removed. There is a python script in the merge-request "
1176 "description"
1177 "for automatic conversion.");
1178 }
1179 switch (_mesh_vec[0]->getDimension())
1180 {
1181 case 2:
1184 name, *_mesh_vec[0], std::move(jacobian_assembler),
1186 _local_coordinate_system, integration_order,
1187 process_config, _media);
1188 break;
1189 case 3:
1192 name, *_mesh_vec[0], std::move(jacobian_assembler),
1194 _local_coordinate_system, integration_order,
1195 process_config, _media);
1196 break;
1197 }
1198 }
1199 else
1200#endif
1201#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1202 if (type == "THERMO_RICHARDS_FLOW")
1203 {
1204 process =
1206 name, *_mesh_vec[0], std::move(jacobian_assembler),
1207 _process_variables, _parameters, integration_order,
1208 process_config, _media);
1209 }
1210 else
1211#endif
1212#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1213 if (type == "THERMO_RICHARDS_MECHANICS")
1214 {
1215 switch (_mesh_vec[0]->getDimension())
1216 {
1217 case 2:
1220 name, *_mesh_vec[0], std::move(jacobian_assembler),
1222 _local_coordinate_system, integration_order,
1223 process_config, _media);
1224 break;
1225 case 3:
1228 name, *_mesh_vec[0], std::move(jacobian_assembler),
1230 _local_coordinate_system, integration_order,
1231 process_config, _media);
1232 break;
1233 }
1234 }
1235 else
1236#endif
1237
1238#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1239 if (type == "TWOPHASE_FLOW_PP")
1240 {
1241 process =
1243 name, *_mesh_vec[0], std::move(jacobian_assembler),
1244 _process_variables, _parameters, integration_order,
1245 process_config, _media);
1246 }
1247 else
1248#endif
1249#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1250 if (type == "TWOPHASE_FLOW_PRHO")
1251 {
1254 name, *_mesh_vec[0], std::move(jacobian_assembler),
1255 _process_variables, _parameters, integration_order,
1256 process_config, _media);
1257 }
1258 else
1259#endif
1260#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1261 if (type == "THERMAL_TWOPHASE_WITH_PP")
1262 {
1265 name, *_mesh_vec[0], std::move(jacobian_assembler),
1266 _process_variables, _parameters, integration_order,
1267 process_config, _media);
1268 }
1269 else
1270#endif
1271 {
1272 OGS_FATAL("Unknown process type: {:s}", type);
1273 }
1274
1275 if (ranges::contains(_processes, name,
1276 [](std::unique_ptr<ProcessLib::Process> const& p)
1277 { return p->name; }))
1278 {
1279 OGS_FATAL("The process name '{:s}' is not unique.", name);
1280 }
1281 _processes.push_back(std::move(process));
1282 }
1283}
1284
1286 std::string const& output_directory)
1287{
1288 DBUG("Reading time loop configuration.");
1289
1290 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1291 std::begin(_process_variables),
1292 std::end(_process_variables),
1293 [](auto const& process_variable)
1294 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1295
1297 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1298 compensate_non_equilibrium_initial_residuum);
1299
1300 if (!_time_loop)
1301 {
1302 OGS_FATAL("Initialization of time loop failed.");
1303 }
1304}
1305
1307{
1308 DBUG("Reading linear solver configuration.");
1309
1311 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1312 {
1314 auto const name = conf.getConfigParameter<std::string>("name");
1315 auto const linear_solver_parser =
1317 auto const solver_options =
1318 linear_solver_parser.parseNameAndOptions("", &conf);
1319
1322 name,
1323 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1324 std::get<1>(solver_options)),
1325 "The linear solver name is not unique");
1326 }
1327}
1328
1330{
1331 DBUG("Reading non-linear solver configuration.");
1332
1334 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1335 {
1336 auto const ls_name =
1338 conf.getConfigParameter<std::string>("linear_solver");
1339 auto const& linear_solver = BaseLib::getOrError(
1340 _linear_solvers, ls_name,
1341 "A linear solver with the given name does not exist.");
1342
1344 auto const name = conf.getConfigParameter<std::string>("name");
1347 name,
1348 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1349 "The nonlinear solver name is not unique");
1350 }
1351}
1352
1353void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1354{
1355 if (!config)
1356 {
1357 return;
1358 }
1359
1360 DBUG("Reading curves configuration.");
1361
1363 for (auto conf : config->getConfigSubtreeList("curve"))
1364 {
1366 auto const name = conf.getConfigParameter<std::string>("name");
1368 _curves,
1369 name,
1372 "The curve name is not unique.");
1373 }
1374}
1375
1376MeshLib::Mesh& ProjectData::getMesh(std::string const& mesh_name) const
1377{
1378 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1379}
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:46
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()
Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:113
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:99
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)
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