OGS
ProjectData Class Referencefinal

Detailed Description

The ProjectData Object contains all the data needed for a certain project, i.e. all geometric data (stored in a GEOObjects-object), all the meshes, processes, and process variables.

Definition at line 60 of file ProjectData.h.

#include <ProjectData.h>

Public Member Functions

 ProjectData ()
 
 ProjectData (BaseLib::ConfigTree const &project_config, std::string const &project_directory, std::string const &output_directory, std::string const &mesh_directory, std::string const &script_directory)
 
 ProjectData (ProjectData &)=delete
 
std::vector< std::unique_ptr< ProcessLib::Process > > const & getProcesses () const
 Provides read access to the process container.
 
ProcessLib::TimeLoopgetTimeLoop ()
 
MeshLib::MeshgetMesh (std::string const &mesh_name) const
 
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & getMedia () const
 

Private Member Functions

void parseProcessVariables (BaseLib::ConfigTree const &process_variables_config)
 
std::vector< std::string > parseParameters (BaseLib::ConfigTree const &parameters_config)
 
void parseMedia (std::optional< BaseLib::ConfigTree > const &media_config)
 Parses media configuration and saves them in an object.
 
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)
 
void parseTimeLoop (BaseLib::ConfigTree const &config, const std::string &output_directory)
 Parses the time loop configuration.
 
void parseLinearSolvers (BaseLib::ConfigTree const &config)
 
void parseNonlinearSolvers (BaseLib::ConfigTree const &config)
 
void parseCurves (std::optional< BaseLib::ConfigTree > const &config)
 
std::unique_ptr< ChemistryLib::ChemicalSolverInterfaceparseChemicalSolverInterface (std::optional< BaseLib::ConfigTree > const &config, const std::string &output_directory)
 

Private Attributes

std::vector< std::unique_ptr< MeshLib::Mesh > > _mesh_vec
 
std::vector< GeoLib::NamedRaster_named_rasters
 
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
 
std::vector< ProcessLib::ProcessVariable_process_variables
 
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
 Buffer for each parameter config passed to the process.
 
std::optional< ParameterLib::CoordinateSystem_local_coordinate_system
 
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > _media
 
std::unique_ptr< ProcessLib::TimeLoop_time_loop
 The time loop used to solve this project's processes.
 
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
 
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
 
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
 

Constructor & Destructor Documentation

◆ ProjectData() [1/3]

ProjectData::ProjectData ( )
default

The empty constructor used in the gui, for example, when the project's configuration is not loaded yet.

◆ ProjectData() [2/3]

ProjectData::ProjectData ( BaseLib::ConfigTree const & project_config,
std::string const & project_directory,
std::string const & output_directory,
std::string const & mesh_directory,
std::string const & script_directory )

Constructs project data by parsing provided configuration.

Parameters
project_configConfiguration as read from the prj file.
project_directoryWhere to look for files referenced in the config_tree.
output_directoryWhere to write simulation output files to.
mesh_directoryDirectory where meshes are read from.
script_directoryDirectory where scripts (e.g. Python BCs) are read from.
Input File Parameter
prj__python_script
Input File Parameter
prj__curves
Input File Parameter
prj__parameters
Input File Parameter
prj__local_coordinate_system
Input File Parameter
prj__process_variables
Input File Parameter
prj__media
Input File Parameter
prj__linear_solvers
Input File Parameter
prj__chemical_system
Input File Parameter
prj__processes
Input File Parameter
prj__nonlinear_solvers
Input File Parameter
prj__time_loop

Definition at line 344 of file ProjectData.cpp.

