17#include <pybind11/eval.h>
20#include <boost/algorithm/string/predicate.hpp>
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 <range/v3/view/adjacent_remove_if.hpp>
38#include "InfoLib/CMakeInfo.h"
44#elif defined(USE_PETSC)
68#ifdef OGS_EMBED_PYTHON_INTERPRETER
72#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
76#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
79#ifdef OGS_BUILD_PROCESS_HT
82#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
85#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
88#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
91#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
94#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
97#ifdef OGS_BUILD_PROCESS_LIE_M
100#ifdef OGS_BUILD_PROCESS_LIE_HM
103#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
106#ifdef OGS_BUILD_PROCESS_STOKESFLOW
110#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
114#ifdef OGS_BUILD_PROCESS_PHASEFIELD
117#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
120#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
123#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
126#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
129#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
132#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
135#ifdef OGS_BUILD_PROCESS_TES
138#ifdef OGS_BUILD_PROCESS_TH2M
141#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
144#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
147#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
150#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
153#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
156#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
159#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
166 std::string
const& dir_first, std::string
const& dir_second)
168 DBUG(
"Reading geometry file '{:s}'.", fname);
175 WARN(
"File {:s} not found in {:s}! Trying reading from {:s}.", fname,
176 dir_first, dir_second);
179 OGS_FATAL(
"Could not read geometry file {:s} in {:s}.", fname,
188 std::string
const& directory)
191 directory, mesh_config_parameter.
getValue<std::string>());
192 DBUG(
"Reading mesh file '{:s}'.", mesh_file);
198 std::filesystem::path abspath{mesh_file};
201 abspath = std::filesystem::absolute(mesh_file);
203 catch (std::filesystem::filesystem_error
const& e)
205 ERR(
"Determining the absolute path of '{}' failed: {}", mesh_file,
209 OGS_FATAL(
"Could not read mesh from '{:s}' file. No mesh added.",
213#ifdef DOXYGEN_DOCU_ONLY
218 if (
auto const axially_symmetric =
221 "axially_symmetric"))
223 mesh->setAxiallySymmetric(*axially_symmetric);
224 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
226 OGS_FATAL(
"3D mesh cannot be axially symmetric.");
235 std::string
const& project_directory)
237 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
245 DBUG(
"Reading multiple meshes.");
247 auto const configs = optional_meshes->getConfigParameterList(
"mesh");
248 std::transform(configs.begin(), configs.end(),
249 std::back_inserter(meshes),
250 [&directory](
auto const& mesh_config)
251 { return readSingleMesh(mesh_config, directory); });
252 if (
auto const geometry_file_name =
256 readGeometry(*geometry_file_name, geoObjects, directory,
266 auto const geometry_file_name =
276 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
278 bool const multiple_nodes_allowed =
false;
279 auto additional_meshes =
281 geoObjects, *meshes[0], std::move(search_length_algorithm),
282 multiple_nodes_allowed);
284 std::move(begin(additional_meshes), end(additional_meshes),
285 std::back_inserter(meshes));
289 ranges::actions::sort;
290 auto const sorted_names = meshes | mesh_names;
291 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
292 if (unique_names.size() < sorted_names.size())
295 "Mesh names aren't unique. From project file read mesh names are:");
302 auto const zero_mesh_field_data_by_material_ids =
305 "zero_mesh_field_data_by_material_ids");
306 if (zero_mesh_field_data_by_material_ids)
309 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
310 "name may be changed, or it may be removed due to its "
311 "corresponding feature becomes a single tool. Please use it with "
314 *meshes[0], *zero_mesh_field_data_by_material_ids);
326 INFO(
"readRasters ...");
327 std::vector<GeoLib::NamedRaster> named_rasters;
331 if (optional_rasters)
334 auto const configs = optional_rasters->getConfigSubtreeList(
"raster");
336 configs.begin(), configs.end(), std::back_inserter(named_rasters),
337 [&raster_directory, &min_max_points](
auto const& raster_config)
339 return GeoLib::IO::readRaster(raster_config, raster_directory,
343 INFO(
"readRasters done");
344 return named_rasters;
372 std::string
const& project_directory,
373 std::string
const& output_directory,
374 std::string
const& mesh_directory,
375 [[maybe_unused]] std::string
const& script_directory)
376 : _mesh_vec(
readMeshes(project_config, mesh_directory, project_directory)),
377 _named_rasters(
readRasters(project_config, project_directory,
384 if (
auto const python_script =
388 namespace py = pybind11;
390#ifdef OGS_EMBED_PYTHON_INTERPRETER
395 auto py_path = py::module::import(
"sys").attr(
"path");
396 py_path.attr(
"append")(script_directory);
398 auto const script_path =
402 py::object scope = py::module::import(
"__main__").attr(
"__dict__");
404 auto globals = py::dict(scope);
405 globals[
"ogs_prj_directory"] = project_directory;
406 globals[
"ogs_mesh_directory"] = mesh_directory;
407 globals[
"ogs_script_directory"] = script_directory;
410 py::eval_file(script_path, scope);
412 catch (py::error_already_set
const& e)
414 OGS_FATAL(
"Error evaluating python script {}: {}", script_path,
422 auto parameter_names_for_transformation =
433 if (std::find(begin(parameter_names_for_transformation),
434 end(parameter_names_for_transformation),
436 end(parameter_names_for_transformation))
441 "The parameter '{:s}' is using the local coordinate system "
442 "but no local coordinate system was provided.",
467 project_directory, output_directory,
468 std::move(chemical_solver_interface));
481 DBUG(
"Parse process variables:");
483 std::set<std::string> names;
491 auto const mesh_name =
493 var_config.getConfigParameter<std::string>(
"mesh",
500 if (!names.insert(pv.getName()).second)
502 OGS_FATAL(
"A process variable with name `{:s}' already exists.",
515 std::set<std::string> names;
516 std::vector<std::string> parameter_names_for_transformation;
518 DBUG(
"Reading parameters:");
519 for (
auto parameter_config :
525 if (!names.insert(p->name).second)
527 OGS_FATAL(
"A parameter with name `{:s}' already exists.", p->name);
530 auto const use_local_coordinate_system =
532 parameter_config.getConfigParameterOptional<
bool>(
533 "use_local_coordinate_system");
534 if (!!use_local_coordinate_system && *use_local_coordinate_system)
536 parameter_names_for_transformation.push_back(p->name);
549 return parameter_names_for_transformation;
553 std::optional<BaseLib::ConfigTree>
const& media_config)
560 DBUG(
"Reading media:");
564 ERR(
"A mesh is required to define medium materials.");
568 for (
auto const& medium_config :
570 media_config->getConfigSubtreeList(
"medium"))
572 auto create_medium = [dim =
_mesh_vec[0]->getDimension(),
573 &medium_config,
this](
int const id)
581 auto const material_id_string =
583 medium_config.getConfigAttribute<std::string>(
"id",
"0");
585 std::vector<int>
const material_ids_of_this_medium =
589 for (
auto const&
id : material_ids_of_this_medium)
592 id,
_media, material_ids_of_this_medium, create_medium);
598 OGS_FATAL(
"No entity is found inside <media>.");
602std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
604 std::optional<BaseLib::ConfigTree>
const& config,
605 std::string
const& output_directory)
612 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
613 chemical_solver_interface;
614#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
616 "Ready for initializing interface to a chemical solver for water "
617 "chemistry calculation.");
619 auto const chemical_solver =
621 config->getConfigAttribute<std::string>(
"chemical_solver");
623 if (boost::iequals(chemical_solver,
"Phreeqc"))
626 "Configuring phreeqc interface for water chemistry calculation "
627 "using file-based approach.");
631 *config, output_directory);
633 else if (boost::iequals(chemical_solver,
"PhreeqcKernel"))
636 "The chemical solver option of PhreeqcKernel is not accessible for "
637 "the time being. Please set 'Phreeqc'' as the chemical solver for "
638 "reactive transport modeling.");
640 else if (boost::iequals(chemical_solver,
"SelfContained"))
643 "Use self-contained chemical solver for water chemistry "
653 "Unknown chemical solver. Please specify either Phreeqc or "
654 "PhreeqcKernel as the solver for water chemistry calculation "
658 (void)output_directory;
661 "Found the type of the process to be solved is not component transport "
662 "process. Please specify the process type to ComponentTransport. At "
663 "the present, water chemistry calculation is only available for "
664 "component transport process.");
666 return chemical_solver_interface;
671 std::string
const& project_directory,
672 std::string
const& output_directory,
673 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
674 chemical_solver_interface)
676 (void)project_directory;
677 (void)output_directory;
679 DBUG(
"Reading processes:");
685 process_config.peekConfigParameter<std::string>(
"type");
689 process_config.getConfigParameter<std::string>(
"name");
691 [[maybe_unused]]
auto const integration_order =
693 process_config.getConfigParameter<
int>(
"integration_order");
695 std::unique_ptr<ProcessLib::Process> process;
699 process_config.getConfigSubtreeOptional(
"jacobian_assembler"));
701#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
702 if (type ==
"STEADY_STATE_DIFFUSION")
711 name, *
_mesh_vec[0], std::move(jacobian_assembler),
717#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
718 if (type ==
"LIQUID_FLOW")
721 name, *
_mesh_vec[0], std::move(jacobian_assembler),
727#ifdef OGS_BUILD_PROCESS_STOKESFLOW
728 if (type ==
"StokesFlow")
731 "The StokesFlow process is deprecated and will be removed in "
738 name, *
_mesh_vec[0], std::move(jacobian_assembler),
744 "StokesFlow process does not support given "
751#ifdef OGS_BUILD_PROCESS_TES
755 "The TES process is deprecated and will be removed in "
758 name, *
_mesh_vec[0], std::move(jacobian_assembler),
764#ifdef OGS_BUILD_PROCESS_TH2M
771 name, *
_mesh_vec[0], std::move(jacobian_assembler),
778 name, *
_mesh_vec[0], std::move(jacobian_assembler),
784 OGS_FATAL(
"TH2M process does not support given dimension");
789#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
790 if (type ==
"HEAT_CONDUCTION")
793 name, *
_mesh_vec[0], std::move(jacobian_assembler),
799#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
800 if (type ==
"HEAT_TRANSPORT_BHE")
805 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
811 name, *
_mesh_vec[0], std::move(jacobian_assembler),
817#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
818 if (type ==
"WELLBORE_SIMULATOR")
823 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
829 name, *
_mesh_vec[0], std::move(jacobian_assembler),
835#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
836 if (type ==
"HYDRO_MECHANICS")
839 process_config.getConfigParameterOptional<
int>(
"dimension"))
842 "The 'dimension' tag has been removed in the merge-request "
843 "!4766. The dimension is now taken from the main mesh and "
844 "the tag must be removed. There is a python script in the "
845 "merge-request description for automatic conversion.");
853 std::move(jacobian_assembler),
862 std::move(jacobian_assembler),
869 "HYDRO_MECHANICS process does not support given "
875#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
876 if (type ==
"LARGE_DEFORMATION")
883 name, *
_mesh_vec[0], std::move(jacobian_assembler),
891 name, *
_mesh_vec[0], std::move(jacobian_assembler),
898 "LARGE_DEFORMATION process does not support given "
904#ifdef OGS_BUILD_PROCESS_LIE_HM
905 if (type ==
"HYDRO_MECHANICS_WITH_LIE")
908 process_config.getConfigParameterOptional<
int>(
"dimension"))
911 "The 'dimension' tag has been removed in the merge-request "
913 "The dimension is now taken from the main mesh and the tag "
915 "removed. There is a python script in the merge-request "
917 "for automatic conversion.");
924 name, *
_mesh_vec[0], std::move(jacobian_assembler),
932 name, *
_mesh_vec[0], std::move(jacobian_assembler),
939 "HYDRO_MECHANICS_WITH_LIE process does not support "
945#ifdef OGS_BUILD_PROCESS_HT
949 name, *
_mesh_vec[0], std::move(jacobian_assembler),
955#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
956 if (type ==
"ComponentTransport")
960 name, *
_mesh_vec[0], std::move(jacobian_assembler),
963 std::move(chemical_solver_interface));
967#ifdef OGS_BUILD_PROCESS_PHASEFIELD
968 if (type ==
"PHASE_FIELD")
975 name, *
_mesh_vec[0], std::move(jacobian_assembler),
983 name, *
_mesh_vec[0], std::move(jacobian_assembler),
992#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
993 if (type ==
"HM_PHASE_FIELD")
1000 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1008 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1017#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
1018 if (type ==
"RichardsComponentTransport")
1022 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1028#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1029 if (type ==
"SMALL_DEFORMATION")
1036 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1044 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1051 "SMALL_DEFORMATION process does not support given "
1057#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1058 if (type ==
"SMALL_DEFORMATION_NONLOCAL")
1061 "The SMALL_DEFORMATION_NONLOCAL process is deprecated and will "
1062 "be removed in OGS-6.5.5.");
1068 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1076 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1083 "SMALL_DEFORMATION_NONLOCAL process does not support "
1084 "given dimension {:d}",
1090#ifdef OGS_BUILD_PROCESS_LIE_M
1091 if (type ==
"SMALL_DEFORMATION_WITH_LIE")
1094 process_config.getConfigParameterOptional<
int>(
"dimension"))
1097 "The 'dimension' tag has been removed in the merge-request "
1099 "The dimension is now taken from the main mesh and the tag "
1101 "removed. There is a python script in the merge-request "
1103 "for automatic conversion.");
1110 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1118 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1125 "SMALL_DEFORMATION_WITH_LIE process does not support "
1131#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1132 if (type ==
"THERMO_HYDRO_MECHANICS")
1135 process_config.getConfigParameterOptional<
int>(
"dimension"))
1138 "The 'dimension' tag has been removed in the merge-request "
1140 "The dimension is now taken from the main mesh and the tag "
1142 "removed. There is a python script in the merge-request "
1144 "for automatic conversion.");
1151 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1159 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1166 "THERMO_HYDRO_MECHANICS process does not support given "
1172#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1173 if (type ==
"THERMO_MECHANICAL_PHASE_FIELD")
1176 "The THERMO_MECHANICAL_PHASE_FIELD process is deprecated and "
1177 "will be removed in OGS-6.5.5.");
1183 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1191 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1200#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1201 if (type ==
"THERMO_MECHANICS")
1208 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1216 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1225#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1226 if (type ==
"RICHARDS_FLOW")
1229 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1235#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1236 if (type ==
"RICHARDS_MECHANICS")
1239 process_config.getConfigParameterOptional<
int>(
"dimension"))
1242 "The 'dimension' tag has been removed in the merge-request "
1244 "The dimension is now taken from the main mesh and the tag "
1246 "removed. There is a python script in the merge-request "
1248 "for automatic conversion.");
1255 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1263 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1272#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1273 if (type ==
"THERMO_RICHARDS_FLOW")
1277 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1283#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1284 if (type ==
"THERMO_RICHARDS_MECHANICS")
1291 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1299 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1309#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1310 if (type ==
"TWOPHASE_FLOW_PP")
1314 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1320#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1321 if (type ==
"TWOPHASE_FLOW_PRHO")
1324 "The TWOPHASE_FLOW_PRHO process is deprecated and will be "
1325 "removed in OGS-6.5.5.");
1328 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1334#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1335 if (type ==
"THERMAL_TWOPHASE_WITH_PP")
1339 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1346 OGS_FATAL(
"Unknown process type: {:s}", type);
1350 [](std::unique_ptr<ProcessLib::Process>
const& p)
1351 {
return p->name; }))
1353 OGS_FATAL(
"The process name '{:s}' is not unique.", name);
1360 std::string
const& output_directory)
1362 DBUG(
"Reading time loop configuration.");
1364 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1367 [](
auto const& process_variable)
1368 {
return process_variable.compensateNonEquilibriumInitialResiduum(); });
1372 compensate_non_equilibrium_initial_residuum);
1376 OGS_FATAL(
"Initialization of time loop failed.");
1382 DBUG(
"Reading linear solver configuration.");
1388 auto const name = conf.getConfigParameter<std::string>(
"name");
1389 auto const linear_solver_parser =
1391 auto const solver_options =
1392 linear_solver_parser.parseNameAndOptions(
"", &conf);
1397 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1398 std::get<1>(solver_options)),
1399 "The linear solver name is not unique");
1405 DBUG(
"Reading non-linear solver configuration.");
1410 auto const ls_name =
1412 conf.getConfigParameter<std::string>(
"linear_solver");
1415 "A linear solver with the given name does not exist.");
1418 auto const name = conf.getConfigParameter<std::string>(
"name");
1423 "The nonlinear solver name is not unique");
1434 DBUG(
"Reading curves configuration.");
1437 for (
auto conf : config->getConfigSubtreeList(
"curve"))
1440 auto const name = conf.getConfigParameter<std::string>(
"name");
1446 "The curve name is not unique.");
Definition of the AsciiRasterInterface class.
Definition of the BoostXmlGmlInterface class.
Functionality to build different search length algorithm objects from given config.
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)
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)
Definition of the Mesh class.
Definition of the GeoLib::Raster class.
Base class for different search length strategies.
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) 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
ConfigTree getConfigSubtree(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
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &project_directory, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > parseChemicalSolverInterface(std::optional< BaseLib::ConfigTree > const &config, const std::string &output_directory)
void parseMedia(std::optional< BaseLib::ConfigTree > const &media_config)
Parses media configuration and saves them in an object.
void parseLinearSolvers(BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
std::vector< GeoLib::NamedRaster > _named_rasters
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
std::vector< ProcessLib::ProcessVariable > _process_variables
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
void parseCurves(std::optional< BaseLib::ConfigTree > const &config)
std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
void parseTimeLoop(BaseLib::ConfigTree const &config, const std::string &output_directory)
Parses the time loop configuration.
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > _media
std::vector< std::string > parseParameters(BaseLib::ConfigTree const ¶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)
pybind11::scoped_interpreter setupEmbeddedPython()
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 > > const ¶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 > 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 ¶meters, 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 ¶meters, 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 ¶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 > 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 ¶meters, 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 ¶meters, 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 ¶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 > 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 ¶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< std::unique_ptr< MeshLib::Mesh > > readMeshes(BaseLib::ConfigTree const &config, std::string const &directory, std::string const &project_directory)
void readGeometry(std::string const &fname, GeoLib::GEOObjects &geo_objects, std::string const &dir_first, std::string const &dir_second)
std::vector< GeoLib::NamedRaster > readRasters(BaseLib::ConfigTree const &config, std::string const &raster_directory, GeoLib::MinMaxPoints const &min_max_points)
std::unique_ptr< MeshLib::Mesh > readSingleMesh(BaseLib::ConfigTree const &mesh_config_parameter, std::string const &directory)
Definition of readMeshFromFile function.
Single, constant value parameter.
static PROCESSLIB_EXPORT const std::string zero_parameter_name