6#include <pybind11/eval.h>
7#include <spdlog/fmt/ranges.h>
10#include <boost/algorithm/string/predicate.hpp>
12#include <range/v3/algorithm/contains.hpp>
13#include <range/v3/range/conversion.hpp>
14#include <range/v3/view/adjacent_remove_if.hpp>
26#include "InfoLib/CMakeInfo.h"
32#elif defined(USE_PETSC)
56 std::vector<MeshToolsLib::InitialConditionDataSet>& data_initial_conditions,
57 std::vector<std::unique_ptr<MeshLib::Mesh>>
const& meshes,
58 std::vector<std::unique_ptr<ParameterLib::ParameterBase>>
const& parameters)
60 auto const overwrite_mesh_data_config =
63 if (!overwrite_mesh_data_config)
68 for (
auto const& [tag, config] :
69 overwrite_mesh_data_config->getAllChildren())
73 auto const field_name =
75 config->getConfigParameter<std::string>(
"field_name");
77 auto const mesh_name = config->getConfigParameter<std::string>(
78 "mesh", meshes[0]->getName());
82 config->getConfigParameter<std::string>(
"mesh_item_type"));
85 if (properties.template hasPropertyVector<double>(field_name,
88 DBUG(
"remove property: {}", field_name);
94 if (tag ==
"set" || tag ==
"take_original")
102 auto const field_name =
104 config->getConfigParameter<std::string>(
"field_name");
106 auto const mesh_name = config->getConfigParameter<std::string>(
107 "mesh", meshes[0]->getName());
111 config->getConfigParameter<std::string>(
"mesh_item_type"));
123 "overwrite_mesh_data: <{:s}> with mesh_item_type '{:s}' is "
124 "not supported. Only 'node', 'cell' and "
125 "'integration_point' "
126 "can be overwritten.",
134 auto const*
const partitioned_mesh =
136 bool const is_partition =
142 "overwrite_mesh_data: <{:s}> modifying node data is not "
143 "implemented for partitioned (PETSc) meshes.",
147 auto const selected_material_ids_string =
149 config->getConfigParameter<std::string>(
"material_ids",
"0");
152 std::vector<std::size_t> element_ids_for_selected_materials;
153 if (material_ids ==
nullptr)
160 if (selected_material_ids_string !=
"0" &&
161 selected_material_ids_string !=
"*")
164 "overwrite_mesh_data: mesh '{:s}' has no MaterialIDs, "
165 "so material_ids='{:s}' cannot be resolved. Only '0' "
166 "or '*' are valid in this case.",
167 mesh_name, selected_material_ids_string);
169 element_ids_for_selected_materials =
170 ranges::views::iota(std::size_t{0},
171 mesh.getNumberOfElements()) |
172 ranges::to<std::vector>;
179 if (is_partition && selected_material_ids_string !=
"*")
182 "overwrite_mesh_data: <{:s}> material-id-based "
183 "selection (material_ids='{:s}') is not implemented "
185 "partitioned (PETSc) meshes.",
186 tag, selected_material_ids_string);
188 std::set<int>
const selected_material_ids =
190 selected_material_ids_string, material_ids,
' ',
192 ranges::to<std::set<int>>();
193 element_ids_for_selected_materials =
194 ranges::views::iota(std::size_t{0}, material_ids->size()) |
195 ranges::views::filter(
196 [&](std::size_t
const i)
198 return selected_material_ids.contains(
201 ranges::to<std::vector>;
206 auto const& parameter_name =
209 ? config->getConfigParameterOptional<std::string>(
211 : std::optional<std::string>{};
213 if (tag ==
"set" && !parameter_name)
216 "\"set\" element requires a parameter_name attribute.");
219 auto const parameter =
220 !parameter_name || parameter_name->empty()
223 *parameter_name, parameters, 0,
nullptr);
224 data_initial_conditions.emplace_back(
226 std::move(element_ids_for_selected_materials),
235 "Unknown element <{:s}> in <overwrite_mesh_data>. Expected one of "
236 "<remove>, <set>, or <take_original>.",
253#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
257#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
260#ifdef OGS_BUILD_PROCESS_HT
263#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
266#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
269#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
272#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
275#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
278#ifdef OGS_BUILD_PROCESS_LIE_M
281#ifdef OGS_BUILD_PROCESS_LIE_HM
284#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
287#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
291#ifdef OGS_BUILD_PROCESS_PHASEFIELD
294#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
297#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
300#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
303#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
306#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
309#ifdef OGS_BUILD_PROCESS_TH2M
312#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
315#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
318#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
321#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
324#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
331 std::string
const& dir_first, std::string
const& dir_second)
333 DBUG(
"Reading geometry file '{:s}'.", fname);
340 WARN(
"File {:s} not found in {:s}! Trying reading from {:s}.", fname,
341 dir_first, dir_second);
344 OGS_FATAL(
"Could not read geometry file {:s} in {:s}.", fname,
353 std::string
const& directory)
356 directory, mesh_config_parameter.
getValue<std::string>());
357 DBUG(
"Reading mesh file '{:s}'.", mesh_file);
363 std::filesystem::path abspath{mesh_file};
366 abspath = std::filesystem::absolute(mesh_file);
368 catch (std::filesystem::filesystem_error
const& e)
370 ERR(
"Determining the absolute path of '{}' failed: {}", mesh_file,
374 OGS_FATAL(
"Could not read mesh from '{:s}' file. No mesh added.",
378#ifdef DOXYGEN_DOCU_ONLY
383 if (
auto const axially_symmetric =
386 "axially_symmetric"))
388 mesh->setAxiallySymmetric(*axially_symmetric);
389 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
391 OGS_FATAL(
"3D mesh cannot be axially symmetric.");
401 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
409 DBUG(
"Reading multiple meshes.");
411 auto const configs = optional_meshes->getConfigParameterList(
"mesh");
412 std::transform(configs.begin(), configs.end(),
413 std::back_inserter(meshes),
414 [&directory](
auto const& mesh_config)
415 { return readSingleMesh(mesh_config, directory); });
416 if (
auto const geometry_file_name =
420 readGeometry(*geometry_file_name, geoObjects, directory,
430 auto const geometry_file_name =
440 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
442 bool const multiple_nodes_allowed =
false;
443 auto additional_meshes =
445 geoObjects, *meshes[0], std::move(search_length_algorithm),
446 multiple_nodes_allowed);
448 std::move(begin(additional_meshes), end(additional_meshes),
449 std::back_inserter(meshes));
452 if (
auto const duplicates =
456 OGS_FATAL(
"Mesh names aren't unique. Duplicate mesh names are:\n- {}",
457 fmt::join(duplicates,
"\n- "));
463 "zero_mesh_field_data_by_material_ids"))
466 "The project file tag <zero_mesh_field_data_by_material_ids> has "
467 "been removed. Use <overwrite_mesh_data> with a <set> (or "
468 "<take_original>) sub-element and a <material_ids> entry instead.");
480 INFO(
"readRasters ...");
481 std::vector<GeoLib::NamedRaster> named_rasters;
485 if (optional_rasters)
488 auto const configs = optional_rasters->getConfigSubtreeList(
"raster");
490 configs.begin(), configs.end(), std::back_inserter(named_rasters),
491 [&min_max_points](
auto const& raster_config)
492 { return GeoLib::IO::readRaster(raster_config, min_max_points); });
494 INFO(
"readRasters done");
495 return named_rasters;
523 std::string
const& output_directory,
524 std::string
const& mesh_directory,
525 [[maybe_unused]] std::string
const& script_directory)
534 if (
auto const python_script =
538 namespace py = pybind11;
541 auto py_path = py::module::import(
"sys").attr(
"path");
542 py_path.attr(
"append")(script_directory);
544 auto const script_path =
545 BaseLib::joinPaths(script_directory, *python_script);
548 py::object scope = py::module::import(
"__main__").attr(
"__dict__");
550 auto globals = py::dict(scope);
551 globals[
"ogs_prj_directory"] =
552 project_config.projectDirectory().string();
553 globals[
"ogs_mesh_directory"] = mesh_directory;
554 globals[
"ogs_script_directory"] = script_directory;
557 py::eval_file(script_path, scope);
559 catch (py::error_already_set
const& e)
561 OGS_FATAL(
"Error evaluating python script {}: {}", script_path,
567 parseCurves(project_config.getConfigSubtreeOptional(
"curves"));
569 auto parameter_names_for_transformation =
571 parseParameters(project_config.getConfigSubtree(
"parameters"));
575 project_config.getConfigSubtreeOptional(
"local_coordinate_system"),
578 for (
auto& parameter : _parameters)
580 if (std::find(begin(parameter_names_for_transformation),
581 end(parameter_names_for_transformation),
583 end(parameter_names_for_transformation))
585 if (!_local_coordinate_system)
588 "The parameter '{:s}' is using the local coordinate system "
589 "but no local coordinate system was provided.",
592 parameter->setCoordinateSystem(*_local_coordinate_system);
595 parameter->initialize(_parameters);
597 std::vector<MeshToolsLib::InitialConditionDataSet> data_initial_conditions;
603 parseProcessVariables(project_config.getConfigSubtree(
"process_variables"));
606 parseMedia(project_config.getConfigSubtreeOptional(
"media"));
609 parseLinearSolvers(project_config.getConfigSubtree(
"linear_solvers"));
611 auto chemical_solver_interface = parseChemicalSolverInterface(
613 project_config.getConfigSubtreeOptional(
"chemical_system"),
617 parseProcesses(project_config.getConfigSubtree(
"processes"),
619 std::move(chemical_solver_interface));
622 parseNonlinearSolvers(project_config.getConfigSubtree(
"nonlinear_solvers"));
625 parseTimeLoop(project_config.getConfigSubtree(
"time_loop"),
632 DBUG(
"Parse process variables:");
634 std::set<std::string> names;
642 auto const mesh_name =
644 var_config.getConfigParameter<std::string>(
"mesh",
651 if (!names.insert(pv.getName()).second)
653 OGS_FATAL(
"A process variable with name `{:s}' already exists.",
666 std::set<std::string> names;
667 std::vector<std::string> parameter_names_for_transformation;
669 DBUG(
"Reading parameters:");
670 for (
auto parameter_config :
676 if (!names.insert(p->name).second)
678 OGS_FATAL(
"A parameter with name `{:s}' already exists.", p->name);
681 auto const use_local_coordinate_system =
683 parameter_config.getConfigParameterOptional<
bool>(
684 "use_local_coordinate_system");
685 if (!!use_local_coordinate_system && *use_local_coordinate_system)
687 parameter_names_for_transformation.push_back(p->name);
700 return parameter_names_for_transformation;
704 std::optional<BaseLib::ConfigTree>
const& media_config)
711 DBUG(
"Reading media:");
715 ERR(
"A mesh is required to define medium materials.");
719 for (
auto const& medium_config :
721 media_config->getConfigSubtreeList(
"medium"))
723 auto create_medium = [dim =
_mesh_vec[0]->getDimension(),
724 &medium_config,
this](
int const id)
732 auto const material_id_string =
734 medium_config.getConfigAttribute<std::string>(
"id",
"0");
736 std::vector<int>
const material_ids_of_this_medium =
740 for (
auto const&
id : material_ids_of_this_medium)
743 id,
_media, material_ids_of_this_medium, create_medium);
749 OGS_FATAL(
"No entity is found inside <media>.");
753std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
755 std::optional<BaseLib::ConfigTree>
const& config,
756 std::string
const& output_directory)
763 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
764 chemical_solver_interface;
765#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
767 "Ready for initializing interface to a chemical solver for water "
768 "chemistry calculation.");
770 auto const chemical_solver =
772 config->getConfigAttribute<std::string>(
"chemical_solver");
774 if (boost::iequals(chemical_solver,
"Phreeqc"))
777 "Configuring phreeqc interface for water chemistry calculation "
778 "using file-based approach.");
782 *config, output_directory);
784 else if (boost::iequals(chemical_solver,
"PhreeqcKernel"))
787 "The chemical solver option of PhreeqcKernel is not accessible for "
788 "the time being. Please set 'Phreeqc'' as the chemical solver for "
789 "reactive transport modeling.");
791 else if (boost::iequals(chemical_solver,
"SelfContained"))
794 "Use self-contained chemical solver for water chemistry "
804 "Unknown chemical solver. Please specify either Phreeqc or "
805 "PhreeqcKernel as the solver for water chemistry calculation "
809 (void)output_directory;
812 "Found the type of the process to be solved is not component transport "
813 "process. Please specify the process type to ComponentTransport. At "
814 "the present, water chemistry calculation is only available for "
815 "component transport process.");
817 return chemical_solver_interface;
822 std::string
const& output_directory,
823 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
824 chemical_solver_interface)
826 (void)output_directory;
828 DBUG(
"Reading processes:");
834 process_config.peekConfigParameter<std::string>(
"type");
838 process_config.getConfigParameter<std::string>(
"name");
840 [[maybe_unused]]
auto const integration_order =
842 process_config.getConfigParameter<
int>(
"integration_order");
844 std::unique_ptr<ProcessLib::Process> process;
848 process_config.getConfigSubtreeOptional(
"jacobian_assembler"));
850#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
851 if (type ==
"STEADY_STATE_DIFFUSION")
860 name, *
_mesh_vec[0], std::move(jacobian_assembler),
866#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
867 if (type ==
"LIQUID_FLOW")
870 name, *
_mesh_vec[0], std::move(jacobian_assembler),
876#ifdef OGS_BUILD_PROCESS_TH2M
883 name, *
_mesh_vec[0], std::move(jacobian_assembler),
890 name, *
_mesh_vec[0], std::move(jacobian_assembler),
896 OGS_FATAL(
"TH2M process does not support given dimension");
901#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
902 if (type ==
"HEAT_CONDUCTION")
905 name, *
_mesh_vec[0], std::move(jacobian_assembler),
911#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
912 if (type ==
"HEAT_TRANSPORT_BHE")
917 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
923 name, *
_mesh_vec[0], std::move(jacobian_assembler),
929#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
930 if (type ==
"WELLBORE_SIMULATOR")
935 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
941 name, *
_mesh_vec[0], std::move(jacobian_assembler),
947#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
948 if (type ==
"HYDRO_MECHANICS")
951 process_config.getConfigParameterOptional<
int>(
"dimension"))
954 "The 'dimension' tag has been removed in the merge-request "
955 "!4766. The dimension is now taken from the main mesh and "
956 "the tag must be removed. There is a python script in the "
957 "merge-request description for automatic conversion.");
965 std::move(jacobian_assembler),
974 std::move(jacobian_assembler),
981 "HYDRO_MECHANICS process does not support given "
987#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
988 if (type ==
"LARGE_DEFORMATION")
995 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1003 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1010 "LARGE_DEFORMATION process does not support given "
1016#ifdef OGS_BUILD_PROCESS_LIE_HM
1017 if (type ==
"HYDRO_MECHANICS_WITH_LIE")
1020 process_config.getConfigParameterOptional<
int>(
"dimension"))
1023 "The 'dimension' tag has been removed in the merge-request "
1025 "The dimension is now taken from the main mesh and the tag "
1027 "removed. There is a python script in the merge-request "
1029 "for automatic conversion.");
1036 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1044 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1051 "HYDRO_MECHANICS_WITH_LIE process does not support "
1057#ifdef OGS_BUILD_PROCESS_HT
1061 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1067#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
1068 if (type ==
"ComponentTransport")
1072 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1075 std::move(chemical_solver_interface));
1079#ifdef OGS_BUILD_PROCESS_PHASEFIELD
1080 if (type ==
"PHASE_FIELD")
1087 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1095 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1104#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
1105 if (type ==
"HM_PHASE_FIELD")
1112 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1120 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1129#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
1130 if (type ==
"RichardsComponentTransport")
1134 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1140#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1141 if (type ==
"SMALL_DEFORMATION")
1148 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1156 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1163 "SMALL_DEFORMATION process does not support given "
1169#ifdef OGS_BUILD_PROCESS_LIE_M
1170 if (type ==
"SMALL_DEFORMATION_WITH_LIE")
1173 process_config.getConfigParameterOptional<
int>(
"dimension"))
1176 "The 'dimension' tag has been removed in the merge-request "
1178 "The dimension is now taken from the main mesh and the tag "
1180 "removed. There is a python script in the merge-request "
1182 "for automatic conversion.");
1189 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1197 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1204 "SMALL_DEFORMATION_WITH_LIE process does not support "
1210#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1211 if (type ==
"THERMO_HYDRO_MECHANICS")
1214 process_config.getConfigParameterOptional<
int>(
"dimension"))
1217 "The 'dimension' tag has been removed in the merge-request "
1219 "The dimension is now taken from the main mesh and the tag "
1221 "removed. There is a python script in the merge-request "
1223 "for automatic conversion.");
1230 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1238 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1245 "THERMO_HYDRO_MECHANICS process does not support given "
1251#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1252 if (type ==
"THERMO_MECHANICS")
1259 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1267 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1276#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1277 if (type ==
"RICHARDS_FLOW")
1280 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1286#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1287 if (type ==
"RICHARDS_MECHANICS")
1290 process_config.getConfigParameterOptional<
int>(
"dimension"))
1293 "The 'dimension' tag has been removed in the merge-request "
1295 "The dimension is now taken from the main mesh and the tag "
1297 "removed. There is a python script in the merge-request "
1299 "for automatic conversion.");
1306 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1314 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1323#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1324 if (type ==
"THERMO_RICHARDS_FLOW")
1328 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1334#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1335 if (type ==
"THERMO_RICHARDS_MECHANICS")
1342 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1350 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1360#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1361 if (type ==
"TWOPHASE_FLOW_PP")
1365 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1371#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1372 if (type ==
"THERMAL_TWOPHASE_WITH_PP")
1376 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1383 OGS_FATAL(
"Unknown process type: {:s}", type);
1387 [](std::unique_ptr<ProcessLib::Process>
const& p)
1388 {
return p->name; }))
1390 OGS_FATAL(
"The process name '{:s}' is not unique.", name);
1397 std::string
const& output_directory)
1399 DBUG(
"Reading time loop configuration.");
1401 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1404 [](
auto const& process_variable)
1405 {
return process_variable.compensateNonEquilibriumInitialResiduum(); });
1409 compensate_non_equilibrium_initial_residuum);
1413 OGS_FATAL(
"Initialization of time loop failed.");
1419 DBUG(
"Reading linear solver configuration.");
1425 auto const name = conf.getConfigParameter<std::string>(
"name");
1426 auto const linear_solver_parser =
1428 auto const solver_options =
1429 linear_solver_parser.parseNameAndOptions(
"", &conf);
1434 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1435 std::get<1>(solver_options)),
1436 "The linear solver name is not unique");
1442 DBUG(
"Reading non-linear solver configuration.");
1447 auto const ls_name =
1449 conf.getConfigParameter<std::string>(
"linear_solver");
1452 "A linear solver with the given name does not exist.");
1455 auto const name = conf.getConfigParameter<std::string>(
"name");
1460 "The nonlinear solver name is not unique");
1471 DBUG(
"Reading curves configuration.");
1474 for (
auto conf : config->getConfigSubtreeList(
"curve"))
1477 auto const name = conf.getConfigParameter<std::string>(
"name");
1483 "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)
void parseOverwriteMeshData(BaseLib::ConfigTree const &project_config, std::vector< MeshToolsLib::InitialConditionDataSet > &data_initial_conditions, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const ¶meters)
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.
bool isForSingleThread() const
Property manager on mesh items. Class Properties manages scalar, vector or matrix properties....
void removePropertyVector(std::string_view name)
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)
std::vector< ranges::range_value_t< Range > > getDuplicates(Range &&range)
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)
std::vector< int > parseMaterialIdString(std::string const &material_id_string, MeshLib::PropertyVector< int > const *const material_ids, char const separator, bool const validate)
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::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)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
void setMeshSpaceDimension(std::vector< std::unique_ptr< Mesh > > const &meshes)
static constexpr char const * toString(const MeshItemType t)
Returns a char array for a specific MeshItemType.
MeshItemType string2MeshItemType(const std::string &s)
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)
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const ¶meter_name, std::vector< std::unique_ptr< ParameterBase > > const ¶meters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
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