349 : _mesh_vec(readMeshes(project_config, mesh_directory, project_directory)),
350 _named_rasters(readRasters(project_config, project_directory,
351 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
352 _mesh_vec[0]->getNodes().end())
353 .getMinMaxPoints()))
354{
355 // for debugging raster reading implementation
356 // writeRasters(_named_rasters, output_directory);
357 if (auto const python_script =
359 project_config.getConfigParameterOptional<std::string>("python_script"))
360 {
361 namespace py = pybind11;
362
363#ifdef OGS_EMBED_PYTHON_INTERPRETER
364 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
365#endif
366
367 // Append to python's module search path
368 auto py_path = py::module::import("sys").attr("path");
369 py_path.attr("append")(script_directory); // .prj or -s directory
370 // virtualenv
371 py_path.attr("append")(
372 CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
373
374 auto const script_path =
375 BaseLib::copyPathToFileName(*python_script, script_directory);
376
377 // Evaluate in scope of main module
378 py::object scope = py::module::import("__main__").attr("__dict__");
379 // add (global) variables
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;
384 try
385 {
386 py::eval_file(script_path, scope);
387 }
388 catch (py::error_already_set const& e)
389 {
390 OGS_FATAL("Error evaluating python script {}: {}", script_path,
391 e.what());
392 }
393 }
394
396 parseCurves(project_config.getConfigSubtreeOptional("curves"));
397
398 auto parameter_names_for_transformation =
400 parseParameters(project_config.getConfigSubtree("parameters"));
401
404 project_config.getConfigSubtreeOptional("local_coordinate_system"),
406
407 for (auto& parameter : _parameters)
408 {
409 if (std::find(begin(parameter_names_for_transformation),
410 end(parameter_names_for_transformation),
411 parameter->name) !=
412 end(parameter_names_for_transformation))
413 {
415 {
416 OGS_FATAL(
417 "The parameter '{:s}' is using the local coordinate system "
418 "but no local coordinate system was provided.",
419 parameter->name);
420 }
421 parameter->setCoordinateSystem(*_local_coordinate_system);
422 }
423
424 parameter->initialize(_parameters);
425 }
426
428 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
429
431 parseMedia(project_config.getConfigSubtreeOptional("media"));
432
434 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
435
436 auto chemical_solver_interface = parseChemicalSolverInterface(
438 project_config.getConfigSubtreeOptional("chemical_system"),
439 output_directory);
440
442 parseProcesses(project_config.getConfigSubtree("processes"),
443 project_directory, output_directory,
444 std::move(chemical_solver_interface));
445
447 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
448
450 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
451 output_directory);
452}
#define OGS_FATAL(...)
Definition Error.h:26
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)
Class AABB is an axis aligned bounding box around a given set of geometric points of (template) type ...
Definition AABB.h:56
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
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< GeoLib::NamedRaster > _named_rasters
void parseNonlinearSolvers(BaseLib::ConfigTree const &config)
void parseProcessVariables(BaseLib::ConfigTree const &process_variables_config)
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::vector< std::string > parseParameters(BaseLib::ConfigTree const &parameters_config)
std::vector< std::unique_ptr< MeshLib::Mesh > > readMeshes(std::vector< std::string > const &filenames)
pybind11::scoped_interpreter setupEmbeddedPython()
std::string copyPathToFileName(const std::string &file_name, const std::string &source)
std::optional< ParameterLib::CoordinateSystem > createCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::string project_directory
The directory where the prj file resides.
Definition FileTools.cpp:31
std::vector< GeoLib::NamedRaster > readRasters(BaseLib::ConfigTree const &config, std::string const &raster_directory, GeoLib::MinMaxPoints const &min_max_points)

References _local_coordinate_system, _parameters, BaseLib::copyPathToFileName(), ParameterLib::createCoordinateSystem(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), OGS_FATAL, parseChemicalSolverInterface(), parseCurves(), parseLinearSolvers(), parseMedia(), parseNonlinearSolvers(), parseParameters(), parseProcesses(), parseProcessVariables(), parseTimeLoop(), and ApplicationsLib::setupEmbeddedPython().

◆ ProjectData() [3/3]

ProjectData::ProjectData ( ProjectData & )
delete

Member Function Documentation

◆ getMedia()

std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & ProjectData::getMedia ( ) const
inline

Definition at line 100 of file ProjectData.h.

101 {
102 return _media;
103 }
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > _media

References _media.

◆ getMesh()

MeshLib::Mesh & ProjectData::getMesh ( std::string const & mesh_name) const

Definition at line 1384 of file ProjectData.cpp.

1385{
1386 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1387}
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
Definition Mesh.cpp:363

References _mesh_vec, and MeshLib::findMeshByName().

◆ getProcesses()

std::vector< std::unique_ptr< ProcessLib::Process > > const & ProjectData::getProcesses ( ) const
inline

Provides read access to the process container.

Definition at line 89 of file ProjectData.h.

91 {
92 return _processes;
93 }
std::vector< std::unique_ptr< ProcessLib::Process > > _processes

References _processes.

◆ getTimeLoop()

ProcessLib::TimeLoop & ProjectData::getTimeLoop ( )
inline

Definition at line 95 of file ProjectData.h.

95{ return *_time_loop; }
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project's processes.

References _time_loop.

◆ parseChemicalSolverInterface()

std::unique_ptr< ChemistryLib::ChemicalSolverInterface > ProjectData::parseChemicalSolverInterface ( std::optional< BaseLib::ConfigTree > const & config,
const std::string & output_directory )
private

Definition at line 592 of file ProjectData.cpp.

595{
596 if (!config)
597 {
598 return nullptr;
599 }
600
601 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
602 chemical_solver_interface;
603#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
604 INFO(
605 "Ready for initializing interface to a chemical solver for water "
606 "chemistry calculation.");
607
608 auto const chemical_solver =
610 config->getConfigAttribute<std::string>("chemical_solver");
611
612 if (boost::iequals(chemical_solver, "Phreeqc"))
613 {
614 INFO(
615 "Configuring phreeqc interface for water chemistry calculation "
616 "using file-based approach.");
617
618 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
620 *config, output_directory);
621 }
622 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
623 {
624 OGS_FATAL(
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.");
628 }
629 else if (boost::iequals(chemical_solver, "SelfContained"))
630 {
631 INFO(
632 "Use self-contained chemical solver for water chemistry "
633 "calculation.");
634
635 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
637 _mesh_vec, _linear_solvers, *config, output_directory);
638 }
639 else
640 {
641 OGS_FATAL(
642 "Unknown chemical solver. Please specify either Phreeqc or "
643 "PhreeqcKernel as the solver for water chemistry calculation "
644 "instead.");
645 }
646#else
647 (void)output_directory;
648
649 OGS_FATAL(
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.");
654#endif
655 return chemical_solver_interface;
656}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:35
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
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)

