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_BUILD_PROCESS_COMPONENTTRANSPORT
61#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
64#ifdef OGS_BUILD_PROCESS_HT
67#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
70#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
73#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
76#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
79#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
82#ifdef OGS_BUILD_PROCESS_LIE_M
85#ifdef OGS_BUILD_PROCESS_LIE_HM
88#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
91#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
95#ifdef OGS_BUILD_PROCESS_PHASEFIELD
98#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
101#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
104#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
107#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
110#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
113#ifdef OGS_BUILD_PROCESS_TH2M
116#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
119#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
122#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
125#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
128#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
135 std::string
const& dir_first, std::string
const& dir_second)
137 DBUG(
"Reading geometry file '{:s}'.", fname);
144 WARN(
"File {:s} not found in {:s}! Trying reading from {:s}.", fname,
145 dir_first, dir_second);
148 OGS_FATAL(
"Could not read geometry file {:s} in {:s}.", fname,
157 std::string
const& directory)
160 directory, mesh_config_parameter.
getValue<std::string>());
161 DBUG(
"Reading mesh file '{:s}'.", mesh_file);
167 std::filesystem::path abspath{mesh_file};
170 abspath = std::filesystem::absolute(mesh_file);
172 catch (std::filesystem::filesystem_error
const& e)
174 ERR(
"Determining the absolute path of '{}' failed: {}", mesh_file,
178 OGS_FATAL(
"Could not read mesh from '{:s}' file. No mesh added.",
182#ifdef DOXYGEN_DOCU_ONLY
187 if (
auto const axially_symmetric =
190 "axially_symmetric"))
192 mesh->setAxiallySymmetric(*axially_symmetric);
193 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
195 OGS_FATAL(
"3D mesh cannot be axially symmetric.");
205 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
213 DBUG(
"Reading multiple meshes.");
215 auto const configs = optional_meshes->getConfigParameterList(
"mesh");
216 std::transform(configs.begin(), configs.end(),
217 std::back_inserter(meshes),
218 [&directory](
auto const& mesh_config)
219 { return readSingleMesh(mesh_config, directory); });
220 if (
auto const geometry_file_name =
224 readGeometry(*geometry_file_name, geoObjects, directory,
234 auto const geometry_file_name =
244 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
246 bool const multiple_nodes_allowed =
false;
247 auto additional_meshes =
249 geoObjects, *meshes[0], std::move(search_length_algorithm),
250 multiple_nodes_allowed);
252 std::move(begin(additional_meshes), end(additional_meshes),
253 std::back_inserter(meshes));
257 ranges::actions::sort;
258 auto const sorted_names = meshes | mesh_names;
259 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
260 if (unique_names.size() < sorted_names.size())
263 "Mesh names aren't unique. From project file read mesh names are:");
270 auto const zero_mesh_field_data_by_material_ids =
273 "zero_mesh_field_data_by_material_ids");
274 if (zero_mesh_field_data_by_material_ids)
277 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
278 "name may be changed, or it may be removed due to its "
279 "corresponding feature becomes a single tool. Please use it with "
282 *meshes[0], *zero_mesh_field_data_by_material_ids);
294 INFO(
"readRasters ...");
295 std::vector<GeoLib::NamedRaster> named_rasters;
299 if (optional_rasters)
302 auto const configs = optional_rasters->getConfigSubtreeList(
"raster");
304 configs.begin(), configs.end(), std::back_inserter(named_rasters),
305 [&min_max_points](
auto const& raster_config)
306 { return GeoLib::IO::readRaster(raster_config, min_max_points); });
308 INFO(
"readRasters done");
309 return named_rasters;
337 std::string
const& output_directory,
338 std::string
const& mesh_directory,
339 [[maybe_unused]] std::string
const& script_directory)
348 if (
auto const python_script =
352 namespace py = pybind11;
355 auto py_path = py::module::import(
"sys").attr(
"path");
356 py_path.attr(
"append")(script_directory);
358 auto const script_path =
359 BaseLib::joinPaths(script_directory, *python_script);
362 py::object scope = py::module::import(
"__main__").attr(
"__dict__");
364 auto globals = py::dict(scope);
365 globals[
"ogs_prj_directory"] =
366 project_config.projectDirectory().string();
367 globals[
"ogs_mesh_directory"] = mesh_directory;
368 globals[
"ogs_script_directory"] = script_directory;
371 py::eval_file(script_path, scope);
373 catch (py::error_already_set
const& e)
375 OGS_FATAL(
"Error evaluating python script {}: {}", script_path,
381 parseCurves(project_config.getConfigSubtreeOptional(
"curves"));
383 auto parameter_names_for_transformation =
385 parseParameters(project_config.getConfigSubtree(
"parameters"));
389 project_config.getConfigSubtreeOptional(
"local_coordinate_system"),
392 for (
auto& parameter : _parameters)
394 if (std::find(begin(parameter_names_for_transformation),
395 end(parameter_names_for_transformation),
397 end(parameter_names_for_transformation))
399 if (!_local_coordinate_system)
402 "The parameter '{:s}' is using the local coordinate system "
403 "but no local coordinate system was provided.",
406 parameter->setCoordinateSystem(*_local_coordinate_system);
409 parameter->initialize(_parameters);
413 parseProcessVariables(project_config.getConfigSubtree(
"process_variables"));
416 parseMedia(project_config.getConfigSubtreeOptional(
"media"));
419 parseLinearSolvers(project_config.getConfigSubtree(
"linear_solvers"));
421 auto chemical_solver_interface = parseChemicalSolverInterface(
423 project_config.getConfigSubtreeOptional(
"chemical_system"),
427 parseProcesses(project_config.getConfigSubtree(
"processes"),
429 std::move(chemical_solver_interface));
432 parseNonlinearSolvers(project_config.getConfigSubtree(
"nonlinear_solvers"));
435 parseTimeLoop(project_config.getConfigSubtree(
"time_loop"),
442 DBUG(
"Parse process variables:");
444 std::set<std::string> names;
452 auto const mesh_name =
454 var_config.getConfigParameter<std::string>(
"mesh",
461 if (!names.insert(pv.getName()).second)
463 OGS_FATAL(
"A process variable with name `{:s}' already exists.",
476 std::set<std::string> names;
477 std::vector<std::string> parameter_names_for_transformation;
479 DBUG(
"Reading parameters:");
480 for (
auto parameter_config :
486 if (!names.insert(p->name).second)
488 OGS_FATAL(
"A parameter with name `{:s}' already exists.", p->name);
491 auto const use_local_coordinate_system =
493 parameter_config.getConfigParameterOptional<
bool>(
494 "use_local_coordinate_system");
495 if (!!use_local_coordinate_system && *use_local_coordinate_system)
497 parameter_names_for_transformation.push_back(p->name);
510 return parameter_names_for_transformation;
514 std::optional<BaseLib::ConfigTree>
const& media_config)
521 DBUG(
"Reading media:");
525 ERR(
"A mesh is required to define medium materials.");
529 for (
auto const& medium_config :
531 media_config->getConfigSubtreeList(
"medium"))
533 auto create_medium = [dim =
_mesh_vec[0]->getDimension(),
534 &medium_config,
this](
int const id)
542 auto const material_id_string =
544 medium_config.getConfigAttribute<std::string>(
"id",
"0");
546 std::vector<int>
const material_ids_of_this_medium =
550 for (
auto const&
id : material_ids_of_this_medium)
553 id,
_media, material_ids_of_this_medium, create_medium);
559 OGS_FATAL(
"No entity is found inside <media>.");
563std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
565 std::optional<BaseLib::ConfigTree>
const& config,
566 std::string
const& output_directory)
573 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
574 chemical_solver_interface;
575#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
577 "Ready for initializing interface to a chemical solver for water "
578 "chemistry calculation.");
580 auto const chemical_solver =
582 config->getConfigAttribute<std::string>(
"chemical_solver");
584 if (boost::iequals(chemical_solver,
"Phreeqc"))
587 "Configuring phreeqc interface for water chemistry calculation "
588 "using file-based approach.");
592 *config, output_directory);
594 else if (boost::iequals(chemical_solver,
"PhreeqcKernel"))
597 "The chemical solver option of PhreeqcKernel is not accessible for "
598 "the time being. Please set 'Phreeqc'' as the chemical solver for "
599 "reactive transport modeling.");
601 else if (boost::iequals(chemical_solver,
"SelfContained"))
604 "Use self-contained chemical solver for water chemistry "
614 "Unknown chemical solver. Please specify either Phreeqc or "
615 "PhreeqcKernel as the solver for water chemistry calculation "
619 (void)output_directory;
622 "Found the type of the process to be solved is not component transport "
623 "process. Please specify the process type to ComponentTransport. At "
624 "the present, water chemistry calculation is only available for "
625 "component transport process.");
627 return chemical_solver_interface;
632 std::string
const& output_directory,
633 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
634 chemical_solver_interface)
636 (void)output_directory;
638 DBUG(
"Reading processes:");
644 process_config.peekConfigParameter<std::string>(
"type");
648 process_config.getConfigParameter<std::string>(
"name");
650 [[maybe_unused]]
auto const integration_order =
652 process_config.getConfigParameter<
int>(
"integration_order");
654 std::unique_ptr<ProcessLib::Process> process;
658 process_config.getConfigSubtreeOptional(
"jacobian_assembler"));
660#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
661 if (type ==
"STEADY_STATE_DIFFUSION")
670 name, *
_mesh_vec[0], std::move(jacobian_assembler),
676#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
677 if (type ==
"LIQUID_FLOW")
680 name, *
_mesh_vec[0], std::move(jacobian_assembler),
686#ifdef OGS_BUILD_PROCESS_TH2M
693 name, *
_mesh_vec[0], std::move(jacobian_assembler),
700 name, *
_mesh_vec[0], std::move(jacobian_assembler),
706 OGS_FATAL(
"TH2M process does not support given dimension");
711#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
712 if (type ==
"HEAT_CONDUCTION")
715 name, *
_mesh_vec[0], std::move(jacobian_assembler),
721#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
722 if (type ==
"HEAT_TRANSPORT_BHE")
727 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
733 name, *
_mesh_vec[0], std::move(jacobian_assembler),
739#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
740 if (type ==
"WELLBORE_SIMULATOR")
745 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
751 name, *
_mesh_vec[0], std::move(jacobian_assembler),
757#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
758 if (type ==
"HYDRO_MECHANICS")
761 process_config.getConfigParameterOptional<
int>(
"dimension"))
764 "The 'dimension' tag has been removed in the merge-request "
765 "!4766. The dimension is now taken from the main mesh and "
766 "the tag must be removed. There is a python script in the "
767 "merge-request description for automatic conversion.");
775 std::move(jacobian_assembler),
784 std::move(jacobian_assembler),
791 "HYDRO_MECHANICS process does not support given "
797#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
798 if (type ==
"LARGE_DEFORMATION")
805 name, *
_mesh_vec[0], std::move(jacobian_assembler),
813 name, *
_mesh_vec[0], std::move(jacobian_assembler),
820 "LARGE_DEFORMATION process does not support given "
826#ifdef OGS_BUILD_PROCESS_LIE_HM
827 if (type ==
"HYDRO_MECHANICS_WITH_LIE")
830 process_config.getConfigParameterOptional<
int>(
"dimension"))
833 "The 'dimension' tag has been removed in the merge-request "
835 "The dimension is now taken from the main mesh and the tag "
837 "removed. There is a python script in the merge-request "
839 "for automatic conversion.");
846 name, *
_mesh_vec[0], std::move(jacobian_assembler),
854 name, *
_mesh_vec[0], std::move(jacobian_assembler),
861 "HYDRO_MECHANICS_WITH_LIE process does not support "
867#ifdef OGS_BUILD_PROCESS_HT
871 name, *
_mesh_vec[0], std::move(jacobian_assembler),
877#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
878 if (type ==
"ComponentTransport")
882 name, *
_mesh_vec[0], std::move(jacobian_assembler),
885 std::move(chemical_solver_interface));
889#ifdef OGS_BUILD_PROCESS_PHASEFIELD
890 if (type ==
"PHASE_FIELD")
897 name, *
_mesh_vec[0], std::move(jacobian_assembler),
905 name, *
_mesh_vec[0], std::move(jacobian_assembler),
914#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
915 if (type ==
"HM_PHASE_FIELD")
922 name, *
_mesh_vec[0], std::move(jacobian_assembler),
930 name, *
_mesh_vec[0], std::move(jacobian_assembler),
939#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
940 if (type ==
"RichardsComponentTransport")
944 name, *
_mesh_vec[0], std::move(jacobian_assembler),
950#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
951 if (type ==
"SMALL_DEFORMATION")
958 name, *
_mesh_vec[0], std::move(jacobian_assembler),
966 name, *
_mesh_vec[0], std::move(jacobian_assembler),
973 "SMALL_DEFORMATION process does not support given "
979#ifdef OGS_BUILD_PROCESS_LIE_M
980 if (type ==
"SMALL_DEFORMATION_WITH_LIE")
983 process_config.getConfigParameterOptional<
int>(
"dimension"))
986 "The 'dimension' tag has been removed in the merge-request "
988 "The dimension is now taken from the main mesh and the tag "
990 "removed. There is a python script in the merge-request "
992 "for automatic conversion.");
999 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1007 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1014 "SMALL_DEFORMATION_WITH_LIE process does not support "
1020#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1021 if (type ==
"THERMO_HYDRO_MECHANICS")
1024 process_config.getConfigParameterOptional<
int>(
"dimension"))
1027 "The 'dimension' tag has been removed in the merge-request "
1029 "The dimension is now taken from the main mesh and the tag "
1031 "removed. There is a python script in the merge-request "
1033 "for automatic conversion.");
1040 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1048 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1055 "THERMO_HYDRO_MECHANICS process does not support given "
1061#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1062 if (type ==
"THERMO_MECHANICS")
1069 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1077 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1086#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1087 if (type ==
"RICHARDS_FLOW")
1090 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1096#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1097 if (type ==
"RICHARDS_MECHANICS")
1100 process_config.getConfigParameterOptional<
int>(
"dimension"))
1103 "The 'dimension' tag has been removed in the merge-request "
1105 "The dimension is now taken from the main mesh and the tag "
1107 "removed. There is a python script in the merge-request "
1109 "for automatic conversion.");
1116 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1124 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1133#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1134 if (type ==
"THERMO_RICHARDS_FLOW")
1138 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1144#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1145 if (type ==
"THERMO_RICHARDS_MECHANICS")
1152 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1160 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1170#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1171 if (type ==
"TWOPHASE_FLOW_PP")
1175 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1181#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1182 if (type ==
"THERMAL_TWOPHASE_WITH_PP")
1186 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1193 OGS_FATAL(
"Unknown process type: {:s}", type);
1197 [](std::unique_ptr<ProcessLib::Process>
const& p)
1198 {
return p->name; }))
1200 OGS_FATAL(
"The process name '{:s}' is not unique.", name);
1207 std::string
const& output_directory)
1209 DBUG(
"Reading time loop configuration.");
1211 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1214 [](
auto const& process_variable)
1215 {
return process_variable.compensateNonEquilibriumInitialResiduum(); });
1219 compensate_non_equilibrium_initial_residuum);
1223 OGS_FATAL(
"Initialization of time loop failed.");
1229 DBUG(
"Reading linear solver configuration.");
1235 auto const name = conf.getConfigParameter<std::string>(
"name");
1236 auto const linear_solver_parser =
1238 auto const solver_options =
1239 linear_solver_parser.parseNameAndOptions(
"", &conf);
1244 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1245 std::get<1>(solver_options)),
1246 "The linear solver name is not unique");
1252 DBUG(
"Reading non-linear solver configuration.");
1257 auto const ls_name =
1259 conf.getConfigParameter<std::string>(
"linear_solver");
1262 "A linear solver with the given name does not exist.");
1265 auto const name = conf.getConfigParameter<std::string>(
"name");
1270 "The nonlinear solver name is not unique");
1281 DBUG(
"Reading curves configuration.");
1284 for (
auto conf : config->getConfigSubtreeList(
"curve"))
1287 auto const name = conf.getConfigParameter<std::string>(
"name");
1293 "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::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::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
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 > > ¶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