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
61#include "ParameterLib/Utils.h"
63#include "ProcessLib/TimeLoop.h"
64
65#ifdef OGS_EMBED_PYTHON_INTERPRETER
67#endif
68
69#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
72#endif
73#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
75#endif
76#ifdef OGS_BUILD_PROCESS_HT
78#endif
79#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
81#endif
82#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
84#endif
85#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
87#endif
88#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
90#endif
91#ifdef OGS_BUILD_PROCESS_LIE
94#endif
95#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
97#endif
98#ifdef OGS_BUILD_PROCESS_STOKESFLOW
100#endif
101
102#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
104#endif
105
106#ifdef OGS_BUILD_PROCESS_PHASEFIELD
108#endif
109#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
111#endif
112#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
114#endif
115#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
117#endif
118#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
120#endif
121#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
123#endif
124#ifdef OGS_BUILD_PROCESS_TES
126#endif
127#ifdef OGS_BUILD_PROCESS_TH2M
129#endif
130#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
132#endif
133#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
135#endif
136#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
138#endif
139#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
141#endif
142#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
144#endif
145#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
147#endif
148#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
150#endif
151
152namespace
153{
154void readGeometry(std::string const& fname, GeoLib::GEOObjects& geo_objects)
155{
156 DBUG("Reading geometry file '{:s}'.", fname);
157 GeoLib::IO::BoostXmlGmlInterface gml_reader(geo_objects);
158 gml_reader.readFile(fname);
159}
160
161std::unique_ptr<MeshLib::Mesh> readSingleMesh(
162 BaseLib::ConfigTree const& mesh_config_parameter,
163 std::string const& directory)
164{
165 std::string const mesh_file = BaseLib::copyPathToFileName(
166 mesh_config_parameter.getValue<std::string>(), directory);
167 DBUG("Reading mesh file '{:s}'.", mesh_file);
168
169 auto mesh = std::unique_ptr<MeshLib::Mesh>(
171 if (!mesh)
172 {
173 OGS_FATAL("Could not read mesh from '{:s}' file. No mesh added.",
174 mesh_file);
175 }
176
177#ifdef DOXYGEN_DOCU_ONLY
179 mesh_config_parameter.getConfigAttributeOptional<bool>("axially_symmetric");
180#endif // DOXYGEN_DOCU_ONLY
181
182 if (auto const axially_symmetric =
184 mesh_config_parameter.getConfigAttributeOptional<bool>(
185 "axially_symmetric"))
186 {
187 mesh->setAxiallySymmetric(*axially_symmetric);
188 }
189
190 return mesh;
191}
192
193std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
194 BaseLib::ConfigTree const& config, std::string const& directory)
195{
196 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
197
198 GeoLib::GEOObjects geoObjects;
199
201 auto optional_meshes = config.getConfigSubtreeOptional("meshes");
202 if (optional_meshes)
203 {
204 DBUG("Reading multiple meshes.");
206 auto const configs = optional_meshes->getConfigParameterList("mesh");
207 std::transform(configs.begin(), configs.end(),
208 std::back_inserter(meshes),
209 [&directory](auto const& mesh_config)
210 { return readSingleMesh(mesh_config, directory); });
211 if (auto const geometry_file_name =
213 config.getConfigParameterOptional<std::string>("geometry"))
214 {
215 std::string const geometry_file =
216 BaseLib::copyPathToFileName(*geometry_file_name, directory);
217 readGeometry(geometry_file, geoObjects);
218 }
219 }
220 else
221 { // Read single mesh with geometry.
222 meshes.push_back(
224 readSingleMesh(config.getConfigParameter("mesh"), directory));
225
226 std::string const geometry_file = BaseLib::copyPathToFileName(
228 config.getConfigParameter<std::string>("geometry"),
229 directory);
230 readGeometry(geometry_file, geoObjects);
231 }
232
233 { // generate meshes from geometries
234 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
236 bool const multiple_nodes_allowed = false;
237 auto additional_meshes =
239 geoObjects, *meshes[0], std::move(search_length_algorithm),
240 multiple_nodes_allowed);
241
242 std::move(begin(additional_meshes), end(additional_meshes),
243 std::back_inserter(meshes));
244 }
245
246 auto mesh_names = MeshLib::views::names | ranges::to<std::vector>() |
247 ranges::actions::sort;
248 auto const sorted_names = meshes | mesh_names;
249 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
250 if (unique_names.size() < sorted_names.size())
251 {
252 WARN(
253 "Mesh names aren't unique. From project file read mesh names are:");
254 for (auto const& name : meshes | MeshLib::views::names)
255 {
256 INFO("- {}", name);
257 }
258 }
259
260 auto const zero_mesh_field_data_by_material_ids =
262 config.getConfigParameterOptional<std::vector<int>>(
263 "zero_mesh_field_data_by_material_ids");
264 if (zero_mesh_field_data_by_material_ids)
265 {
266 WARN(
267 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
268 "name may be changed, or it may be removed due to its "
269 "corresponding feature becomes a single tool. Please use it with "
270 "care!");
272 *meshes[0], *zero_mesh_field_data_by_material_ids);
273 }
274
276
277 return meshes;
278}
279
280std::vector<GeoLib::NamedRaster> readRasters(
281 BaseLib::ConfigTree const& config, std::string const& raster_directory,
282 GeoLib::MinMaxPoints const& min_max_points)
283{
284 INFO("readRasters ... ");
285 std::vector<GeoLib::NamedRaster> named_rasters;
286
288 auto optional_rasters = config.getConfigSubtreeOptional("rasters");
289 if (optional_rasters)
290 {
291 INFO("Reading rasters.");
293 auto const configs = optional_rasters->getConfigSubtreeList("raster");
294 std::transform(
295 configs.begin(), configs.end(), std::back_inserter(named_rasters),
296 [&raster_directory, &min_max_points](auto const& raster_config)
297 {
298 return GeoLib::IO::readRaster(raster_config, raster_directory,
299 min_max_points);
300 });
301 }
302 INFO("readRasters done");
303 return named_rasters;
304}
305
306// for debugging raster reading implementation
307// void writeRasters(std::vector<GeoLib::NamedRaster> const& named_rasters,
308// std::string const& output_directory)
309//{
310// for (auto const& named_raster : named_rasters)
311// {
312// #if defined(USE_PETSC)
313// int my_mpi_rank;
314// MPI_Comm_rank(MPI_COMM_WORLD, &my_mpi_rank);
315// #endif
316// FileIO::AsciiRasterInterface::writeRasterAsASC(
317// named_raster.raster, output_directory + "/" +
318// named_raster.raster_name +
319// #if defined(USE_PETSC)
320// "_" + std::to_string(my_mpi_rank) +
321// #endif
322// ".asc");
323// }
324//}
325
326std::optional<ParameterLib::CoordinateSystem> parseLocalCoordinateSystem(
327 std::optional<BaseLib::ConfigTree> const& config,
328 std::vector<std::unique_ptr<ParameterLib::ParameterBase>> const& parameters)
329{
330 if (!config)
331 {
332 return {};
333 }
334
335 DBUG("Reading coordinate system configuration.");
336
337 //
338 // Fetch the first basis vector; its length defines the dimension.
339 //
340 auto const& basis_vector_0 = ParameterLib::findParameter<double>(
341 *config,
343 "basis_vector_0", parameters, 0 /* any dimension */);
344 int const dimension = basis_vector_0.getNumberOfGlobalComponents();
345
346 // check dimension
347 if (dimension != 2 && dimension != 3)
348 {
349 OGS_FATAL(
350 "Basis vector parameter '{:s}' must have two or three components, "
351 "but it has {:d}.",
352 basis_vector_0.name, dimension);
353 }
354
355 //
356 // Fetch the second basis vector, which must be of the same dimension as the
357 // first one.
358 //
359 auto const& basis_vector_1 = ParameterLib::findParameter<double>(
360 *config,
362 "basis_vector_1", parameters, dimension);
363
364 //
365 // For two dimensions, we are done; construct coordinate system;
366 //
367 if (dimension == 2)
368 {
369 return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1};
370 }
371
372 //
373 // Parse the third vector, for three dimensions.
374 //
375 auto const& basis_vector_2 = ParameterLib::findParameter<double>(
376 *config,
378 "basis_vector_2", parameters, dimension);
379 return ParameterLib::CoordinateSystem{basis_vector_0, basis_vector_1,
380 basis_vector_2};
381}
382} // namespace
383
384ProjectData::ProjectData() = default;
385
387 std::string const& project_directory,
388 std::string const& output_directory,
389 std::string const& mesh_directory,
390 [[maybe_unused]] std::string const& script_directory)
391 : _mesh_vec(readMeshes(project_config, mesh_directory)),
392 _named_rasters(readRasters(project_config, project_directory,
393 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
394 _mesh_vec[0]->getNodes().end())
395 .getMinMaxPoints()))
396{
397 // for debugging raster reading implementation
398 // writeRasters(_named_rasters, output_directory);
399 if (auto const python_script =
401 project_config.getConfigParameterOptional<std::string>("python_script"))
402 {
403 namespace py = pybind11;
404
405#ifdef OGS_EMBED_PYTHON_INTERPRETER
406 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
407#endif
408
409 // Append to python's module search path
410 auto py_path = py::module::import("sys").attr("path");
411 py_path.attr("append")(script_directory); // .prj or -s directory
412 // virtualenv
413 py_path.attr("append")(
414 CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
415
416 auto const script_path =
417 BaseLib::copyPathToFileName(*python_script, script_directory);
418
419 // Evaluate in scope of main module
420 py::object scope = py::module::import("__main__").attr("__dict__");
421 // add (global) variables
422 auto globals = py::dict(scope);
423 globals["ogs_prj_directory"] = project_directory;
424 globals["ogs_mesh_directory"] = mesh_directory;
425 globals["ogs_script_directory"] = script_directory;
426 py::eval_file(script_path, scope);
427 }
428
430 parseCurves(project_config.getConfigSubtreeOptional("curves"));
431
432 auto parameter_names_for_transformation =
434 parseParameters(project_config.getConfigSubtree("parameters"));
435
436 _local_coordinate_system = parseLocalCoordinateSystem(
438 project_config.getConfigSubtreeOptional("local_coordinate_system"),
440
441 for (auto& parameter : _parameters)
442 {
443 if (std::find(begin(parameter_names_for_transformation),
444 end(parameter_names_for_transformation),
445 parameter->name) !=
446 end(parameter_names_for_transformation))
447 {
449 {
450 OGS_FATAL(
451 "The parameter '{:s}' is using the local coordinate system "
452 "but no local coordinate system was provided.",
453 parameter->name);
454 }
455 parameter->setCoordinateSystem(*_local_coordinate_system);
456 }
457
458 parameter->initialize(_parameters);
459 }
460
462 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
463
465 parseMedia(project_config.getConfigSubtreeOptional("media"));
466
468 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
469
470 auto chemical_solver_interface = parseChemicalSolverInterface(
472 project_config.getConfigSubtreeOptional("chemical_system"),
473 output_directory);
474
476 parseProcesses(project_config.getConfigSubtree("processes"),
477 project_directory, output_directory,
478 std::move(chemical_solver_interface));
479
481 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
482
484 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
485 output_directory);
486}
487
489 BaseLib::ConfigTree const& process_variables_config)
490{
491 DBUG("Parse process variables:");
492
493 std::set<std::string> names;
494
495 for (auto var_config
497 : process_variables_config.getConfigSubtreeList("process_variable"))
498 {
499 // Either the mesh name is given, or the first mesh's name will be
500 // taken. Taking the first mesh's value is deprecated.
501 auto const mesh_name =
503 var_config.getConfigParameter<std::string>("mesh",
504 _mesh_vec[0]->getName());
505
506 auto& mesh = *BaseLib::findElementOrError(
507 begin(_mesh_vec), end(_mesh_vec),
508 [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
509 "Expected to find a mesh named " + mesh_name + ".");
510
511 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
513 if (!names.insert(pv.getName()).second)
514 {
515 OGS_FATAL("A process variable with name `{:s}' already exists.",
516 pv.getName());
517 }
518
519 _process_variables.push_back(std::move(pv));
520 }
521}
522
523std::vector<std::string> ProjectData::parseParameters(
524 BaseLib::ConfigTree const& parameters_config)
525{
526 using namespace ProcessLib;
527
528 std::set<std::string> names;
529 std::vector<std::string> parameter_names_for_transformation;
530
531 DBUG("Reading parameters:");
532 for (auto parameter_config :
534 parameters_config.getConfigSubtreeList("parameter"))
535 {
536 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
538 if (!names.insert(p->name).second)
539 {
540 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
541 }
542
543 auto const use_local_coordinate_system =
545 parameter_config.getConfigParameterOptional<bool>(
546 "use_local_coordinate_system");
547 if (!!use_local_coordinate_system && *use_local_coordinate_system)
548 {
549 parameter_names_for_transformation.push_back(p->name);
550 }
551
552 _parameters.push_back(std::move(p));
553 }
554
555 _parameters.push_back(
558 _parameters.push_back(
561
562 return parameter_names_for_transformation;
563}
564
566 std::optional<BaseLib::ConfigTree> const& media_config)
567{
568 if (!media_config)
569 {
570 return;
571 }
572
573 DBUG("Reading media:");
574
575 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
576 {
577 ERR("A mesh is required to define medium materials.");
578 return;
579 }
580
581 for (auto const& medium_config :
583 media_config->getConfigSubtreeList("medium"))
584 {
585 auto material_id_string =
587 medium_config.getConfigAttribute<std::string>("id", "0");
588
589 auto const material_ids_of_this_medium =
590 BaseLib::splitMaterialIdString(material_id_string);
591
592 for (auto const& id : material_ids_of_this_medium)
593 {
594 if (_media.find(id) != end(_media))
595 {
596 OGS_FATAL(
597 "Multiple media were specified for the same material id "
598 "'{:d}'. Keep in mind, that if no material id is "
599 "specified, it is assumed to be 0 by default.",
600 id);
601 }
602
603 if (id == material_ids_of_this_medium[0])
604 {
606 id, _mesh_vec[0]->getDimension(), medium_config,
609 : nullptr,
610 _curves);
611 }
612 else
613 {
614 // This medium has multiple material IDs assigned and this is
615 // not the first material ID. Therefore we can reuse the medium
616 // we created before.
617 _media[id] = _media[material_ids_of_this_medium[0]];
618 }
619 }
620 }
621
622 if (_media.empty())
623 {
624 OGS_FATAL("No entity is found inside <media>.");
625 }
626}
627
628std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
630 std::optional<BaseLib::ConfigTree> const& config,
631 std::string const& output_directory)
632{
633 if (!config)
634 {
635 return nullptr;
636 }
637
638 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
639 chemical_solver_interface;
640#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
641 INFO(
642 "Ready for initializing interface to a chemical solver for water "
643 "chemistry calculation.");
644
645 auto const chemical_solver =
647 config->getConfigAttribute<std::string>("chemical_solver");
648
649 if (boost::iequals(chemical_solver, "Phreeqc"))
650 {
651 INFO(
652 "Configuring phreeqc interface for water chemistry calculation "
653 "using file-based approach.");
654
655 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
657 *config, output_directory);
658 }
659 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
660 {
661 OGS_FATAL(
662 "The chemical solver option of PhreeqcKernel is not accessible for "
663 "the time being. Please set 'Phreeqc'' as the chemical solver for "
664 "reactive transport modeling.");
665 }
666 else if (boost::iequals(chemical_solver, "SelfContained"))
667 {
668 INFO(
669 "Use self-contained chemical solver for water chemistry "
670 "calculation.");
671
672 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
674 _mesh_vec, _linear_solvers, *config, output_directory);
675 }
676 else
677 {
678 OGS_FATAL(
679 "Unknown chemical solver. Please specify either Phreeqc or "
680 "PhreeqcKernel as the solver for water chemistry calculation "
681 "instead.");
682 }
683#else
684 (void)output_directory;
685
686 OGS_FATAL(
687 "Found the type of the process to be solved is not component transport "
688 "process. Please specify the process type to ComponentTransport. At "
689 "the present, water chemistry calculation is only available for "
690 "component transport process.");
691#endif
692 return chemical_solver_interface;
693}
694
696 BaseLib::ConfigTree const& processes_config,
697 std::string const& project_directory,
698 std::string const& output_directory,
699 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
700 chemical_solver_interface)
701{
702 (void)project_directory; // to avoid compilation warning
703 (void)output_directory; // to avoid compilation warning
704
705 DBUG("Reading processes:");
707 for (auto process_config : processes_config.getConfigSubtreeList("process"))
708 {
709 auto const type =
711 process_config.peekConfigParameter<std::string>("type");
712
713 auto const name =
715 process_config.getConfigParameter<std::string>("name");
716
717 [[maybe_unused]] auto const integration_order =
719 process_config.getConfigParameter<int>("integration_order");
720
721 std::unique_ptr<ProcessLib::Process> process;
722
723 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
725 process_config.getConfigSubtreeOptional("jacobian_assembler"));
726
727#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
728 if (type == "STEADY_STATE_DIFFUSION")
729 {
730 // The existence check of the in the configuration referenced
731 // process variables is checked in the physical process.
732 // TODO at the moment we have only one mesh, later there can be
733 // several meshes. Then we have to assign the referenced mesh
734 // here.
735 process =
737 name, *_mesh_vec[0], std::move(jacobian_assembler),
738 _process_variables, _parameters, integration_order,
739 process_config, _mesh_vec, _media);
740 }
741 else
742#endif
743#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
744 if (type == "LIQUID_FLOW")
745 {
747 name, *_mesh_vec[0], std::move(jacobian_assembler),
748 _process_variables, _parameters, integration_order,
749 process_config, _mesh_vec, _media);
750 }
751 else
752#endif
753#ifdef OGS_BUILD_PROCESS_STOKESFLOW
754 if (type == "StokesFlow")
755 {
756 switch (_mesh_vec[0]->getDimension())
757 {
758 case 2:
759 process =
761 name, *_mesh_vec[0], std::move(jacobian_assembler),
762 _process_variables, _parameters, integration_order,
763 process_config, _media);
764 break;
765 default:
766 OGS_FATAL(
767 "StokesFlow process does not support given "
768 "dimension {:d}",
769 _mesh_vec[0]->getDimension());
770 }
771 }
772 else
773#endif
774#ifdef OGS_BUILD_PROCESS_TES
775 if (type == "TES")
776 {
778 name, *_mesh_vec[0], std::move(jacobian_assembler),
779 _process_variables, _parameters, integration_order,
780 process_config);
781 }
782 else
783#endif
784#ifdef OGS_BUILD_PROCESS_TH2M
785 if (type == "TH2M")
786 {
787 switch (_mesh_vec[0]->getDimension())
788 {
789 case 2:
791 name, *_mesh_vec[0], std::move(jacobian_assembler),
793 _local_coordinate_system, integration_order,
794 process_config, _media);
795 break;
796 case 3:
798 name, *_mesh_vec[0], std::move(jacobian_assembler),
800 _local_coordinate_system, integration_order,
801 process_config, _media);
802 break;
803 default:
804 OGS_FATAL("TH2M process does not support given dimension");
805 }
806 }
807 else
808#endif
809#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
810 if (type == "HEAT_CONDUCTION")
811 {
813 name, *_mesh_vec[0], std::move(jacobian_assembler),
814 _process_variables, _parameters, integration_order,
815 process_config, _media);
816 }
817 else
818#endif
819#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
820 if (type == "HEAT_TRANSPORT_BHE")
821 {
822 if (_mesh_vec[0]->getDimension() != 3)
823 {
824 OGS_FATAL(
825 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
826 "mesh! ");
827 }
828
829 process =
831 name, *_mesh_vec[0], std::move(jacobian_assembler),
832 _process_variables, _parameters, integration_order,
833 process_config, _curves, _media);
834 }
835 else
836#endif
837#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
838 if (type == "HYDRO_MECHANICS")
839 {
840 if (
841 process_config.getConfigParameterOptional<int>("dimension"))
842 {
843 OGS_FATAL(
844 "The 'dimension' tag has been removed in the merge-request "
845 "!4766."
846 "The dimension is now taken from the main mesh and the tag "
847 "must be"
848 "removed. There is a python script in the merge-request "
849 "description"
850 "for automatic conversion.");
851 }
852 switch (_mesh_vec[0]->getDimension())
853 {
854 case 2:
855 process =
857 2>(name, *_mesh_vec[0],
858 std::move(jacobian_assembler),
860 _local_coordinate_system, integration_order,
861 process_config, _media);
862 break;
863 case 3:
864 process =
866 3>(name, *_mesh_vec[0],
867 std::move(jacobian_assembler),
869 _local_coordinate_system, integration_order,
870 process_config, _media);
871 break;
872 default:
873 OGS_FATAL(
874 "HYDRO_MECHANICS process does not support given "
875 "dimension");
876 }
877 }
878 else
879#endif
880#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
881 if (type == "LARGE_DEFORMATION")
882 {
883 switch (_mesh_vec[0]->getDimension())
884 {
885 case 2:
888 name, *_mesh_vec[0], std::move(jacobian_assembler),
890 _local_coordinate_system, integration_order,
891 process_config, _media);
892 break;
893 case 3:
896 name, *_mesh_vec[0], std::move(jacobian_assembler),
898 _local_coordinate_system, integration_order,
899 process_config, _media);
900 break;
901 default:
902 OGS_FATAL(
903 "LARGE_DEFORMATION process does not support given "
904 "dimension");
905 }
906 }
907 else
908#endif
909#ifdef OGS_BUILD_PROCESS_LIE
910 if (type == "HYDRO_MECHANICS_WITH_LIE")
911 {
912 if (
913 process_config.getConfigParameterOptional<int>("dimension"))
914 {
915 OGS_FATAL(
916 "The 'dimension' tag has been removed in the merge-request "
917 "!4766."
918 "The dimension is now taken from the main mesh and the tag "
919 "must be"
920 "removed. There is a python script in the merge-request "
921 "description"
922 "for automatic conversion.");
923 }
924 switch (_mesh_vec[0]->getDimension())
925 {
926 case 2:
929 name, *_mesh_vec[0], std::move(jacobian_assembler),
931 _local_coordinate_system, integration_order,
932 process_config);
933 break;
934 case 3:
937 name, *_mesh_vec[0], std::move(jacobian_assembler),
939 _local_coordinate_system, integration_order,
940 process_config);
941 break;
942 default:
943 OGS_FATAL(
944 "HYDRO_MECHANICS_WITH_LIE process does not support "
945 "given dimension");
946 }
947 }
948 else
949#endif
950#ifdef OGS_BUILD_PROCESS_HT
951 if (type == "HT")
952 {
954 name, *_mesh_vec[0], std::move(jacobian_assembler),
955 _process_variables, _parameters, integration_order,
956 process_config, _mesh_vec, _media);
957 }
958 else
959#endif
960#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
961 if (type == "ComponentTransport")
962 {
963 process =
965 name, *_mesh_vec[0], std::move(jacobian_assembler),
966 _process_variables, _parameters, integration_order,
967 process_config, _mesh_vec, _media,
968 std::move(chemical_solver_interface));
969 }
970 else
971#endif
972#ifdef OGS_BUILD_PROCESS_PHASEFIELD
973 if (type == "PHASE_FIELD")
974 {
975 switch (_mesh_vec[0]->getDimension())
976 {
977 case 2:
978 process =
980 name, *_mesh_vec[0], std::move(jacobian_assembler),
982 _local_coordinate_system, integration_order,
983 process_config);
984 break;
985 case 3:
986 process =
988 name, *_mesh_vec[0], std::move(jacobian_assembler),
990 _local_coordinate_system, integration_order,
991 process_config);
992 break;
993 }
994 }
995 else
996#endif
997#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
998 if (type == "RichardsComponentTransport")
999 {
1002 name, *_mesh_vec[0], std::move(jacobian_assembler),
1003 _process_variables, _parameters, integration_order,
1004 process_config, _media);
1005 }
1006 else
1007#endif
1008#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1009 if (type == "SMALL_DEFORMATION")
1010 {
1011 switch (_mesh_vec[0]->getDimension())
1012 {
1013 case 2:
1016 name, *_mesh_vec[0], std::move(jacobian_assembler),
1018 _local_coordinate_system, integration_order,
1019 process_config, _media);
1020 break;
1021 case 3:
1024 name, *_mesh_vec[0], std::move(jacobian_assembler),
1026 _local_coordinate_system, integration_order,
1027 process_config, _media);
1028 break;
1029 default:
1030 OGS_FATAL(
1031 "SMALL_DEFORMATION process does not support given "
1032 "dimension");
1033 }
1034 }
1035 else
1036#endif
1037#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1038 if (type == "SMALL_DEFORMATION_NONLOCAL")
1039 {
1040 switch (_mesh_vec[0]->getDimension())
1041 {
1042 case 2:
1045 name, *_mesh_vec[0], std::move(jacobian_assembler),
1047 _local_coordinate_system, integration_order,
1048 process_config);
1049 break;
1050 case 3:
1053 name, *_mesh_vec[0], std::move(jacobian_assembler),
1055 _local_coordinate_system, integration_order,
1056 process_config);
1057 break;
1058 default:
1059 OGS_FATAL(
1060 "SMALL_DEFORMATION_NONLOCAL process does not support "
1061 "given dimension {:d}",
1062 _mesh_vec[0]->getDimension());
1063 }
1064 }
1065 else
1066#endif
1067#ifdef OGS_BUILD_PROCESS_LIE
1068 if (type == "SMALL_DEFORMATION_WITH_LIE")
1069 {
1070 if (
1071 process_config.getConfigParameterOptional<int>("dimension"))
1072 {
1073 OGS_FATAL(
1074 "The 'dimension' tag has been removed in the merge-request "
1075 "!4766."
1076 "The dimension is now taken from the main mesh and the tag "
1077 "must be"
1078 "removed. There is a python script in the merge-request "
1079 "description"
1080 "for automatic conversion.");
1081 }
1082 switch (_mesh_vec[0]->getDimension())
1083 {
1084 case 2:
1087 name, *_mesh_vec[0], std::move(jacobian_assembler),
1089 _local_coordinate_system, integration_order,
1090 process_config);
1091 break;
1092 case 3:
1095 name, *_mesh_vec[0], std::move(jacobian_assembler),
1097 _local_coordinate_system, integration_order,
1098 process_config);
1099 break;
1100 default:
1101 OGS_FATAL(
1102 "SMALL_DEFORMATION_WITH_LIE process does not support "
1103 "given dimension");
1104 }
1105 }
1106 else
1107#endif
1108#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1109 if (type == "THERMO_HYDRO_MECHANICS")
1110 {
1111 if (
1112 process_config.getConfigParameterOptional<int>("dimension"))
1113 {
1114 OGS_FATAL(
1115 "The 'dimension' tag has been removed in the merge-request "
1116 "!4766."
1117 "The dimension is now taken from the main mesh and the tag "
1118 "must be"
1119 "removed. There is a python script in the merge-request "
1120 "description"
1121 "for automatic conversion.");
1122 }
1123 switch (_mesh_vec[0]->getDimension())
1124 {
1125 case 2:
1128 name, *_mesh_vec[0], std::move(jacobian_assembler),
1130 _local_coordinate_system, integration_order,
1131 process_config, _media);
1132 break;
1133 case 3:
1136 name, *_mesh_vec[0], std::move(jacobian_assembler),
1138 _local_coordinate_system, integration_order,
1139 process_config, _media);
1140 break;
1141 default:
1142 OGS_FATAL(
1143 "THERMO_HYDRO_MECHANICS process does not support given "
1144 "dimension");
1145 }
1146 }
1147 else
1148#endif
1149#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1150 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1151 {
1152 switch (_mesh_vec[0]->getDimension())
1153 {
1154 case 2:
1157 name, *_mesh_vec[0], std::move(jacobian_assembler),
1159 _local_coordinate_system, integration_order,
1160 process_config);
1161 break;
1162 case 3:
1165 name, *_mesh_vec[0], std::move(jacobian_assembler),
1167 _local_coordinate_system, integration_order,
1168 process_config);
1169 break;
1170 }
1171 }
1172 else
1173#endif
1174#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1175 if (type == "THERMO_MECHANICS")
1176 {
1177 switch (_mesh_vec[0]->getDimension())
1178 {
1179 case 2:
1182 name, *_mesh_vec[0], std::move(jacobian_assembler),
1184 _local_coordinate_system, integration_order,
1185 process_config, _media);
1186 break;
1187 case 3:
1190 name, *_mesh_vec[0], std::move(jacobian_assembler),
1192 _local_coordinate_system, integration_order,
1193 process_config, _media);
1194 break;
1195 }
1196 }
1197 else
1198#endif
1199#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1200 if (type == "RICHARDS_FLOW")
1201 {
1203 name, *_mesh_vec[0], std::move(jacobian_assembler),
1204 _process_variables, _parameters, integration_order,
1205 process_config, _media);
1206 }
1207 else
1208#endif
1209#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1210 if (type == "RICHARDS_MECHANICS")
1211 {
1212 if (
1213 process_config.getConfigParameterOptional<int>("dimension"))
1214 {
1215 OGS_FATAL(
1216 "The 'dimension' tag has been removed in the merge-request "
1217 "!4766."
1218 "The dimension is now taken from the main mesh and the tag "
1219 "must be"
1220 "removed. There is a python script in the merge-request "
1221 "description"
1222 "for automatic conversion.");
1223 }
1224 switch (_mesh_vec[0]->getDimension())
1225 {
1226 case 2:
1229 name, *_mesh_vec[0], std::move(jacobian_assembler),
1231 _local_coordinate_system, integration_order,
1232 process_config, _media);
1233 break;
1234 case 3:
1237 name, *_mesh_vec[0], std::move(jacobian_assembler),
1239 _local_coordinate_system, integration_order,
1240 process_config, _media);
1241 break;
1242 }
1243 }
1244 else
1245#endif
1246#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1247 if (type == "THERMO_RICHARDS_FLOW")
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_THERMORICHARDSMECHANICS
1258 if (type == "THERMO_RICHARDS_MECHANICS")
1259 {
1260 switch (_mesh_vec[0]->getDimension())
1261 {
1262 case 2:
1265 name, *_mesh_vec[0], std::move(jacobian_assembler),
1267 _local_coordinate_system, integration_order,
1268 process_config, _media);
1269 break;
1270 case 3:
1273 name, *_mesh_vec[0], std::move(jacobian_assembler),
1275 _local_coordinate_system, integration_order,
1276 process_config, _media);
1277 break;
1278 }
1279 }
1280 else
1281#endif
1282
1283#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1284 if (type == "TWOPHASE_FLOW_PP")
1285 {
1286 process =
1288 name, *_mesh_vec[0], std::move(jacobian_assembler),
1289 _process_variables, _parameters, integration_order,
1290 process_config, _media);
1291 }
1292 else
1293#endif
1294#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1295 if (type == "TWOPHASE_FLOW_PRHO")
1296 {
1299 name, *_mesh_vec[0], std::move(jacobian_assembler),
1300 _process_variables, _parameters, integration_order,
1301 process_config, _media);
1302 }
1303 else
1304#endif
1305#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1306 if (type == "THERMAL_TWOPHASE_WITH_PP")
1307 {
1310 name, *_mesh_vec[0], std::move(jacobian_assembler),
1311 _process_variables, _parameters, integration_order,
1312 process_config, _media);
1313 }
1314 else
1315#endif
1316 {
1317 OGS_FATAL("Unknown process type: {:s}", type);
1318 }
1319
1320 if (ranges::contains(_processes, name,
1321 [](std::unique_ptr<ProcessLib::Process> const& p)
1322 { return p->name; }))
1323 {
1324 OGS_FATAL("The process name '{:s}' is not unique.", name);
1325 }
1326 _processes.push_back(std::move(process));
1327 }
1328}
1329
1331 std::string const& output_directory)
1332{
1333 DBUG("Reading time loop configuration.");
1334
1335 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1336 std::begin(_process_variables),
1337 std::end(_process_variables),
1338 [](auto const& process_variable)
1339 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1340
1342 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1343 compensate_non_equilibrium_initial_residuum);
1344
1345 if (!_time_loop)
1346 {
1347 OGS_FATAL("Initialization of time loop failed.");
1348 }
1349}
1350
1352{
1353 DBUG("Reading linear solver configuration.");
1354
1356 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1357 {
1359 auto const name = conf.getConfigParameter<std::string>("name");
1360 auto const linear_solver_parser =
1362 auto const solver_options =
1363 linear_solver_parser.parseNameAndOptions("", &conf);
1364
1367 name,
1368 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1369 std::get<1>(solver_options)),
1370 "The linear solver name is not unique");
1371 }
1372}
1373
1375{
1376 DBUG("Reading non-linear solver configuration.");
1377
1379 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1380 {
1381 auto const ls_name =
1383 conf.getConfigParameter<std::string>("linear_solver");
1384 auto const& linear_solver = BaseLib::getOrError(
1385 _linear_solvers, ls_name,
1386 "A linear solver with the given name does not exist.");
1387
1389 auto const name = conf.getConfigParameter<std::string>("name");
1392 name,
1393 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1394 "The nonlinear solver name is not unique");
1395 }
1396}
1397
1398void ProjectData::parseCurves(std::optional<BaseLib::ConfigTree> const& config)
1399{
1400 if (!config)
1401 {
1402 return;
1403 }
1404
1405 DBUG("Reading curves configuration.");
1406
1408 for (auto conf : config->getConfigSubtreeList("curve"))
1409 {
1411 auto const name = conf.getConfigParameter<std::string>("name");
1413 _curves,
1414 name,
1417 "The curve name is not unique.");
1418 }
1419}
1420
1421MeshLib::Mesh* ProjectData::getMesh(std::string const& mesh_name) const
1422{
1424 begin(_mesh_vec), end(_mesh_vec),
1425 [&mesh_name](auto const& m)
1426 { return m->getName() == mesh_name; },
1427 "Expected to find a mesh named " + mesh_name + ".")
1428 .get();
1429}
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
Definition: ConfigTree.cpp:171
std::optional< T > getConfigParameterOptional(std::string const &param) const
T getConfigParameter(std::string const &param) const
Range< SubtreeIterator > getConfigSubtreeList(std::string const &root) const
Definition: ConfigTree.cpp:185
ConfigTree getConfigSubtree(std::string const &root) const
Definition: ConfigTree.cpp:162
std::optional< T > getConfigAttributeOptional(std::string const &attr) const
Container class for geometric objects.
Definition: GEOObjects.h:61
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
Definition: ProjectData.h:160
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:153
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:163
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.
Definition: ProjectData.h:151
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:147
MeshLib::Mesh * getMesh(std::string const &mesh_name) const
std::vector< GeoLib::NamedRaster > _named_rasters
Definition: ProjectData.h:146
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:148
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:166
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
Definition: ProjectData.h:145
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
Definition: ProjectData.h:155
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.
Definition: ProjectData.h:158
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:103
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
Definition: Algorithm.h:69
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:87
std::string copyPathToFileName(const std::string &file_name, const std::string &source)
Definition: FileTools.cpp:203
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)
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition: Mesh.h:221
void setMeshSpaceDimension(std::vector< std::unique_ptr< Mesh > > const &meshes)
void zeroMeshFieldDataByMaterialIDs(MeshLib::Mesh &mesh, std::vector< int > const &selected_material_ids)
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::optional< ParameterLib::CoordinateSystem > parseLocalCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
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)
void readGeometry(std::string const &fname, GeoLib::GEOObjects &geo_objects)
Definition of readMeshFromFile function.
Single, constant value parameter.
static PROCESSLIB_EXPORT const std::string zero_parameter_name