References _linear_solvers, _mesh_vec, ChemistryLib::createChemicalSolverInterface(), INFO(), OGS_FATAL, ChemistryLib::Phreeqc, and ChemistryLib::SelfContained.

Referenced by ProjectData().

◆ parseCurves()

void ProjectData::parseCurves ( std::optional< BaseLib::ConfigTree > const & config)
private
Input File Parameter
prj__curves__curve
Input File Parameter
prj__curves__curve__name

Definition at line 1361 of file ProjectData.cpp.

1362{
1363 if (!config)
1364 {
1365 return;
1366 }
1367
1368 DBUG("Reading curves configuration.");
1369
1371 for (auto conf : config->getConfigSubtreeList("curve"))
1372 {
1374 auto const name = conf.getConfigParameter<std::string>("name");
1376 _curves,
1377 name,
1380 "The curve name is not unique.");
1381 }
1382}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition Algorithm.h:100
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)

References _curves, MathLib::createPiecewiseLinearCurve(), DBUG(), and BaseLib::insertIfKeyUniqueElseError().

Referenced by ProjectData().

◆ parseLinearSolvers()

void ProjectData::parseLinearSolvers ( BaseLib::ConfigTree const & config)
private
Input File Parameter
prj__linear_solvers__linear_solver
Input File Parameter
prj__linear_solvers__linear_solver__name

Definition at line 1314 of file ProjectData.cpp.

1315{
1316 DBUG("Reading linear solver configuration.");
1317
1319 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1320 {
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);
1327
1330 name,
1331 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1332 std::get<1>(solver_options)),
1333 "The linear solver name is not unique");
1334 }
1335}

References _linear_solvers, DBUG(), BaseLib::ConfigTree::getConfigSubtreeList(), and BaseLib::insertIfKeyUniqueElseError().

Referenced by ProjectData().

◆ parseMedia()

void ProjectData::parseMedia ( std::optional< BaseLib::ConfigTree > const & media_config)
private

Parses media configuration and saves them in an object.

Input File Parameter
prj__media__medium
Input File Parameter
prj__media__medium__id

Definition at line 528 of file ProjectData.cpp.

530{
531 if (!media_config)
532 {
533 return;
534 }
535
536 DBUG("Reading media:");
537
538 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
539 {
540 ERR("A mesh is required to define medium materials.");
541 return;
542 }
543
544 for (auto const& medium_config :
546 media_config->getConfigSubtreeList("medium"))
547 {
548 auto material_id_string =
550 medium_config.getConfigAttribute<std::string>("id", "0");
551
552 auto const material_ids_of_this_medium =
553 BaseLib::splitMaterialIdString(material_id_string);
554
555 for (auto const& id : material_ids_of_this_medium)
556 {
557 if (_media.find(id) != end(_media))
558 {
559 OGS_FATAL(
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.",
563 id);
564 }
565
566 if (id == material_ids_of_this_medium[0])
567 {
569 id, _mesh_vec[0]->getDimension(), medium_config,
572 : nullptr,
573 _curves);
574 }
575 else
576 {
577 // This medium has multiple material IDs assigned and this is
578 // not the first material ID. Therefore we can reuse the medium
579 // we created before.
580 _media[id] = _media[material_ids_of_this_medium[0]];
581 }
582 }
583 }
584
585 if (_media.empty())
586 {
587 OGS_FATAL("No entity is found inside <media>.");
588 }
589}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
std::vector< int > splitMaterialIdString(std::string const &material_id_string)
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 &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
unsigned getDimension(MeshLib::MeshElemType eleType)

References _curves, _local_coordinate_system, _media, _mesh_vec, _parameters, MaterialPropertyLib::createMedium(), DBUG(), ERR(), OGS_FATAL, and BaseLib::splitMaterialIdString().

Referenced by ProjectData().

◆ parseNonlinearSolvers()

void ProjectData::parseNonlinearSolvers ( BaseLib::ConfigTree const & config)
private
Input File Parameter
prj__nonlinear_solvers__nonlinear_solver
Input File Parameter
prj__nonlinear_solvers__nonlinear_solver__linear_solver
Input File Parameter
prj__nonlinear_solvers__nonlinear_solver__name

Definition at line 1337 of file ProjectData.cpp.

1338{
1339 DBUG("Reading non-linear solver configuration.");
1340
1342 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1343 {
1344 auto const ls_name =
1346 conf.getConfigParameter<std::string>("linear_solver");
1347 auto const& linear_solver = BaseLib::getOrError(
1348 _linear_solvers, ls_name,
1349 "A linear solver with the given name does not exist.");
1350
1352 auto const name = conf.getConfigParameter<std::string>("name");
1355 name,
1356 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1357 "The nonlinear solver name is not unique");
1358 }
1359}
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:114

