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 py::eval_file(script_path, scope);
385 }
386
388 parseCurves(project_config.getConfigSubtreeOptional("curves"));
389
390 auto parameter_names_for_transformation =
392 parseParameters(project_config.getConfigSubtree("parameters"));
393
396 project_config.getConfigSubtreeOptional("local_coordinate_system"),
398
399 for (auto& parameter : _parameters)
400 {
401 if (std::find(begin(parameter_names_for_transformation),
402 end(parameter_names_for_transformation),
403 parameter->name) !=
404 end(parameter_names_for_transformation))
405 {
407 {
408 OGS_FATAL(
409 "The parameter '{:s}' is using the local coordinate system "
410 "but no local coordinate system was provided.",
411 parameter->name);
412 }
413 parameter->setCoordinateSystem(*_local_coordinate_system);
414 }
415
416 parameter->initialize(_parameters);
417 }
418
420 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
421
423 parseMedia(project_config.getConfigSubtreeOptional("media"));
424
426 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
427
428 auto chemical_solver_interface = parseChemicalSolverInterface(
430 project_config.getConfigSubtreeOptional("chemical_system"),
431 output_directory);
432
434 parseProcesses(project_config.getConfigSubtree("processes"),
435 project_directory, output_directory,
436 std::move(chemical_solver_interface));
437
439 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
440
442 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
443 output_directory);
444}
#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 1376 of file ProjectData.cpp.

1377{
1378 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1379}
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 584 of file ProjectData.cpp.

587{
588 if (!config)
589 {
590 return nullptr;
591 }
592
593 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
594 chemical_solver_interface;
595#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
596 INFO(
597 "Ready for initializing interface to a chemical solver for water "
598 "chemistry calculation.");
599
600 auto const chemical_solver =
602 config->getConfigAttribute<std::string>("chemical_solver");
603
604 if (boost::iequals(chemical_solver, "Phreeqc"))
605 {
606 INFO(
607 "Configuring phreeqc interface for water chemistry calculation "
608 "using file-based approach.");
609
610 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
612 *config, output_directory);
613 }
614 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
615 {
616 OGS_FATAL(
617 "The chemical solver option of PhreeqcKernel is not accessible for "
618 "the time being. Please set 'Phreeqc'' as the chemical solver for "
619 "reactive transport modeling.");
620 }
621 else if (boost::iequals(chemical_solver, "SelfContained"))
622 {
623 INFO(
624 "Use self-contained chemical solver for water chemistry "
625 "calculation.");
626
627 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
629 _mesh_vec, _linear_solvers, *config, output_directory);
630 }
631 else
632 {
633 OGS_FATAL(
634 "Unknown chemical solver. Please specify either Phreeqc or "
635 "PhreeqcKernel as the solver for water chemistry calculation "
636 "instead.");
637 }
638#else
639 (void)output_directory;
640
641 OGS_FATAL(
642 "Found the type of the process to be solved is not component transport "
643 "process. Please specify the process type to ComponentTransport. At "
644 "the present, water chemistry calculation is only available for "
645 "component transport process.");
646#endif
647 return chemical_solver_interface;
648}
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 1353 of file ProjectData.cpp.

1354{
1355 if (!config)
1356 {
1357 return;
1358 }
1359
1360 DBUG("Reading curves configuration.");
1361
1363 for (auto conf : config->getConfigSubtreeList("curve"))
1364 {
1366 auto const name = conf.getConfigParameter<std::string>("name");
1368 _curves,
1369 name,
1372 "The curve name is not unique.");
1373 }
1374}
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:99
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 1306 of file ProjectData.cpp.

1307{
1308 DBUG("Reading linear solver configuration.");
1309
1311 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1312 {
1314 auto const name = conf.getConfigParameter<std::string>("name");
1315 auto const linear_solver_parser =
1317 auto const solver_options =
1318 linear_solver_parser.parseNameAndOptions("", &conf);
1319
1322 name,
1323 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1324 std::get<1>(solver_options)),
1325 "The linear solver name is not unique");
1326 }
1327}

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 520 of file ProjectData.cpp.

522{
523 if (!media_config)
524 {
525 return;
526 }
527
528 DBUG("Reading media:");
529
530 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
531 {
532 ERR("A mesh is required to define medium materials.");
533 return;
534 }
535
536 for (auto const& medium_config :
538 media_config->getConfigSubtreeList("medium"))
539 {
540 auto material_id_string =
542 medium_config.getConfigAttribute<std::string>("id", "0");
543
544 auto const material_ids_of_this_medium =
545 BaseLib::splitMaterialIdString(material_id_string);
546
547 for (auto const& id : material_ids_of_this_medium)
548 {
549 if (_media.find(id) != end(_media))
550 {
551 OGS_FATAL(
552 "Multiple media were specified for the same material id "
553 "'{:d}'. Keep in mind, that if no material id is "
554 "specified, it is assumed to be 0 by default.",
555 id);
556 }
557
558 if (id == material_ids_of_this_medium[0])
559 {
561 id, _mesh_vec[0]->getDimension(), medium_config,
564 : nullptr,
565 _curves);
566 }
567 else
568 {
569 // This medium has multiple material IDs assigned and this is
570 // not the first material ID. Therefore we can reuse the medium
571 // we created before.
572 _media[id] = _media[material_ids_of_this_medium[0]];
573 }
574 }
575 }
576
577 if (_media.empty())
578 {
579 OGS_FATAL("No entity is found inside <media>.");
580 }
581}
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 1329 of file ProjectData.cpp.

1330{
1331 DBUG("Reading non-linear solver configuration.");
1332
1334 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1335 {
1336 auto const ls_name =
1338 conf.getConfigParameter<std::string>("linear_solver");
1339 auto const& linear_solver = BaseLib::getOrError(
1340 _linear_solvers, ls_name,
1341 "A linear solver with the given name does not exist.");
1342
1344 auto const name = conf.getConfigParameter<std::string>("name");
1347 name,
1348 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1349 "The nonlinear solver name is not unique");
1350 }
1351}
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)
Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:113

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 478 of file ProjectData.cpp.

480{
481 using namespace ProcessLib;
482
483 std::set<std::string> names;
484 std::vector<std::string> parameter_names_for_transformation;
485
486 DBUG("Reading parameters:");
487 for (auto parameter_config :
489 parameters_config.getConfigSubtreeList("parameter"))
490 {
491 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
493 if (!names.insert(p->name).second)
494 {
495 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
496 }
497
498 auto const use_local_coordinate_system =
500 parameter_config.getConfigParameterOptional<bool>(
501 "use_local_coordinate_system");
502 if (!!use_local_coordinate_system && *use_local_coordinate_system)
503 {
504 parameter_names_for_transformation.push_back(p->name);
505 }
506
507 _parameters.push_back(std::move(p));
508 }
509
510 _parameters.push_back(
513 _parameters.push_back(
516
517 return parameter_names_for_transformation;
518}
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:46
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 650 of file ProjectData.cpp.

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

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

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 1285 of file ProjectData.cpp.

1287{
1288 DBUG("Reading time loop configuration.");
1289
1290 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1291 std::begin(_process_variables),
1292 std::end(_process_variables),
1293 [](auto const& process_variable)
1294 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1295
1297 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1298 compensate_non_equilibrium_initial_residuum);
1299
1300 if (!_time_loop)
1301 {
1302 OGS_FATAL("Initialization of time loop failed.");
1303 }
1304}
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: