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_RICHARDSCOMPONENTTRANSPORT
120#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
123#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
126#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
129#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
132#ifdef OGS_BUILD_PROCESS_TES
135#ifdef OGS_BUILD_PROCESS_TH2M
138#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
141#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
144#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
147#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
150#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
153#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
156#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
163 std::string
const& dir_first, std::string
const& dir_second)
165 DBUG(
"Reading geometry file '{:s}'.", fname);
172 WARN(
"File {:s} not found in {:s}! Trying reading from {:s}.", fname,
173 dir_first, dir_second);
176 OGS_FATAL(
"Could not read geometry file {:s} in {:s}.", fname,
185 std::string
const& directory)
188 directory, mesh_config_parameter.
getValue<std::string>());
189 DBUG(
"Reading mesh file '{:s}'.", mesh_file);
195 std::filesystem::path abspath{mesh_file};
198 abspath = std::filesystem::absolute(mesh_file);
200 catch (std::filesystem::filesystem_error
const& e)
202 ERR(
"Determining the absolute path of '{}' failed: {}", mesh_file,
206 OGS_FATAL(
"Could not read mesh from '{:s}' file. No mesh added.",
210#ifdef DOXYGEN_DOCU_ONLY
215 if (
auto const axially_symmetric =
218 "axially_symmetric"))
220 mesh->setAxiallySymmetric(*axially_symmetric);
221 if (mesh->getDimension() == 3 && mesh->isAxiallySymmetric())
223 OGS_FATAL(
"3D mesh cannot be axially symmetric.");
232 std::string
const& project_directory)
234 std::vector<std::unique_ptr<MeshLib::Mesh>> meshes;
242 DBUG(
"Reading multiple meshes.");
244 auto const configs = optional_meshes->getConfigParameterList(
"mesh");
245 std::transform(configs.begin(), configs.end(),
246 std::back_inserter(meshes),
247 [&directory](
auto const& mesh_config)
248 { return readSingleMesh(mesh_config, directory); });
249 if (
auto const geometry_file_name =
253 readGeometry(*geometry_file_name, geoObjects, directory,
263 auto const geometry_file_name =
271 std::unique_ptr<MeshGeoToolsLib::SearchLength> search_length_algorithm =
273 bool const multiple_nodes_allowed =
false;
274 auto additional_meshes =
276 geoObjects, *meshes[0], std::move(search_length_algorithm),
277 multiple_nodes_allowed);
279 std::move(begin(additional_meshes), end(additional_meshes),
280 std::back_inserter(meshes));
284 ranges::actions::sort;
285 auto const sorted_names = meshes | mesh_names;
286 auto const unique_names = meshes | mesh_names | ranges::actions::unique;
287 if (unique_names.size() < sorted_names.size())
290 "Mesh names aren't unique. From project file read mesh names are:");
297 auto const zero_mesh_field_data_by_material_ids =
300 "zero_mesh_field_data_by_material_ids");
301 if (zero_mesh_field_data_by_material_ids)
304 "Tag 'zero_mesh_field_data_by_material_ids` is experimental. Its "
305 "name may be changed, or it may be removed due to its "
306 "corresponding feature becomes a single tool. Please use it with "
309 *meshes[0], *zero_mesh_field_data_by_material_ids);
321 INFO(
"readRasters ...");
322 std::vector<GeoLib::NamedRaster> named_rasters;
326 if (optional_rasters)
329 auto const configs = optional_rasters->getConfigSubtreeList(
"raster");
331 configs.begin(), configs.end(), std::back_inserter(named_rasters),
332 [&raster_directory, &min_max_points](
auto const& raster_config)
334 return GeoLib::IO::readRaster(raster_config, raster_directory,
338 INFO(
"readRasters done");
339 return named_rasters;
367 std::string
const& project_directory,
368 std::string
const& output_directory,
369 std::string
const& mesh_directory,
370 [[maybe_unused]] std::string
const& script_directory)
371 : _mesh_vec(
readMeshes(project_config, mesh_directory, project_directory)),
372 _named_rasters(
readRasters(project_config, project_directory,
379 if (
auto const python_script =
383 namespace py = pybind11;
385#ifdef OGS_EMBED_PYTHON_INTERPRETER
390 auto py_path = py::module::import(
"sys").attr(
"path");
391 py_path.attr(
"append")(script_directory);
393 auto const script_path =
397 py::object scope = py::module::import(
"__main__").attr(
"__dict__");
399 auto globals = py::dict(scope);
400 globals[
"ogs_prj_directory"] = project_directory;
401 globals[
"ogs_mesh_directory"] = mesh_directory;
402 globals[
"ogs_script_directory"] = script_directory;
405 py::eval_file(script_path, scope);
407 catch (py::error_already_set
const& e)
409 OGS_FATAL(
"Error evaluating python script {}: {}", script_path,
417 auto parameter_names_for_transformation =
428 if (std::find(begin(parameter_names_for_transformation),
429 end(parameter_names_for_transformation),
431 end(parameter_names_for_transformation))
436 "The parameter '{:s}' is using the local coordinate system "
437 "but no local coordinate system was provided.",
462 project_directory, output_directory,
463 std::move(chemical_solver_interface));
476 DBUG(
"Parse process variables:");
478 std::set<std::string> names;
486 auto const mesh_name =
488 var_config.getConfigParameter<std::string>(
"mesh",
495 if (!names.insert(pv.getName()).second)
497 OGS_FATAL(
"A process variable with name `{:s}' already exists.",
510 std::set<std::string> names;
511 std::vector<std::string> parameter_names_for_transformation;
513 DBUG(
"Reading parameters:");
514 for (
auto parameter_config :
520 if (!names.insert(p->name).second)
522 OGS_FATAL(
"A parameter with name `{:s}' already exists.", p->name);
525 auto const use_local_coordinate_system =
527 parameter_config.getConfigParameterOptional<
bool>(
528 "use_local_coordinate_system");
529 if (!!use_local_coordinate_system && *use_local_coordinate_system)
531 parameter_names_for_transformation.push_back(p->name);
544 return parameter_names_for_transformation;
548 std::optional<BaseLib::ConfigTree>
const& media_config)
555 DBUG(
"Reading media:");
559 ERR(
"A mesh is required to define medium materials.");
563 for (
auto const& medium_config :
565 media_config->getConfigSubtreeList(
"medium"))
567 auto create_medium = [dim =
_mesh_vec[0]->getDimension(),
568 &medium_config,
this](
int const id)
576 auto const material_id_string =
578 medium_config.getConfigAttribute<std::string>(
"id",
"0");
580 std::vector<int>
const material_ids_of_this_medium =
584 for (
auto const&
id : material_ids_of_this_medium)
587 id,
_media, material_ids_of_this_medium, create_medium);
593 OGS_FATAL(
"No entity is found inside <media>.");
597std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
599 std::optional<BaseLib::ConfigTree>
const& config,
600 std::string
const& output_directory)
607 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
608 chemical_solver_interface;
609#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
611 "Ready for initializing interface to a chemical solver for water "
612 "chemistry calculation.");
614 auto const chemical_solver =
616 config->getConfigAttribute<std::string>(
"chemical_solver");
618 if (boost::iequals(chemical_solver,
"Phreeqc"))
621 "Configuring phreeqc interface for water chemistry calculation "
622 "using file-based approach.");
626 *config, output_directory);
628 else if (boost::iequals(chemical_solver,
"PhreeqcKernel"))
631 "The chemical solver option of PhreeqcKernel is not accessible for "
632 "the time being. Please set 'Phreeqc'' as the chemical solver for "
633 "reactive transport modeling.");
635 else if (boost::iequals(chemical_solver,
"SelfContained"))
638 "Use self-contained chemical solver for water chemistry "
648 "Unknown chemical solver. Please specify either Phreeqc or "
649 "PhreeqcKernel as the solver for water chemistry calculation "
653 (void)output_directory;
656 "Found the type of the process to be solved is not component transport "
657 "process. Please specify the process type to ComponentTransport. At "
658 "the present, water chemistry calculation is only available for "
659 "component transport process.");
661 return chemical_solver_interface;
666 std::string
const& project_directory,
667 std::string
const& output_directory,
668 [[maybe_unused]] std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
669 chemical_solver_interface)
671 (void)project_directory;
672 (void)output_directory;
674 DBUG(
"Reading processes:");
680 process_config.peekConfigParameter<std::string>(
"type");
684 process_config.getConfigParameter<std::string>(
"name");
686 [[maybe_unused]]
auto const integration_order =
688 process_config.getConfigParameter<
int>(
"integration_order");
690 std::unique_ptr<ProcessLib::Process> process;
694 process_config.getConfigSubtreeOptional(
"jacobian_assembler"));
696#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
697 if (type ==
"STEADY_STATE_DIFFUSION")
706 name, *
_mesh_vec[0], std::move(jacobian_assembler),
712#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
713 if (type ==
"LIQUID_FLOW")
716 name, *
_mesh_vec[0], std::move(jacobian_assembler),
722#ifdef OGS_BUILD_PROCESS_STOKESFLOW
723 if (type ==
"StokesFlow")
726 "The StokesFlow process is deprecated and will be removed in "
733 name, *
_mesh_vec[0], std::move(jacobian_assembler),
739 "StokesFlow process does not support given "
746#ifdef OGS_BUILD_PROCESS_TES
750 "The TES process is deprecated and will be removed in "
753 name, *
_mesh_vec[0], std::move(jacobian_assembler),
759#ifdef OGS_BUILD_PROCESS_TH2M
766 name, *
_mesh_vec[0], std::move(jacobian_assembler),
773 name, *
_mesh_vec[0], std::move(jacobian_assembler),
779 OGS_FATAL(
"TH2M process does not support given dimension");
784#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
785 if (type ==
"HEAT_CONDUCTION")
788 name, *
_mesh_vec[0], std::move(jacobian_assembler),
794#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
795 if (type ==
"HEAT_TRANSPORT_BHE")
800 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
806 name, *
_mesh_vec[0], std::move(jacobian_assembler),
812#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
813 if (type ==
"WELLBORE_SIMULATOR")
818 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
824 name, *
_mesh_vec[0], std::move(jacobian_assembler),
830#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
831 if (type ==
"HYDRO_MECHANICS")
834 process_config.getConfigParameterOptional<
int>(
"dimension"))
837 "The 'dimension' tag has been removed in the merge-request "
839 "The dimension is now taken from the main mesh and the tag "
841 "removed. There is a python script in the merge-request "
843 "for automatic conversion.");
851 std::move(jacobian_assembler),
860 std::move(jacobian_assembler),
867 "HYDRO_MECHANICS process does not support given "
873#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
874 if (type ==
"LARGE_DEFORMATION")
881 name, *
_mesh_vec[0], std::move(jacobian_assembler),
889 name, *
_mesh_vec[0], std::move(jacobian_assembler),
896 "LARGE_DEFORMATION process does not support given "
902#ifdef OGS_BUILD_PROCESS_LIE_HM
903 if (type ==
"HYDRO_MECHANICS_WITH_LIE")
906 process_config.getConfigParameterOptional<
int>(
"dimension"))
909 "The 'dimension' tag has been removed in the merge-request "
911 "The dimension is now taken from the main mesh and the tag "
913 "removed. There is a python script in the merge-request "
915 "for automatic conversion.");
922 name, *
_mesh_vec[0], std::move(jacobian_assembler),
930 name, *
_mesh_vec[0], std::move(jacobian_assembler),
937 "HYDRO_MECHANICS_WITH_LIE process does not support "
943#ifdef OGS_BUILD_PROCESS_HT
947 name, *
_mesh_vec[0], std::move(jacobian_assembler),
953#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
954 if (type ==
"ComponentTransport")
958 name, *
_mesh_vec[0], std::move(jacobian_assembler),
961 std::move(chemical_solver_interface));
965#ifdef OGS_BUILD_PROCESS_PHASEFIELD
966 if (type ==
"PHASE_FIELD")
973 name, *
_mesh_vec[0], std::move(jacobian_assembler),
981 name, *
_mesh_vec[0], std::move(jacobian_assembler),
990#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
991 if (type ==
"RichardsComponentTransport")
995 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1001#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1002 if (type ==
"SMALL_DEFORMATION")
1009 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1017 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1024 "SMALL_DEFORMATION process does not support given "
1030#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1031 if (type ==
"SMALL_DEFORMATION_NONLOCAL")
1034 "The SMALL_DEFORMATION_NONLOCAL process is deprecated and will "
1035 "be removed in OGS-6.5.5.");
1041 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1049 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1056 "SMALL_DEFORMATION_NONLOCAL process does not support "
1057 "given dimension {:d}",
1063#ifdef OGS_BUILD_PROCESS_LIE_M
1064 if (type ==
"SMALL_DEFORMATION_WITH_LIE")
1067 process_config.getConfigParameterOptional<
int>(
"dimension"))
1070 "The 'dimension' tag has been removed in the merge-request "
1072 "The dimension is now taken from the main mesh and the tag "
1074 "removed. There is a python script in the merge-request "
1076 "for automatic conversion.");
1083 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1091 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1098 "SMALL_DEFORMATION_WITH_LIE process does not support "
1104#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1105 if (type ==
"THERMO_HYDRO_MECHANICS")
1108 process_config.getConfigParameterOptional<
int>(
"dimension"))
1111 "The 'dimension' tag has been removed in the merge-request "
1113 "The dimension is now taken from the main mesh and the tag "
1115 "removed. There is a python script in the merge-request "
1117 "for automatic conversion.");
1124 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1132 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1139 "THERMO_HYDRO_MECHANICS process does not support given "
1145#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1146 if (type ==
"THERMO_MECHANICAL_PHASE_FIELD")
1149 "The THERMO_MECHANICAL_PHASE_FIELD process is deprecated and "
1150 "will be removed in OGS-6.5.5.");
1156 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1164 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1173#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1174 if (type ==
"THERMO_MECHANICS")
1181 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1189 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1198#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1199 if (type ==
"RICHARDS_FLOW")
1202 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1208#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1209 if (type ==
"RICHARDS_MECHANICS")
1212 process_config.getConfigParameterOptional<
int>(
"dimension"))
1215 "The 'dimension' tag has been removed in the merge-request "
1217 "The dimension is now taken from the main mesh and the tag "
1219 "removed. There is a python script in the merge-request "
1221 "for automatic conversion.");
1228 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1236 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1245#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1246 if (type ==
"THERMO_RICHARDS_FLOW")
1250 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1256#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1257 if (type ==
"THERMO_RICHARDS_MECHANICS")
1264 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1272 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1282#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1283 if (type ==
"TWOPHASE_FLOW_PP")
1287 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1293#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1294 if (type ==
"TWOPHASE_FLOW_PRHO")
1297 "The TWOPHASE_FLOW_PRHO process is deprecated and will be "
1298 "removed in OGS-6.5.5.");
1301 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1307#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1308 if (type ==
"THERMAL_TWOPHASE_WITH_PP")
1312 name, *
_mesh_vec[0], std::move(jacobian_assembler),
1319 OGS_FATAL(
"Unknown process type: {:s}", type);
1323 [](std::unique_ptr<ProcessLib::Process>
const& p)
1324 {
return p->name; }))
1326 OGS_FATAL(
"The process name '{:s}' is not unique.", name);
1333 std::string
const& output_directory)
1335 DBUG(
"Reading time loop configuration.");
1337 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1340 [](
auto const& process_variable)
1341 {
return process_variable.compensateNonEquilibriumInitialResiduum(); });
1345 compensate_non_equilibrium_initial_residuum);
1349 OGS_FATAL(
"Initialization of time loop failed.");
1355 DBUG(
"Reading linear solver configuration.");
1361 auto const name = conf.getConfigParameter<std::string>(
"name");
1362 auto const linear_solver_parser =
1364 auto const solver_options =
1365 linear_solver_parser.parseNameAndOptions(
"", &conf);
1370 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1371 std::get<1>(solver_options)),
1372 "The linear solver name is not unique");
1378 DBUG(
"Reading non-linear solver configuration.");
1383 auto const ls_name =
1385 conf.getConfigParameter<std::string>(
"linear_solver");
1388 "A linear solver with the given name does not exist.");
1391 auto const name = conf.getConfigParameter<std::string>(
"name");
1396 "The nonlinear solver name is not unique");
1407 DBUG(
"Reading curves configuration.");
1410 for (
auto conf : config->getConfigSubtreeList(
"curve"))
1413 auto const name = conf.getConfigParameter<std::string>(
"name");
1419 "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()
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)
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