References _linear_solvers, _nonlinear_solvers, NumLib::createNonlinearSolver(), DBUG(), BaseLib::ConfigTree::getConfigSubtreeList(), BaseLib::getOrError(), and BaseLib::insertIfKeyUniqueElseError().

Referenced by ProjectData().

◆ parseParameters()

std::vector< std::string > ProjectData::parseParameters ( BaseLib::ConfigTree const & parameters_config)
private

Parses the parameters configuration and saves them. Checks for double parameters' names. Returns names of vectors which are to be transformed using local coordinate system.

Input File Parameter
prj__parameters__parameter
Input File Parameter
prj__parameters__parameter__use_local_coordinate_system

Definition at line 486 of file ProjectData.cpp.

488{
489 using namespace ProcessLib;
490
491 std::set<std::string> names;
492 std::vector<std::string> parameter_names_for_transformation;
493
494 DBUG("Reading parameters:");
495 for (auto parameter_config :
497 parameters_config.getConfigSubtreeList("parameter"))
498 {
499 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
501 if (!names.insert(p->name).second)
502 {
503 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
504 }
505
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)
511 {
512 parameter_names_for_transformation.push_back(p->name);
513 }
514
515 _parameters.push_back(std::move(p));
516 }
517
518 _parameters.push_back(
521 _parameters.push_back(
524
525 return parameter_names_for_transformation;
526}
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:47
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:229
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)
Definition Parameter.cpp:27
Single, constant value parameter.
static PROCESSLIB_EXPORT const std::string zero_parameter_name

References _curves, _mesh_vec, _named_rasters, _parameters, ProcessLib::Process::constant_one_parameter_name, ParameterLib::createParameter(), DBUG(), BaseLib::ConfigTree::getConfigSubtreeList(), OGS_FATAL, and ProcessLib::DeactivatedSubdomain::zero_parameter_name.

Referenced by ProjectData().

◆ parseProcesses()

void ProjectData::parseProcesses ( BaseLib::ConfigTree const & processes_config,
std::string const & project_directory,
std::string const & output_directory,
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > && chemical_solver_interface )
private

Parses the processes configuration and creates new processes for each process entry passing the corresponding subtree to the process constructor.

Input File Parameter
prj__processes__process
Input File Parameter
prj__processes__process__type
Input File Parameter
prj__processes__process__name
Input File Parameter
prj__processes__process__integration_order
Input File Parameter
prj__processes__process__jacobian_assembler

Definition at line 658 of file ProjectData.cpp.

