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>
37#include "InfoLib/CMakeInfo.h"
42#elif defined(USE_PETSC)
66#ifdef OGS_EMBED_PYTHON_INTERPRETER
70#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
74#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
77#ifdef OGS_BUILD_PROCESS_HT
80#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
83#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
86#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
89#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
92#ifdef OGS_BUILD_PROCESS_LIE
96#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
99#ifdef OGS_BUILD_PROCESS_STOKESFLOW
103#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
107#ifdef OGS_BUILD_PROCESS_PHASEFIELD
110#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
113#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
116#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
119#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
122#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
125#ifdef OGS_BUILD_PROCESS_TES
128#ifdef OGS_BUILD_PROCESS_TH2M
131#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
134#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
137#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
140#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
143#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
146#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
149#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
156 std::string
const& dir_first, std::string
const& dir_second)
158 DBUG(
"Reading geometry file '{:s}'.", fname);
165 WARN(
"File {:s} not found in {:s}! Trying reading from {:s}.", fname,
166 dir_first, dir_second);
169 OGS_FATAL(
"Could not read geometry file {:s} in {:s}.", fname,
178 std::string
const& directory)
181 mesh_config_parameter.
getValue<std::string>(), directory);
182 DBUG(
"Reading mesh file '{:s}'.", mesh_file);
188 OGS_FATAL(
"Could not read mesh from '{:s}' file. No mesh added.",
192#ifdef DOXYGEN_DOCU_ONLY
197 if (
auto const axially_symmetric =
200 "axially_symmetric"))
202 mesh->setAxiallySymmetric(*axially_symmetric);
210 std::string
const& project_directory)
212 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
220 DBUG(
"Reading multiple meshes.");
222 auto const configs = optional_meshes->getConfigParameterList(
"mesh");
223 std::transform(configs.begin(), configs.end(),
224 std::back_inserter(meshes),
225 [&directory](
auto const& mesh_config)
226 { return readSingleMesh(mesh_config, directory); });
227 if (
auto const geometry_file_name =
231 readGeometry(*geometry_file_name, geoObjects, directory,
241 auto const geometry_file_name =
249 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
251 bool const multiple_nodes_allowed =
false;
252 auto additional_meshes =
254 geoObjects, *meshes[0], std::move(search_length_algorithm),
255 multiple_nodes_allowed);
257 std::move(begin(additional_meshes), end(additional_meshes),
258 std::back_inserter(meshes));
262 ranges::actions::sort;
263 auto const sorted_names = meshes | mesh_names;
264 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
265 if (unique_names.size() < sorted_names.size())
268 "Mesh names aren't unique. From project file read mesh names are:");
275 auto const zero_mesh_field_data_by_material_ids =
278 "zero_mesh_field_data_by_material_ids");
279 if (zero_mesh_field_data_by_material_ids)
282 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
283 "name may be changed, or it may be removed due to its "
284 "corresponding feature becomes a single tool. Please use it with "
287 *meshes[0], *zero_mesh_field_data_by_material_ids);
299 INFO(
"readRasters ...");
300 std::vector<GeoLib::NamedRaster> named_rasters;
304 if (optional_rasters)
307 auto const configs = optional_rasters->getConfigSubtreeList(
"raster");
309 configs.begin(), configs.end(), std::back_inserter(named_rasters),
310 [&raster_directory, &min_max_points](
auto const& raster_config)
312 return GeoLib::IO::readRaster(raster_config, raster_directory,
316 INFO(
"readRasters done");
317 return named_rasters;
345 std::string
const& project_directory,
346 std::string
const& output_directory,
347 std::string
const& mesh_directory,
348 [[maybe_unused]] std::string
const& script_directory)
349 : _mesh_vec(
readMeshes(project_config, mesh_directory, project_directory)),
350 _named_rasters(
readRasters(project_config, project_directory,
357 if (
auto const python_script =
361 namespace py = pybind11;
363#ifdef OGS_EMBED_PYTHON_INTERPRETER
368 auto py_path = py::module::import(
"sys").attr(
"path");
369 py_path.attr(
"append")(script_directory);
371 py_path.attr(
"append")(
372 CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
374 auto const script_path =
378 py::object scope = py::module::import(
"__main__").attr(
"__dict__");
380 auto globals = py::dict(scope);
381 globals[
"ogs_prj_directory"] = project_directory;
382 globals[
"ogs_mesh_directory"] = mesh_directory;
383 globals[
"ogs_script_directory"] = script_directory;
386 py::eval_file(script_path, scope);
388 catch (py::error_already_set
const& e)
390 OGS_FATAL(
"Error evaluating python script {}: {}", script_path,
398 auto parameter_names_for_transformation =
409 if (std::find(begin(parameter_names_for_transformation),
410 end(parameter_names_for_transformation),
412 end(parameter_names_for_transformation))
417 "The parameter '{:s}' is using the local coordinate system "
418 "but no local coordinate system was provided.",
443 project_directory, output_directory,
444 std::move(chemical_solver_interface));
457 DBUG(
"Parse process variables:");
459 std::set<std::string> names;
467 auto const mesh_name =
469 var_config.getConfigParameter<std::string>(
"mesh",
476 if (!names.insert(pv.getName()).second)
478 OGS_FATAL(
"A process variable with name `{:s}' already exists.",
491 std::set<std::string> names;
492 std::vector<std::string> parameter_names_for_transformation;
494 DBUG(
"Reading parameters:");
495 for (
auto parameter_config :
501 if (!names.insert(p->name).second)
503 OGS_FATAL(
"A parameter with name `{:s}' already exists.", p->name);
506 auto const use_local_coordinate_system =
508 parameter_config.getConfigParameterOptional<
bool>(
509 "use_local_coordinate_system");
510 if (!!use_local_coordinate_system && *use_local_coordinate_system)
512 parameter_names_for_transformation.push_back(p->name);
525 return parameter_names_for_transformation;
529 std::optional<BaseLib::ConfigTree>
const& media_config)
536 DBUG(
"Reading media:");
540 ERR(
"A mesh is required to define medium materials.");
544 for (
auto const& medium_config :
546 media_config->getConfigSubtreeList(
"medium"))
548 auto material_id_string =
550 medium_config.getConfigAttribute<std::string>(
"id",
"0");
552 auto const material_ids_of_this_medium =
555 for (
auto const&
id : material_ids_of_this_medium)
560 "Multiple media were specified for the same material id "
561 "'{:d}'. Keep in mind, that if no material id is "
562 "specified, it is assumed to be 0 by default.",
566 if (
id == material_ids_of_this_medium[0])
569 id,
_mesh_vec[0]->getDimension(), medium_config,
587 OGS_FATAL(
"No entity is found inside <media>.");
591std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
593 std::optional<BaseLib::ConfigTree>
const& config,
594 std::string
const& output_directory)
601 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
602 chemical_solver_interface;
603#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
605 "Ready for initializing interface to a chemical solver for water "
606 "chemistry calculation.");
608 auto const chemical_solver =
610 config->getConfigAttribute<std::string>(
"chemical_solver");
612 if (boost::iequals(chemical_solver,
"Phreeqc"))
615 "Configuring phreeqc interface for water chemistry calculation "
616 "using file-based approach.");
620 *config, output_directory);
622 else if (boost::iequals(chemical_solver,
"PhreeqcKernel"))
625 "The chemical solver option of PhreeqcKernel is not accessible for "
626 "the time being. Please set 'Phreeqc'' as the chemical solver for "
627 "reactive transport modeling.");
629 else if (boost::iequals(chemical_solver,
"SelfContained"))
632 "Use self-contained chemical solver for water chemistry "
642 "Unknown chemical solver. Please specify either Phreeqc or "
643 "PhreeqcKernel as the solver for water chemistry calculation "
647 (void)output_directory;
650 "Found the type of the process to be solved is not component transport "
651 "process. Please specify the process type to ComponentTransport. At "
652 "the present, water chemistry calculation is only available for "
653 "component transport process.");
655 return chemical_solver_interface;
660 std::string
const& project_directory,
661 std::string
const& output_directory,
662 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
663 chemical_solver_interface)
665 (void)project_directory;
666 (void)output_directory;
668 DBUG(
"Reading processes:");
674 process_config.peekConfigParameter<std::string>(
"type");
678 process_config.getConfigParameter<std::string>(
"name");
680 [[maybe_unused]]
auto const integration_order =
682 process_config.getConfigParameter<
int>(
"integration_order");
684 std::unique_ptr<ProcessLib::Process> process;
688 process_config.getConfigSubtreeOptional(
"jacobian_assembler"));
690#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
691 if (type ==
"STEADY_STATE_DIFFUSION")
700 name, *
_mesh_vec[0], std::move(jacobian_assembler),
706#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
707 if (type ==
"LIQUID_FLOW")
710 name, *
_mesh_vec[0], std::move(jacobian_assembler),
716#ifdef OGS_BUILD_PROCESS_STOKESFLOW
717 if (type ==
"StokesFlow")
724 name, *
_mesh_vec[0], std::move(jacobian_assembler),
730 "StokesFlow process does not support given "
737#ifdef OGS_BUILD_PROCESS_TES
741 name, *
_mesh_vec[0], std::move(jacobian_assembler),
747#ifdef OGS_BUILD_PROCESS_TH2M
754 name, *
_mesh_vec[0], std::move(jacobian_assembler),
761 name, *
_mesh_vec[0], std::move(jacobian_assembler),
767 OGS_FATAL(
"TH2M process does not support given dimension");
772#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
773 if (type ==
"HEAT_CONDUCTION")
776 name, *
_mesh_vec[0], std::move(jacobian_assembler),
782#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
783 if (type ==
"HEAT_TRANSPORT_BHE")
788 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
794 name, *
_mesh_vec[0], std::move(jacobian_assembler),
800#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
801 if (type ==
"HYDRO_MECHANICS")
804 process_config.getConfigParameterOptional<
int>(
"dimension"))
807 "The 'dimension' tag has been removed in the merge-request "
809 "The dimension is now taken from the main mesh and the tag "
811 "removed. There is a python script in the merge-request "
813 "for automatic conversion.");
821 std::move(jacobian_assembler),
830 std::move(jacobian_assembler),
837 "HYDRO_MECHANICS process does not support given "
843#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
844 if (type ==
"LARGE_DEFORMATION")
851 name, *
_mesh_vec[0], std::move(jacobian_assembler),
859 name, *
_mesh_vec[0], std::move(jacobian_assembler),
866 "LARGE_DEFORMATION process does not support given "
872#ifdef OGS_BUILD_PROCESS_LIE
873 if (type ==
"HYDRO_MECHANICS_WITH_LIE")
876 process_config.getConfigParameterOptional<
int>(
"dimension"))
879 "The 'dimension' tag has been removed in the merge-request "
881 "The dimension is now taken from the main mesh and the tag "
883 "removed. There is a python script in the merge-request "
885 "for automatic conversion.");
892 name, *
_mesh_vec[0], std::move(jacobian_assembler),
900 name, *
_mesh_vec[0], std::move(jacobian_assembler),
907 "HYDRO_MECHANICS_WITH_LIE process does not support "
913#ifdef OGS_BUILD_PROCESS_HT
917 name, *
_mesh_vec[0], std::move(jacobian_assembler),
923#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
924 if (type ==
"ComponentTransport")
928 name, *
_mesh_vec[0], std::move(jacobian_assembler),
931 std::move(chemical_solver_interface));
935#ifdef OGS_BUILD_PROCESS_PHASEFIELD
936 if (type ==
"PHASE_FIELD")
943 name, *
_mesh_vec[0], std::move(jacobian_assembler),
951 name, *
_mesh_vec[0], std::move(jacobian_assembler),
960#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
961 if (type ==
"RichardsComponentTransport")
965 name, *
_mesh_vec[0], std::move(jacobian_assembler),
971#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
972 if (type ==
"SMALL_DEFORMATION")
979 name, *
_mesh_vec[0], std::move(jacobian_assembler),
987 name, *
_mesh_vec[0], std::move(jacobian_assembler),
994 "SMALL_DEFORMATION process does not support given "
1000#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1001 if (type ==
"SMALL_DEFORMATION_NONLOCAL")
1008 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1016 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1023 "SMALL_DEFORMATION_NONLOCAL process does not support "
1024 "given dimension {:d}",
1030#ifdef OGS_BUILD_PROCESS_LIE
1031 if (type ==
"SMALL_DEFORMATION_WITH_LIE")
1034 process_config.getConfigParameterOptional<
int>(
"dimension"))
1037 "The 'dimension' tag has been removed in the merge-request "
1039 "The dimension is now taken from the main mesh and the tag "
1041 "removed. There is a python script in the merge-request "
1043 "for automatic conversion.");
1050 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1058 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1065 "SMALL_DEFORMATION_WITH_LIE process does not support "
1071#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1072 if (type ==
"THERMO_HYDRO_MECHANICS")
1075 process_config.getConfigParameterOptional<
int>(
"dimension"))
1078 "The 'dimension' tag has been removed in the merge-request "
1080 "The dimension is now taken from the main mesh and the tag "
1082 "removed. There is a python script in the merge-request "
1084 "for automatic conversion.");
1091 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1099 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1106 "THERMO_HYDRO_MECHANICS process does not support given "
1112#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1113 if (type ==
"THERMO_MECHANICAL_PHASE_FIELD")
1120 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1128 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1137#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1138 if (type ==
"THERMO_MECHANICS")
1145 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1153 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1162#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1163 if (type ==
"RICHARDS_FLOW")
1166 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1172#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1173 if (type ==
"RICHARDS_MECHANICS")
1176 process_config.getConfigParameterOptional<
int>(
"dimension"))
1179 "The 'dimension' tag has been removed in the merge-request "
1181 "The dimension is now taken from the main mesh and the tag "
1183 "removed. There is a python script in the merge-request "
1185 "for automatic conversion.");
1192 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1200 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1209#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1210 if (type ==
"THERMO_RICHARDS_FLOW")
1214 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1220#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1221 if (type ==
"THERMO_RICHARDS_MECHANICS")
1228 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1236 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1246#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1247 if (type ==
"TWOPHASE_FLOW_PP")
1251 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1257#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1258 if (type ==
"TWOPHASE_FLOW_PRHO")
1262 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1268#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1269 if (type ==
"THERMAL_TWOPHASE_WITH_PP")
1273 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1280 OGS_FATAL(
"Unknown process type: {:s}", type);
1284 [](std::unique_ptr<ProcessLib::Process>
const& p)
1285 {
return p->name; }))
1287 OGS_FATAL(
"The process name '{:s}' is not unique.", name);
1294 std::string
const& output_directory)
1296 DBUG(
"Reading time loop configuration.");
1298 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1301 [](
auto const& process_variable)
1302 {
return process_variable.compensateNonEquilibriumInitialResiduum(); });
1306 compensate_non_equilibrium_initial_residuum);
1310 OGS_FATAL(
"Initialization of time loop failed.");
1316 DBUG(
"Reading linear solver configuration.");
1322 auto const name = conf.getConfigParameter<std::string>(
"name");
1323 auto const linear_solver_parser =
1325 auto const solver_options =
1326 linear_solver_parser.parseNameAndOptions(
"", &conf);
1331 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1332 std::get<1>(solver_options)),
1333 "The linear solver name is not unique");
1339 DBUG(
"Reading non-linear solver configuration.");
1344 auto const ls_name =
1346 conf.getConfigParameter<std::string>(
"linear_solver");
1349 "A linear solver with the given name does not exist.");
1352 auto const name = conf.getConfigParameter<std::string>(
"name");
1357 "The nonlinear solver name is not unique");
1368 DBUG(
"Reading curves configuration.");
1371 for (
auto conf : config->getConfigSubtreeList(
"curve"))
1374 auto const name = conf.getConfigParameter<std::string>(
"name");
1380 "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.
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()
std::vector< int > splitMaterialIdString(std::string const &material_id_string)
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 copyPathToFileName(const std::string &file_name, const std::string &source)
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::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)
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)
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::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< 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