6#include <pybind11/eval.h>
9#include <boost/algorithm/string/predicate.hpp>
11#include <range/v3/action/sort.hpp>
12#include <range/v3/action/unique.hpp>
13#include <range/v3/algorithm/contains.hpp>
14#include <range/v3/range/conversion.hpp>
15#include <range/v3/view/adjacent_remove_if.hpp>
27#include "InfoLib/CMakeInfo.h"
33#elif defined(USE_PETSC)
57#ifdef OGS_EMBED_PYTHON_INTERPRETER
61#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
65#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
68#ifdef OGS_BUILD_PROCESS_HT
71#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
74#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
77#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
80#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
83#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
86#ifdef OGS_BUILD_PROCESS_LIE_M
89#ifdef OGS_BUILD_PROCESS_LIE_HM
92#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
95#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
99#ifdef OGS_BUILD_PROCESS_PHASEFIELD
102#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
105#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
108#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
111#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
114#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
117#ifdef OGS_BUILD_PROCESS_TH2M
120#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
123#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
126#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
129#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
132#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
139 std::string
const& dir_first, std::string
const& dir_second)
141 DBUG(
"Reading geometry file '{:s}'.", fname);
148 WARN(
"File {:s} not found in {:s}! Trying reading from {:s}.", fname,
149 dir_first, dir_second);
152 OGS_FATAL(
"Could not read geometry file {:s} in {:s}.", fname,
161 std::string
const& directory)
164 directory, mesh_config_parameter.
getValue<std::string>());
165 DBUG(
"Reading mesh file '{:s}'.", mesh_file);
171 std::filesystem::path abspath{mesh_file};
174 abspath = std::filesystem::absolute(mesh_file);
176 catch (std::filesystem::filesystem_error
const& e)
178 ERR(
"Determining the absolute path of '{}' failed: {}", mesh_file,
182 OGS_FATAL(
"Could not read mesh from '{:s}' file. No mesh added.",
186#ifdef DOXYGEN_DOCU_ONLY
191 if (
auto const axially_symmetric =
194 "axially_symmetric"))
196 mesh->setAxiallySymmetric(*axially_symmetric);
197 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
199 OGS_FATAL(
"3D mesh cannot be axially symmetric.");
209 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
217 DBUG(
"Reading multiple meshes.");
219 auto const configs = optional_meshes->getConfigParameterList(
"mesh");
220 std::transform(configs.begin(), configs.end(),
221 std::back_inserter(meshes),
222 [&directory](
auto const& mesh_config)
223 { return readSingleMesh(mesh_config, directory); });
224 if (
auto const geometry_file_name =
228 readGeometry(*geometry_file_name, geoObjects, directory,
238 auto const geometry_file_name =
248 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
250 bool const multiple_nodes_allowed =
false;
251 auto additional_meshes =
253 geoObjects, *meshes[0], std::move(search_length_algorithm),
254 multiple_nodes_allowed);
256 std::move(begin(additional_meshes), end(additional_meshes),
257 std::back_inserter(meshes));
261 ranges::actions::sort;
262 auto const sorted_names = meshes | mesh_names;
263 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
264 if (unique_names.size() < sorted_names.size())
267 "Mesh names aren't unique. From project file read mesh names are:");
274 auto const zero_mesh_field_data_by_material_ids =
277 "zero_mesh_field_data_by_material_ids");
278 if (zero_mesh_field_data_by_material_ids)
281 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
282 "name may be changed, or it may be removed due to its "
283 "corresponding feature becomes a single tool. Please use it with "
286 *meshes[0], *zero_mesh_field_data_by_material_ids);
298 INFO(
"readRasters ...");
299 std::vector<GeoLib::NamedRaster> named_rasters;
303 if (optional_rasters)
306 auto const configs = optional_rasters->getConfigSubtreeList(
"raster");
308 configs.begin(), configs.end(), std::back_inserter(named_rasters),
309 [&min_max_points](
auto const& raster_config)
310 { return GeoLib::IO::readRaster(raster_config, min_max_points); });
312 INFO(
"readRasters done");
313 return named_rasters;
341 std::string
const& output_directory,
342 std::string
const& mesh_directory,
343 [[maybe_unused]] std::string
const& script_directory)
352 if (
auto const python_script =
356 namespace py = pybind11;
358#ifdef OGS_EMBED_PYTHON_INTERPRETER
359 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
360 ApplicationsLib::setupEmbeddedPythonVenvPaths();
364 auto py_path = py::module::import(
"sys").attr(
"path");
365 py_path.attr(
"append")(script_directory);
367 auto const script_path =
368 BaseLib::joinPaths(script_directory, *python_script);
371 py::object scope = py::module::import(
"__main__").attr(
"__dict__");
373 auto globals = py::dict(scope);
374 globals[
"ogs_prj_directory"] =
375 project_config.projectDirectory().string();
376 globals[
"ogs_mesh_directory"] = mesh_directory;
377 globals[
"ogs_script_directory"] = script_directory;
380 py::eval_file(script_path, scope);
382 catch (py::error_already_set
const& e)
384 OGS_FATAL(
"Error evaluating python script {}: {}", script_path,
390 parseCurves(project_config.getConfigSubtreeOptional(
"curves"));
392 auto parameter_names_for_transformation =
394 parseParameters(project_config.getConfigSubtree(
"parameters"));
398 project_config.getConfigSubtreeOptional(
"local_coordinate_system"),
401 for (
auto& parameter : _parameters)
403 if (std::find(begin(parameter_names_for_transformation),
404 end(parameter_names_for_transformation),
406 end(parameter_names_for_transformation))
408 if (!_local_coordinate_system)
411 "The parameter '{:s}' is using the local coordinate system "
412 "but no local coordinate system was provided.",
415 parameter->setCoordinateSystem(*_local_coordinate_system);
418 parameter->initialize(_parameters);
422 parseProcessVariables(project_config.getConfigSubtree(
"process_variables"));
425 parseMedia(project_config.getConfigSubtreeOptional(
"media"));
428 parseLinearSolvers(project_config.getConfigSubtree(
"linear_solvers"));
430 auto chemical_solver_interface = parseChemicalSolverInterface(
432 project_config.getConfigSubtreeOptional(
"chemical_system"),
436 parseProcesses(project_config.getConfigSubtree(
"processes"),
438 std::move(chemical_solver_interface));
441 parseNonlinearSolvers(project_config.getConfigSubtree(
"nonlinear_solvers"));
444 parseTimeLoop(project_config.getConfigSubtree(
"time_loop"),
451 DBUG(
"Parse process variables:");
453 std::set<std::string> names;
461 auto const mesh_name =
463 var_config.getConfigParameter<std::string>(
"mesh",
470 if (!names.insert(pv.getName()).second)
472 OGS_FATAL(
"A process variable with name `{:s}' already exists.",
485 std::set<std::string> names;
486 std::vector<std::string> parameter_names_for_transformation;
488 DBUG(
"Reading parameters:");
489 for (
auto parameter_config :
495 if (!names.insert(p->name).second)
497 OGS_FATAL(
"A parameter with name `{:s}' already exists.", p->name);
500 auto const use_local_coordinate_system =
502 parameter_config.getConfigParameterOptional<
bool>(
503 "use_local_coordinate_system");
504 if (!!use_local_coordinate_system && *use_local_coordinate_system)
506 parameter_names_for_transformation.push_back(p->name);
519 return parameter_names_for_transformation;
523 std::optional<BaseLib::ConfigTree>
const& media_config)
530 DBUG(
"Reading media:");
534 ERR(
"A mesh is required to define medium materials.");
538 for (
auto const& medium_config :
540 media_config->getConfigSubtreeList(
"medium"))
542 auto create_medium = [dim =
_mesh_vec[0]->getDimension(),
543 &medium_config,
this](
int const id)
551 auto const material_id_string =
553 medium_config.getConfigAttribute<std::string>(
"id",
"0");
555 std::vector<int>
const material_ids_of_this_medium =
559 for (
auto const&
id : material_ids_of_this_medium)
562 id,
_media, material_ids_of_this_medium, create_medium);
568 OGS_FATAL(
"No entity is found inside <media>.");
572std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
574 std::optional<BaseLib::ConfigTree>
const& config,
575 std::string
const& output_directory)
582 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
583 chemical_solver_interface;
584#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
586 "Ready for initializing interface to a chemical solver for water "
587 "chemistry calculation.");
589 auto const chemical_solver =
591 config->getConfigAttribute<std::string>(
"chemical_solver");
593 if (boost::iequals(chemical_solver,
"Phreeqc"))
596 "Configuring phreeqc interface for water chemistry calculation "
597 "using file-based approach.");
601 *config, output_directory);
603 else if (boost::iequals(chemical_solver,
"PhreeqcKernel"))
606 "The chemical solver option of PhreeqcKernel is not accessible for "
607 "the time being. Please set 'Phreeqc'' as the chemical solver for "
608 "reactive transport modeling.");
610 else if (boost::iequals(chemical_solver,
"SelfContained"))
613 "Use self-contained chemical solver for water chemistry "
623 "Unknown chemical solver. Please specify either Phreeqc or "
624 "PhreeqcKernel as the solver for water chemistry calculation "
628 (void)output_directory;
631 "Found the type of the process to be solved is not component transport "
632 "process. Please specify the process type to ComponentTransport. At "
633 "the present, water chemistry calculation is only available for "
634 "component transport process.");
636 return chemical_solver_interface;
641 std::string
const& output_directory,
642 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
643 chemical_solver_interface)
645 (void)output_directory;
647 DBUG(
"Reading processes:");
653 process_config.peekConfigParameter<std::string>(
"type");
657 process_config.getConfigParameter<std::string>(
"name");
659 [[maybe_unused]]
auto const integration_order =
661 process_config.getConfigParameter<
int>(
"integration_order");
663 std::unique_ptr<ProcessLib::Process> process;
667 process_config.getConfigSubtreeOptional(
"jacobian_assembler"));
669#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
670 if (type ==
"STEADY_STATE_DIFFUSION")
679 name, *
_mesh_vec[0], std::move(jacobian_assembler),
685#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
686 if (type ==
"LIQUID_FLOW")
689 name, *
_mesh_vec[0], std::move(jacobian_assembler),
695#ifdef OGS_BUILD_PROCESS_TH2M
702 name, *
_mesh_vec[0], std::move(jacobian_assembler),
709 name, *
_mesh_vec[0], std::move(jacobian_assembler),
715 OGS_FATAL(
"TH2M process does not support given dimension");
720#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
721 if (type ==
"HEAT_CONDUCTION")
724 name, *
_mesh_vec[0], std::move(jacobian_assembler),
730#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
731 if (type ==
"HEAT_TRANSPORT_BHE")
736 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
742 name, *
_mesh_vec[0], std::move(jacobian_assembler),
748#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
749 if (type ==
"WELLBORE_SIMULATOR")
754 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
760 name, *
_mesh_vec[0], std::move(jacobian_assembler),
766#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
767 if (type ==
"HYDRO_MECHANICS")
770 process_config.getConfigParameterOptional<
int>(
"dimension"))
773 "The 'dimension' tag has been removed in the merge-request "
774 "!4766. The dimension is now taken from the main mesh and "
775 "the tag must be removed. There is a python script in the "
776 "merge-request description for automatic conversion.");
784 std::move(jacobian_assembler),
793 std::move(jacobian_assembler),
800 "HYDRO_MECHANICS process does not support given "
806#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
807 if (type ==
"LARGE_DEFORMATION")
814 name, *
_mesh_vec[0], std::move(jacobian_assembler),
822 name, *
_mesh_vec[0], std::move(jacobian_assembler),
829 "LARGE_DEFORMATION process does not support given "
835#ifdef OGS_BUILD_PROCESS_LIE_HM
836 if (type ==
"HYDRO_MECHANICS_WITH_LIE")
839 process_config.getConfigParameterOptional<
int>(
"dimension"))
842 "The 'dimension' tag has been removed in the merge-request "
844 "The dimension is now taken from the main mesh and the tag "
846 "removed. There is a python script in the merge-request "
848 "for automatic conversion.");
855 name, *
_mesh_vec[0], std::move(jacobian_assembler),
863 name, *
_mesh_vec[0], std::move(jacobian_assembler),
870 "HYDRO_MECHANICS_WITH_LIE process does not support "
876#ifdef OGS_BUILD_PROCESS_HT
880 name, *
_mesh_vec[0], std::move(jacobian_assembler),
886#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
887 if (type ==
"ComponentTransport")
891 name, *
_mesh_vec[0], std::move(jacobian_assembler),
894 std::move(chemical_solver_interface));
898#ifdef OGS_BUILD_PROCESS_PHASEFIELD
899 if (type ==
"PHASE_FIELD")
906 name, *
_mesh_vec[0], std::move(jacobian_assembler),
914 name, *
_mesh_vec[0], std::move(jacobian_assembler),
923#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
924 if (type ==
"HM_PHASE_FIELD")
931 name, *
_mesh_vec[0], std::move(jacobian_assembler),
939 name, *
_mesh_vec[0], std::move(jacobian_assembler),
948#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
949 if (type ==
"RichardsComponentTransport")
953 name, *
_mesh_vec[0], std::move(jacobian_assembler),
959#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
960 if (type ==
"SMALL_DEFORMATION")
967 name, *
_mesh_vec[0], std::move(jacobian_assembler),
975 name, *
_mesh_vec[0], std::move(jacobian_assembler),
982 "SMALL_DEFORMATION process does not support given "
988#ifdef OGS_BUILD_PROCESS_LIE_M
989 if (type ==
"SMALL_DEFORMATION_WITH_LIE")
992 process_config.getConfigParameterOptional<
int>(
"dimension"))
995 "The 'dimension' tag has been removed in the merge-request "
997 "The dimension is now taken from the main mesh and the tag "
999 "removed. There is a python script in the merge-request "
1001 "for automatic conversion.");
1008 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1016 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1023 "SMALL_DEFORMATION_WITH_LIE process does not support "
1029#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1030 if (type ==
"THERMO_HYDRO_MECHANICS")
1033 process_config.getConfigParameterOptional<
int>(
"dimension"))
1036 "The 'dimension' tag has been removed in the merge-request "
1038 "The dimension is now taken from the main mesh and the tag "
1040 "removed. There is a python script in the merge-request "
1042 "for automatic conversion.");
1049 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1057 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1064 "THERMO_HYDRO_MECHANICS process does not support given "
1070#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1071 if (type ==
"THERMO_MECHANICS")
1078 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1086 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1095#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1096 if (type ==
"RICHARDS_FLOW")
1099 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1105#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1106 if (type ==
"RICHARDS_MECHANICS")
1109 process_config.getConfigParameterOptional<
int>(
"dimension"))
1112 "The 'dimension' tag has been removed in the merge-request "
1114 "The dimension is now taken from the main mesh and the tag "
1116 "removed. There is a python script in the merge-request "
1118 "for automatic conversion.");
1125 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1133 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1142#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1143 if (type ==
"THERMO_RICHARDS_FLOW")
1147 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1153#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1154 if (type ==
"THERMO_RICHARDS_MECHANICS")
1161 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1169 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1179#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1180 if (type ==
"TWOPHASE_FLOW_PP")
1184 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1190#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1191 if (type ==
"THERMAL_TWOPHASE_WITH_PP")
1195 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1202 OGS_FATAL(
"Unknown process type: {:s}", type);
1206 [](std::unique_ptr<ProcessLib::Process>
const& p)
1207 {
return p->name; }))
1209 OGS_FATAL(
"The process name '{:s}' is not unique.", name);
1216 std::string
const& output_directory)
1218 DBUG(
"Reading time loop configuration.");
1220 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1223 [](
auto const& process_variable)
1224 {
return process_variable.compensateNonEquilibriumInitialResiduum(); });
1228 compensate_non_equilibrium_initial_residuum);
1232 OGS_FATAL(
"Initialization of time loop failed.");
1238 DBUG(
"Reading linear solver configuration.");
1244 auto const name = conf.getConfigParameter<std::string>(
"name");
1245 auto const linear_solver_parser =
1247 auto const solver_options =
1248 linear_solver_parser.parseNameAndOptions(
"", &conf);
1253 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1254 std::get<1>(solver_options)),
1255 "The linear solver name is not unique");
1261 DBUG(
"Reading non-linear solver configuration.");
1266 auto const ls_name =
1268 conf.getConfigParameter<std::string>(
"linear_solver");
1271 "A linear solver with the given name does not exist.");
1274 auto const name = conf.getConfigParameter<std::string>(
"name");
1279 "The nonlinear solver name is not unique");
1290 DBUG(
"Reading curves configuration.");
1293 for (
auto conf : config->getConfigSubtreeList(
"curve"))
1296 auto const name = conf.getConfigParameter<std::string>(
"name");
1302 "The curve name is not unique.");
Chemical-solver interface used in OGS operator-split reactive transport.
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)
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
std::filesystem::path projectDirectory() const
std::optional< T > getConfigParameterOptional(std::string const ¶m) const
T getConfigParameter(std::string const ¶m) const
Range< SubtreeIterator > getConfigSubtreeList(std::string const &root) const
std::optional< T > getConfigAttributeOptional(std::string const &attr) const
Container class for geometric objects.
std::vector< PolylineVec * > const & getPolylines() const
Read access to polylines w/o using a name.
std::vector< PointVec * > const & getPoints() const
Read access to points w/o using a name.
std::vector< SurfaceVec * > const & getSurfaces() const
Read access to surfaces w/o using a name.
bool readFile(const std::string &fname) override
Reads an xml-file containing OGS geometry.
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
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
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)
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
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
std::vector< std::string > getMeshNames() const
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 ¶meters_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)
std::vector< std::unique_ptr< MeshLib::Mesh > > readMeshes(std::vector< std::string > const &filenames)
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
bool IsFileExisting(const std::string &strFilename)
Returns true if given file exists.
std::string joinPaths(std::string const &pathA, std::string const &pathB)
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
std::unique_ptr< ChemicalSolverInterface > createChemicalSolverInterface(std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< std::string, std::unique_ptr< GlobalLinearSolver > > const &linear_solvers, BaseLib::ConfigTree const &config, std::string const &output_directory)
void createMediumForId(int const id, std::map< int, std::shared_ptr< T > > &media, std::vector< int > const &material_ids_of_this_medium, CreateMedium &&create_medium)
std::vector< int > parseMaterialIdString(std::string const &material_id_string, MeshLib::PropertyVector< int > const *const material_ids)
std::unique_ptr< Medium > createMedium(int const material_id, int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > ¶meters, 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)
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.
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
void setMeshSpaceDimension(std::vector< std::unique_ptr< Mesh > > const &meshes)
std::optional< ParameterLib::CoordinateSystem > createCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters)
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)
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 ¶meters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
template std::unique_ptr< Process > createHMPhaseFieldProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createHMPhaseFieldProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHTProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createHydroMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createTH2MProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, 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 ¶meters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createWellboreSimulatorProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters, 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< GeoLib::NamedRaster > readRasters(BaseLib::ConfigTree const &config, GeoLib::MinMaxPoints const &min_max_points)
std::vector< std::unique_ptr< MeshLib::Mesh > > readMeshes(BaseLib::ConfigTree const &config, std::string const &directory)
void readGeometry(std::string const &fname, GeoLib::GEOObjects &geo_objects, std::string const &dir_first, std::string const &dir_second)
std::unique_ptr< MeshLib::Mesh > readSingleMesh(BaseLib::ConfigTree const &mesh_config_parameter, std::string const &directory)
Single, constant value parameter.
static PROCESSLIB_EXPORT const std::string zero_parameter_name