664{
665 (void)project_directory; // to avoid compilation warning
666 (void)output_directory; // to avoid compilation warning
667
668 DBUG("Reading processes:");
670 for (auto process_config : processes_config.getConfigSubtreeList("process"))
671 {
672 auto const type =
674 process_config.peekConfigParameter<std::string>("type");
675
676 auto const name =
678 process_config.getConfigParameter<std::string>("name");
679
680 [[maybe_unused]] auto const integration_order =
682 process_config.getConfigParameter<int>("integration_order");
683
684 std::unique_ptr<ProcessLib::Process> process;
685
686 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
688 process_config.getConfigSubtreeOptional("jacobian_assembler"));
689
690#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
691 if (type == "STEADY_STATE_DIFFUSION")
692 {
693 // The existence check of the in the configuration referenced
694 // process variables is checked in the physical process.
695 // TODO at the moment we have only one mesh, later there can be
696 // several meshes. Then we have to assign the referenced mesh
697 // here.
698 process =
700 name, *_mesh_vec[0], std::move(jacobian_assembler),
701 _process_variables, _parameters, integration_order,
702 process_config, _mesh_vec, _media);
703 }
704 else
705#endif
706#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
707 if (type == "LIQUID_FLOW")
708 {
710 name, *_mesh_vec[0], std::move(jacobian_assembler),
711 _process_variables, _parameters, integration_order,
712 process_config, _mesh_vec, _media);
713 }
714 else
715#endif
716#ifdef OGS_BUILD_PROCESS_STOKESFLOW
717 if (type == "StokesFlow")
718 {
719 switch (_mesh_vec[0]->getDimension())
720 {
721 case 2:
722 process =
724 name, *_mesh_vec[0], std::move(jacobian_assembler),
725 _process_variables, _parameters, integration_order,
726 process_config, _media);
727 break;
728 default:
729 OGS_FATAL(
730 "StokesFlow process does not support given "
731 "dimension {:d}",
732 _mesh_vec[0]->getDimension());
733 }
734 }
735 else
736#endif
737#ifdef OGS_BUILD_PROCESS_TES
738 if (type == "TES")
739 {
741 name, *_mesh_vec[0], std::move(jacobian_assembler),
742 _process_variables, _parameters, integration_order,
743 process_config);
744 }
745 else
746#endif
747#ifdef OGS_BUILD_PROCESS_TH2M
748 if (type == "TH2M")
749 {
750 switch (_mesh_vec[0]->getDimension())
751 {
752 case 2:
754 name, *_mesh_vec[0], std::move(jacobian_assembler),
756 _local_coordinate_system, integration_order,
757 process_config, _media);
758 break;
759 case 3:
761 name, *_mesh_vec[0], std::move(jacobian_assembler),
763 _local_coordinate_system, integration_order,
764 process_config, _media);
765 break;
766 default:
767 OGS_FATAL("TH2M process does not support given dimension");
768 }
769 }
770 else
771#endif
772#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
773 if (type == "HEAT_CONDUCTION")
774 {
776 name, *_mesh_vec[0], std::move(jacobian_assembler),
777 _process_variables, _parameters, integration_order,
778 process_config, _media);
779 }
780 else
781#endif
782#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
783 if (type == "HEAT_TRANSPORT_BHE")
784 {
785 if (_mesh_vec[0]->getDimension() != 3)
786 {
787 OGS_FATAL(
788 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
789 "mesh! ");
790 }
791
792 process =
794 name, *_mesh_vec[0], std::move(jacobian_assembler),
795 _process_variables, _parameters, integration_order,
796 process_config, _curves, _media);
797 }
798 else
799#endif
800#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
801 if (type == "HYDRO_MECHANICS")
802 {
803 if (
804 process_config.getConfigParameterOptional<int>("dimension"))
805 {
806 OGS_FATAL(
807 "The 'dimension' tag has been removed in the merge-request "
808 "!4766."
809 "The dimension is now taken from the main mesh and the tag "
810 "must be"
811 "removed. There is a python script in the merge-request "
812 "description"
813 "for automatic conversion.");
814 }
815 switch (_mesh_vec[0]->getDimension())
816 {
817 case 2:
818 process =
820 2>(name, *_mesh_vec[0],
821 std::move(jacobian_assembler),
823 _local_coordinate_system, integration_order,
824 process_config, _media);
825 break;
826 case 3:
827 process =
829 3>(name, *_mesh_vec[0],
830 std::move(jacobian_assembler),
832 _local_coordinate_system, integration_order,
833 process_config, _media);
834 break;
835 default:
836 OGS_FATAL(
837 "HYDRO_MECHANICS process does not support given "
838 "dimension");
839 }
840 }
841 else
842#endif
843#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
844 if (type == "LARGE_DEFORMATION")
845 {
846 switch (_mesh_vec[0]->getDimension())
847 {
848 case 2:
851 name, *_mesh_vec[0], std::move(jacobian_assembler),
853 _local_coordinate_system, integration_order,
854 process_config, _media);
855 break;
856 case 3:
859 name, *_mesh_vec[0], std::move(jacobian_assembler),
861 _local_coordinate_system, integration_order,
862 process_config, _media);
863 break;
864 default:
865 OGS_FATAL(
866 "LARGE_DEFORMATION process does not support given "
867 "dimension");
868 }
869 }
870 else
871#endif
872#ifdef OGS_BUILD_PROCESS_LIE
873 if (type == "HYDRO_MECHANICS_WITH_LIE")
874 {
875 if (
876 process_config.getConfigParameterOptional<int>("dimension"))
877 {
878 OGS_FATAL(
879 "The 'dimension' tag has been removed in the merge-request "
880 "!4766."
881 "The dimension is now taken from the main mesh and the tag "
882 "must be"
883 "removed. There is a python script in the merge-request "
884 "description"
885 "for automatic conversion.");
886 }
887 switch (_mesh_vec[0]->getDimension())
888 {
889 case 2:
892 name, *_mesh_vec[0], std::move(jacobian_assembler),
894 _local_coordinate_system, integration_order,
895 process_config);
896 break;
897 case 3:
900 name, *_mesh_vec[0], std::move(jacobian_assembler),
902 _local_coordinate_system, integration_order,
903 process_config);
904 break;
905 default:
906 OGS_FATAL(
907 "HYDRO_MECHANICS_WITH_LIE process does not support "
908 "given dimension");
909 }
910 }
911 else
912#endif
913#ifdef OGS_BUILD_PROCESS_HT
914 if (type == "HT")
915 {
917 name, *_mesh_vec[0], std::move(jacobian_assembler),
918 _process_variables, _parameters, integration_order,
919 process_config, _mesh_vec, _media);
920 }
921 else
922#endif
923#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
924 if (type == "ComponentTransport")
925 {
926 process =
928 name, *_mesh_vec[0], std::move(jacobian_assembler),
929 _process_variables, _parameters, integration_order,
930 process_config, _mesh_vec, _media,
931 std::move(chemical_solver_interface));
932 }
933 else
934#endif
935#ifdef OGS_BUILD_PROCESS_PHASEFIELD
936 if (type == "PHASE_FIELD")
937 {
938 switch (_mesh_vec[0]->getDimension())
939 {
940 case 2:
941 process =
943 name, *_mesh_vec[0], std::move(jacobian_assembler),
945 _local_coordinate_system, integration_order,
946 process_config);
947 break;
948 case 3:
949 process =
951 name, *_mesh_vec[0], std::move(jacobian_assembler),
953 _local_coordinate_system, integration_order,
954 process_config);
955 break;
956 }
957 }
958 else
959#endif
960#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
961 if (type == "RichardsComponentTransport")
962 {
965 name, *_mesh_vec[0], std::move(jacobian_assembler),
966 _process_variables, _parameters, integration_order,
967 process_config, _media);
968 }
969 else
970#endif
971#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
972 if (type == "SMALL_DEFORMATION")
973 {
974 switch (_mesh_vec[0]->getDimension())
975 {
976 case 2:
979 name, *_mesh_vec[0], std::move(jacobian_assembler),
981 _local_coordinate_system, integration_order,
982 process_config, _media);
983 break;
984 case 3:
987 name, *_mesh_vec[0], std::move(jacobian_assembler),
989 _local_coordinate_system, integration_order,
990 process_config, _media);
991 break;
992 default:
993 OGS_FATAL(
994 "SMALL_DEFORMATION process does not support given "
995 "dimension");
996 }
997 }
998 else
999#endif
1000#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1001 if (type == "SMALL_DEFORMATION_NONLOCAL")
1002 {
1003 switch (_mesh_vec[0]->getDimension())
1004 {
1005 case 2:
1008 name, *_mesh_vec[0], std::move(jacobian_assembler),
1010 _local_coordinate_system, integration_order,
1011 process_config);
1012 break;
1013 case 3:
1016 name, *_mesh_vec[0], std::move(jacobian_assembler),
1018 _local_coordinate_system, integration_order,
1019 process_config);
1020 break;
1021 default:
1022 OGS_FATAL(
1023 "SMALL_DEFORMATION_NONLOCAL process does not support "
1024 "given dimension {:d}",
1025 _mesh_vec[0]->getDimension());
1026 }
1027 }
1028 else
1029#endif
1030#ifdef OGS_BUILD_PROCESS_LIE
1031 if (type == "SMALL_DEFORMATION_WITH_LIE")
1032 {
1033 if (
1034 process_config.getConfigParameterOptional<int>("dimension"))
1035 {
1036 OGS_FATAL(
1037 "The 'dimension' tag has been removed in the merge-request "
1038 "!4766."
1039 "The dimension is now taken from the main mesh and the tag "
1040 "must be"
1041 "removed. There is a python script in the merge-request "
1042 "description"
1043 "for automatic conversion.");
1044 }
1045 switch (_mesh_vec[0]->getDimension())
1046 {
1047 case 2:
1050 name, *_mesh_vec[0], std::move(jacobian_assembler),
1052 _local_coordinate_system, integration_order,
1053 process_config);
1054 break;
1055 case 3:
1058 name, *_mesh_vec[0], std::move(jacobian_assembler),
1060 _local_coordinate_system, integration_order,
1061 process_config);
1062 break;
1063 default:
1064 OGS_FATAL(
1065 "SMALL_DEFORMATION_WITH_LIE process does not support "
1066 "given dimension");
1067 }
1068 }
1069 else
1070#endif
1071#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1072 if (type == "THERMO_HYDRO_MECHANICS")
1073 {
1074 if (
1075 process_config.getConfigParameterOptional<int>("dimension"))
1076 {
1077 OGS_FATAL(
1078 "The 'dimension' tag has been removed in the merge-request "
1079 "!4766."
1080 "The dimension is now taken from the main mesh and the tag "
1081 "must be"
1082 "removed. There is a python script in the merge-request "
1083 "description"
1084 "for automatic conversion.");
1085 }
1086 switch (_mesh_vec[0]->getDimension())
1087 {
1088 case 2:
1091 name, *_mesh_vec[0], std::move(jacobian_assembler),
1093 _local_coordinate_system, integration_order,
1094 process_config, _media);
1095 break;
1096 case 3:
1099 name, *_mesh_vec[0], std::move(jacobian_assembler),
1101 _local_coordinate_system, integration_order,
1102 process_config, _media);
1103 break;
1104 default:
1105 OGS_FATAL(
1106 "THERMO_HYDRO_MECHANICS process does not support given "
1107 "dimension");
1108 }
1109 }
1110 else
1111#endif
1112#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1113 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1114 {
1115 switch (_mesh_vec[0]->getDimension())
1116 {
1117 case 2:
1120 name, *_mesh_vec[0], std::move(jacobian_assembler),
1122 _local_coordinate_system, integration_order,
1123 process_config);
1124 break;
1125 case 3:
1128 name, *_mesh_vec[0], std::move(jacobian_assembler),
1130 _local_coordinate_system, integration_order,
1131 process_config);
1132 break;
1133 }
1134 }
1135 else
1136#endif
1137#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1138 if (type == "THERMO_MECHANICS")
1139 {
1140 switch (_mesh_vec[0]->getDimension())
1141 {
1142 case 2:
1145 name, *_mesh_vec[0], std::move(jacobian_assembler),
1147 _local_coordinate_system, integration_order,
1148 process_config, _media);
1149 break;
1150 case 3:
1153 name, *_mesh_vec[0], std::move(jacobian_assembler),
1155 _local_coordinate_system, integration_order,
1156 process_config, _media);
1157 break;
1158 }
1159 }
1160 else
1161#endif
1162#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1163 if (type == "RICHARDS_FLOW")
1164 {
1166 name, *_mesh_vec[0], std::move(jacobian_assembler),
1167 _process_variables, _parameters, integration_order,
1168 process_config, _media);
1169 }
1170 else
1171#endif
1172#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1173 if (type == "RICHARDS_MECHANICS")
1174 {
1175 if (
1176 process_config.getConfigParameterOptional<int>("dimension"))
1177 {
1178 OGS_FATAL(
1179 "The 'dimension' tag has been removed in the merge-request "
1180 "!4766."
1181 "The dimension is now taken from the main mesh and the tag "
1182 "must be"
1183 "removed. There is a python script in the merge-request "
1184 "description"
1185 "for automatic conversion.");
1186 }
1187 switch (_mesh_vec[0]->getDimension())
1188 {
1189 case 2:
1192 name, *_mesh_vec[0], std::move(jacobian_assembler),
1194 _local_coordinate_system, integration_order,
1195 process_config, _media);
1196 break;
1197 case 3:
1200 name, *_mesh_vec[0], std::move(jacobian_assembler),
1202 _local_coordinate_system, integration_order,
1203 process_config, _media);
1204 break;
1205 }
1206 }
1207 else
1208#endif
1209#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1210 if (type == "THERMO_RICHARDS_FLOW")
1211 {
1212 process =
1214 name, *_mesh_vec[0], std::move(jacobian_assembler),
1215 _process_variables, _parameters, integration_order,
1216 process_config, _media);
1217 }
1218 else
1219#endif
1220#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1221 if (type == "THERMO_RICHARDS_MECHANICS")
1222 {
1223 switch (_mesh_vec[0]->getDimension())
1224 {
1225 case 2:
1228 name, *_mesh_vec[0], std::move(jacobian_assembler),
1230 _local_coordinate_system, integration_order,
1231 process_config, _media);
1232 break;
1233 case 3:
1236 name, *_mesh_vec[0], std::move(jacobian_assembler),
1238 _local_coordinate_system, integration_order,
1239 process_config, _media);
1240 break;
1241 }
1242 }
1243 else
1244#endif
1245
1246#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1247 if (type == "TWOPHASE_FLOW_PP")
1248 {
1249 process =
1251 name, *_mesh_vec[0], std::move(jacobian_assembler),
1252 _process_variables, _parameters, integration_order,
1253 process_config, _media);
1254 }
1255 else
1256#endif
1257#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1258 if (type == "TWOPHASE_FLOW_PRHO")
1259 {
1262 name, *_mesh_vec[0], std::move(jacobian_assembler),
1263 _process_variables, _parameters, integration_order,
1264 process_config, _media);
1265 }
1266 else
1267#endif
1268#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1269 if (type == "THERMAL_TWOPHASE_WITH_PP")
1270 {
1273 name, *_mesh_vec[0], std::move(jacobian_assembler),
1274 _process_variables, _parameters, integration_order,
1275 process_config, _media);
1276 }
1277 else
1278#endif
1279 {
1280 OGS_FATAL("Unknown process type: {:s}", type);
1281 }
1282
1283 if (ranges::contains(_processes, name,
1284 [](std::unique_ptr<ProcessLib::Process> const& p)
1285 { return p->name; }))
1286 {
1287 OGS_FATAL("The process name '{:s}' is not unique.", name);
1288 }
1289 _processes.push_back(std::move(process));
1290 }
1291}
std::vector< ProcessLib::ProcessVariable > _process_variables
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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createLargeDeformationProcess< 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 &parameters, 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 > createLargeDeformationProcess< 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 > createSmallDeformationNonlocalProcess< 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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationNonlocalProcess< 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 &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 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 &parameters, 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 > createSmallDeformationProcess< 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, 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 &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(std::optional< BaseLib::ConfigTree > const &config)

References _curves, _local_coordinate_system, _media, _mesh_vec, _parameters, _process_variables, _processes, ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::HeatConduction::createHeatConductionProcess(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 2 >(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 3 >(), ProcessLib::createJacobianAssembler(), ProcessLib::LargeDeformation::createLargeDeformationProcess< 2 >(), ProcessLib::LargeDeformation::createLargeDeformationProcess< 3 >(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), ProcessLib::PhaseField::createPhaseFieldProcess< 2 >(), ProcessLib::PhaseField::createPhaseFieldProcess< 3 >(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::RichardsFlow::createRichardsFlowProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 2 >(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 3 >(), ProcessLib::SmallDeformationNonlocal::createSmallDeformationNonlocalProcess< 2 >(), ProcessLib::SmallDeformationNonlocal::createSmallDeformationNonlocalProcess< 3 >(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SteadyStateDiffusion::createSteadyStateDiffusion(), ProcessLib::StokesFlow::createStokesFlowProcess< 2 >(), ProcessLib::TES::createTESProcess(), ProcessLib::TH2M::createTH2MProcess< 2 >(), ProcessLib::TH2M::createTH2MProcess< 3 >(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 2 >(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 3 >(), ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess< 2 >(), ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess< 3 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 2 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 3 >(), ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 2 >(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 3 >(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowWithPrhoProcess(), DBUG(), BaseLib::ConfigTree::getConfigSubtreeList(), and OGS_FATAL.

Referenced by ProjectData().

◆ parseProcessVariables()

void ProjectData::parseProcessVariables ( BaseLib::ConfigTree const & process_variables_config)
private

Parses the process variables configuration and creates new variables for each variable entry passing the corresponding subtree to the process variable constructor.

Input File Parameter
prj__process_variables__process_variable
Input File Parameter
prj__process_variables__process_variable__mesh

Definition at line 454 of file ProjectData.cpp.

456{
457 DBUG("Parse process variables:");
458
459 std::set<std::string> names;
460
461 for (auto var_config
463 : process_variables_config.getConfigSubtreeList("process_variable"))
464 {
465 // Either the mesh name is given, or the first mesh's name will be
466 // taken. Taking the first mesh's value is deprecated.
467 auto const mesh_name =
469 var_config.getConfigParameter<std::string>("mesh",
470 _mesh_vec[0]->getName());
471
472 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
473
474 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
476 if (!names.insert(pv.getName()).second)
477 {
478 OGS_FATAL("A process variable with name `{:s}' already exists.",
479 pv.getName());
480 }
481
482 _process_variables.push_back(std::move(pv));
483 }
484}

References _curves, _mesh_vec, _parameters, _process_variables, DBUG(), MeshLib::findMeshByName(), BaseLib::ConfigTree::getConfigSubtreeList(), and OGS_FATAL.

Referenced by ProjectData().

◆ parseTimeLoop()

void ProjectData::parseTimeLoop ( BaseLib::ConfigTree const & config,
const std::string & output_directory )
private

Parses the time loop configuration.

Definition at line 1293 of file ProjectData.cpp.

1295{
1296 DBUG("Reading time loop configuration.");
1297
1298 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1299 std::begin(_process_variables),
1300 std::end(_process_variables),
1301 [](auto const& process_variable)
1302 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1303
1305 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1306 compensate_non_equilibrium_initial_residuum);
1307
1308 if (!_time_loop)
1309 {
1310 OGS_FATAL("Initialization of time loop failed.");
1311 }
1312}
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.

References _mesh_vec, _nonlinear_solvers, _process_variables, _processes, _time_loop, ProcessLib::createTimeLoop(), DBUG(), and OGS_FATAL.

Referenced by ProjectData().

Member Data Documentation

◆ _curves

std::map<std::string, std::unique_ptr<MathLib::PiecewiseLinearInterpolation> > ProjectData::_curves
private

◆ _linear_solvers

std::map<std::string, std::unique_ptr<GlobalLinearSolver> > ProjectData::_linear_solvers
private

◆ _local_coordinate_system

std::optional<ParameterLib::CoordinateSystem> ProjectData::_local_coordinate_system
private

Definition at line 153 of file ProjectData.h.

Referenced by ProjectData(), parseMedia(), and parseProcesses().

◆ _media

std::map<int, std::shared_ptr<MaterialPropertyLib::Medium> > ProjectData::_media
private

Definition at line 155 of file ProjectData.h.

Referenced by getMedia(), parseMedia(), and parseProcesses().

◆ _mesh_vec

std::vector<std::unique_ptr<MeshLib::Mesh> > ProjectData::_mesh_vec
private

◆ _named_rasters

std::vector<GeoLib::NamedRaster> ProjectData::_named_rasters
private

Definition at line 146 of file ProjectData.h.

Referenced by parseParameters().

◆ _nonlinear_solvers

std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase> > ProjectData::_nonlinear_solvers
private

Definition at line 163 of file ProjectData.h.

Referenced by parseNonlinearSolvers(), and parseTimeLoop().

◆ _parameters

std::vector<std::unique_ptr<ParameterLib::ParameterBase> > ProjectData::_parameters
private

Buffer for each parameter config passed to the process.

Definition at line 151 of file ProjectData.h.

Referenced by ProjectData(), parseMedia(), parseParameters(), parseProcesses(), and parseProcessVariables().

◆ _process_variables

std::vector<ProcessLib::ProcessVariable> ProjectData::_process_variables
private

Definition at line 148 of file ProjectData.h.

Referenced by parseProcesses(), parseProcessVariables(), and parseTimeLoop().

◆ _processes

std::vector<std::unique_ptr<ProcessLib::Process> > ProjectData::_processes
private

Definition at line 147 of file ProjectData.h.

Referenced by getProcesses(), parseProcesses(), and parseTimeLoop().

◆ _time_loop

std::unique_ptr<ProcessLib::TimeLoop> ProjectData::_time_loop
private

The time loop used to solve this project's processes.

Definition at line 158 of file ProjectData.h.

Referenced by getTimeLoop(), and parseTimeLoop().


The documentation for this class was generated from the following files: