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

391 : _mesh_vec(readMeshes(project_config, mesh_directory)),
392 _named_rasters(readRasters(project_config, project_directory,
393 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
394 _mesh_vec[0]->getNodes().end())
395 .getMinMaxPoints()))
396{
397 // for debugging raster reading implementation
398 // writeRasters(_named_rasters, output_directory);
399 if (auto const python_script =
401 project_config.getConfigParameterOptional<std::string>("python_script"))
402 {
403 namespace py = pybind11;
404
405#ifdef OGS_EMBED_PYTHON_INTERPRETER
406 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
407#endif
408
409 // Append to python's module search path
410 auto py_path = py::module::import("sys").attr("path");
411 py_path.attr("append")(script_directory); // .prj or -s directory
412 // virtualenv
413 py_path.attr("append")(
414 CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
415
416 auto const script_path =
417 BaseLib::copyPathToFileName(*python_script, script_directory);
418
419 // Evaluate in scope of main module
420 py::object scope = py::module::import("__main__").attr("__dict__");
421 // add (global) variables
422 auto globals = py::dict(scope);
423 globals["ogs_prj_directory"] = project_directory;
424 globals["ogs_mesh_directory"] = mesh_directory;
425 globals["ogs_script_directory"] = script_directory;
426 py::eval_file(script_path, scope);
427 }
428
430 parseCurves(project_config.getConfigSubtreeOptional("curves"));
431
432 auto parameter_names_for_transformation =
434 parseParameters(project_config.getConfigSubtree("parameters"));
435
438 project_config.getConfigSubtreeOptional("local_coordinate_system"),
440
441 for (auto& parameter : _parameters)
442 {
443 if (std::find(begin(parameter_names_for_transformation),
444 end(parameter_names_for_transformation),
445 parameter->name) !=
446 end(parameter_names_for_transformation))
447 {
449 {
450 OGS_FATAL(
451 "The parameter '{:s}' is using the local coordinate system "
452 "but no local coordinate system was provided.",
453 parameter->name);
454 }
455 parameter->setCoordinateSystem(*_local_coordinate_system);
456 }
457
458 parameter->initialize(_parameters);
459 }
460
462 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
463
465 parseMedia(project_config.getConfigSubtreeOptional("media"));
466
468 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
469
470 auto chemical_solver_interface = parseChemicalSolverInterface(
472 project_config.getConfigSubtreeOptional("chemical_system"),
473 output_directory);
474
476 parseProcesses(project_config.getConfigSubtree("processes"),
477 project_directory, output_directory,
478 std::move(chemical_solver_interface));
479
481 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
482
484 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
485 output_directory);
486}
#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
Definition: ProjectData.h:153
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.
Definition: ProjectData.h:151
std::vector< GeoLib::NamedRaster > _named_rasters
Definition: ProjectData.h:146
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
Definition: ProjectData.h:145
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)
Definition: FileTools.cpp:203
std::string project_directory
The directory where the prj file resides.
Definition: FileTools.cpp:31
std::optional< ParameterLib::CoordinateSystem > parseLocalCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
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(), 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
Definition: ProjectData.h:155

References _media.

◆ getMesh()

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

Definition at line 1421 of file ProjectData.cpp.

1422{
1424 begin(_mesh_vec), end(_mesh_vec),
1425 [&mesh_name](auto const& m)
1426 { return m->getName() == mesh_name; },
1427 "Expected to find a mesh named " + mesh_name + ".")
1428 .get();
1429}
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
Definition: Algorithm.h:69

References _mesh_vec, and BaseLib::findElementOrError().

◆ 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
Definition: ProjectData.h:147

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.
Definition: ProjectData.h:158

References _time_loop.

◆ parseChemicalSolverInterface()

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

Definition at line 629 of file ProjectData.cpp.

632{
633 if (!config)
634 {
635 return nullptr;
636 }
637
638 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
639 chemical_solver_interface;
640#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
641 INFO(
642 "Ready for initializing interface to a chemical solver for water "
643 "chemistry calculation.");
644
645 auto const chemical_solver =
647 config->getConfigAttribute<std::string>("chemical_solver");
648
649 if (boost::iequals(chemical_solver, "Phreeqc"))
650 {
651 INFO(
652 "Configuring phreeqc interface for water chemistry calculation "
653 "using file-based approach.");
654
655 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
657 *config, output_directory);
658 }
659 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
660 {
661 OGS_FATAL(
662 "The chemical solver option of PhreeqcKernel is not accessible for "
663 "the time being. Please set 'Phreeqc'' as the chemical solver for "
664 "reactive transport modeling.");
665 }
666 else if (boost::iequals(chemical_solver, "SelfContained"))
667 {
668 INFO(
669 "Use self-contained chemical solver for water chemistry "
670 "calculation.");
671
672 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
674 _mesh_vec, _linear_solvers, *config, output_directory);
675 }
676 else
677 {
678 OGS_FATAL(
679 "Unknown chemical solver. Please specify either Phreeqc or "
680 "PhreeqcKernel as the solver for water chemistry calculation "
681 "instead.");
682 }
683#else
684 (void)output_directory;
685
686 OGS_FATAL(
687 "Found the type of the process to be solved is not component transport "
688 "process. Please specify the process type to ComponentTransport. At "
689 "the present, water chemistry calculation is only available for "
690 "component transport process.");
691#endif
692 return chemical_solver_interface;
693}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:35
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:160
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 1398 of file ProjectData.cpp.

1399{
1400 if (!config)
1401 {
1402 return;
1403 }
1404
1405 DBUG("Reading curves configuration.");
1406
1408 for (auto conf : config->getConfigSubtreeList("curve"))
1409 {
1411 auto const name = conf.getConfigParameter<std::string>("name");
1413 _curves,
1414 name,
1417 "The curve name is not unique.");
1418 }
1419}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:30
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:166
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition: Algorithm.h:87
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 1351 of file ProjectData.cpp.

1352{
1353 DBUG("Reading linear solver configuration.");
1354
1356 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1357 {
1359 auto const name = conf.getConfigParameter<std::string>("name");
1360 auto const linear_solver_parser =
1362 auto const solver_options =
1363 linear_solver_parser.parseNameAndOptions("", &conf);
1364
1367 name,
1368 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1369 std::get<1>(solver_options)),
1370 "The linear solver name is not unique");
1371 }
1372}

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

567{
568 if (!media_config)
569 {
570 return;
571 }
572
573 DBUG("Reading media:");
574
575 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
576 {
577 ERR("A mesh is required to define medium materials.");
578 return;
579 }
580
581 for (auto const& medium_config :
583 media_config->getConfigSubtreeList("medium"))
584 {
585 auto material_id_string =
587 medium_config.getConfigAttribute<std::string>("id", "0");
588
589 auto const material_ids_of_this_medium =
590 BaseLib::splitMaterialIdString(material_id_string);
591
592 for (auto const& id : material_ids_of_this_medium)
593 {
594 if (_media.find(id) != end(_media))
595 {
596 OGS_FATAL(
597 "Multiple media were specified for the same material id "
598 "'{:d}'. Keep in mind, that if no material id is "
599 "specified, it is assumed to be 0 by default.",
600 id);
601 }
602
603 if (id == material_ids_of_this_medium[0])
604 {
606 id, _mesh_vec[0]->getDimension(), medium_config,
609 : nullptr,
610 _curves);
611 }
612 else
613 {
614 // This medium has multiple material IDs assigned and this is
615 // not the first material ID. Therefore we can reuse the medium
616 // we created before.
617 _media[id] = _media[material_ids_of_this_medium[0]];
618 }
619 }
620 }
621
622 if (_media.empty())
623 {
624 OGS_FATAL("No entity is found inside <media>.");
625 }
626}
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 1374 of file ProjectData.cpp.

1375{
1376 DBUG("Reading non-linear solver configuration.");
1377
1379 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1380 {
1381 auto const ls_name =
1383 conf.getConfigParameter<std::string>("linear_solver");
1384 auto const& linear_solver = BaseLib::getOrError(
1385 _linear_solvers, ls_name,
1386 "A linear solver with the given name does not exist.");
1387
1389 auto const name = conf.getConfigParameter<std::string>("name");
1392 name,
1393 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1394 "The nonlinear solver name is not unique");
1395 }
1396}
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:163
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:103

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

525{
526 using namespace ProcessLib;
527
528 std::set<std::string> names;
529 std::vector<std::string> parameter_names_for_transformation;
530
531 DBUG("Reading parameters:");
532 for (auto parameter_config :
534 parameters_config.getConfigSubtreeList("parameter"))
535 {
536 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
538 if (!names.insert(p->name).second)
539 {
540 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
541 }
542
543 auto const use_local_coordinate_system =
545 parameter_config.getConfigParameterOptional<bool>(
546 "use_local_coordinate_system");
547 if (!!use_local_coordinate_system && *use_local_coordinate_system)
548 {
549 parameter_names_for_transformation.push_back(p->name);
550 }
551
552 _parameters.push_back(std::move(p));
553 }
554
555 _parameters.push_back(
558 _parameters.push_back(
561
562 return parameter_names_for_transformation;
563}
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:221
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
Input File Parameter:
prj__processes__process__HYDRO_MECHANICS__dimension
Input File Parameter:
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__dimension
Input File Parameter:
prj__processes__process__SMALL_DEFORMATION_WITH_LIE__dimension
Input File Parameter:
prj__processes__process__THERMO_HYDRO_MECHANICS__dimension
Input File Parameter:
prj__processes__process__RICHARDS_MECHANICS__dimension

Definition at line 695 of file ProjectData.cpp.

701{
702 (void)project_directory; // to avoid compilation warning
703 (void)output_directory; // to avoid compilation warning
704
705 DBUG("Reading processes:");
707 for (auto process_config : processes_config.getConfigSubtreeList("process"))
708 {
709 auto const type =
711 process_config.peekConfigParameter<std::string>("type");
712
713 auto const name =
715 process_config.getConfigParameter<std::string>("name");
716
717 [[maybe_unused]] auto const integration_order =
719 process_config.getConfigParameter<int>("integration_order");
720
721 std::unique_ptr<ProcessLib::Process> process;
722
723 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
725 process_config.getConfigSubtreeOptional("jacobian_assembler"));
726
727#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
728 if (type == "STEADY_STATE_DIFFUSION")
729 {
730 // The existence check of the in the configuration referenced
731 // process variables is checked in the physical process.
732 // TODO at the moment we have only one mesh, later there can be
733 // several meshes. Then we have to assign the referenced mesh
734 // here.
735 process =
737 name, *_mesh_vec[0], std::move(jacobian_assembler),
738 _process_variables, _parameters, integration_order,
739 process_config, _mesh_vec, _media);
740 }
741 else
742#endif
743#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
744 if (type == "LIQUID_FLOW")
745 {
747 name, *_mesh_vec[0], std::move(jacobian_assembler),
748 _process_variables, _parameters, integration_order,
749 process_config, _mesh_vec, _media);
750 }
751 else
752#endif
753#ifdef OGS_BUILD_PROCESS_STOKESFLOW
754 if (type == "StokesFlow")
755 {
756 switch (_mesh_vec[0]->getDimension())
757 {
758 case 2:
759 process =
761 name, *_mesh_vec[0], std::move(jacobian_assembler),
762 _process_variables, _parameters, integration_order,
763 process_config, _media);
764 break;
765 default:
766 OGS_FATAL(
767 "StokesFlow process does not support given "
768 "dimension {:d}",
769 _mesh_vec[0]->getDimension());
770 }
771 }
772 else
773#endif
774#ifdef OGS_BUILD_PROCESS_TES
775 if (type == "TES")
776 {
778 name, *_mesh_vec[0], std::move(jacobian_assembler),
779 _process_variables, _parameters, integration_order,
780 process_config);
781 }
782 else
783#endif
784#ifdef OGS_BUILD_PROCESS_TH2M
785 if (type == "TH2M")
786 {
787 switch (_mesh_vec[0]->getDimension())
788 {
789 case 2:
791 name, *_mesh_vec[0], std::move(jacobian_assembler),
793 _local_coordinate_system, integration_order,
794 process_config, _media);
795 break;
796 case 3:
798 name, *_mesh_vec[0], std::move(jacobian_assembler),
800 _local_coordinate_system, integration_order,
801 process_config, _media);
802 break;
803 default:
804 OGS_FATAL("TH2M process does not support given dimension");
805 }
806 }
807 else
808#endif
809#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
810 if (type == "HEAT_CONDUCTION")
811 {
813 name, *_mesh_vec[0], std::move(jacobian_assembler),
814 _process_variables, _parameters, integration_order,
815 process_config, _media);
816 }
817 else
818#endif
819#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
820 if (type == "HEAT_TRANSPORT_BHE")
821 {
822 if (_mesh_vec[0]->getDimension() != 3)
823 {
824 OGS_FATAL(
825 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
826 "mesh! ");
827 }
828
829 process =
831 name, *_mesh_vec[0], std::move(jacobian_assembler),
832 _process_variables, _parameters, integration_order,
833 process_config, _curves, _media);
834 }
835 else
836#endif
837#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
838 if (type == "HYDRO_MECHANICS")
839 {
840 if (
841 process_config.getConfigParameterOptional<int>("dimension"))
842 {
843 OGS_FATAL(
844 "The 'dimension' tag has been removed in the merge-request "
845 "!4766."
846 "The dimension is now taken from the main mesh and the tag "
847 "must be"
848 "removed. There is a python script in the merge-request "
849 "description"
850 "for automatic conversion.");
851 }
852 switch (_mesh_vec[0]->getDimension())
853 {
854 case 2:
855 process =
857 2>(name, *_mesh_vec[0],
858 std::move(jacobian_assembler),
860 _local_coordinate_system, integration_order,
861 process_config, _media);
862 break;
863 case 3:
864 process =
866 3>(name, *_mesh_vec[0],
867 std::move(jacobian_assembler),
869 _local_coordinate_system, integration_order,
870 process_config, _media);
871 break;
872 default:
873 OGS_FATAL(
874 "HYDRO_MECHANICS process does not support given "
875 "dimension");
876 }
877 }
878 else
879#endif
880#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
881 if (type == "LARGE_DEFORMATION")
882 {
883 switch (_mesh_vec[0]->getDimension())
884 {
885 case 2:
888 name, *_mesh_vec[0], std::move(jacobian_assembler),
890 _local_coordinate_system, integration_order,
891 process_config, _media);
892 break;
893 case 3:
896 name, *_mesh_vec[0], std::move(jacobian_assembler),
898 _local_coordinate_system, integration_order,
899 process_config, _media);
900 break;
901 default:
902 OGS_FATAL(
903 "LARGE_DEFORMATION process does not support given "
904 "dimension");
905 }
906 }
907 else
908#endif
909#ifdef OGS_BUILD_PROCESS_LIE
910 if (type == "HYDRO_MECHANICS_WITH_LIE")
911 {
912 if (
913 process_config.getConfigParameterOptional<int>("dimension"))
914 {
915 OGS_FATAL(
916 "The 'dimension' tag has been removed in the merge-request "
917 "!4766."
918 "The dimension is now taken from the main mesh and the tag "
919 "must be"
920 "removed. There is a python script in the merge-request "
921 "description"
922 "for automatic conversion.");
923 }
924 switch (_mesh_vec[0]->getDimension())
925 {
926 case 2:
929 name, *_mesh_vec[0], std::move(jacobian_assembler),
931 _local_coordinate_system, integration_order,
932 process_config);
933 break;
934 case 3:
937 name, *_mesh_vec[0], std::move(jacobian_assembler),
939 _local_coordinate_system, integration_order,
940 process_config);
941 break;
942 default:
943 OGS_FATAL(
944 "HYDRO_MECHANICS_WITH_LIE process does not support "
945 "given dimension");
946 }
947 }
948 else
949#endif
950#ifdef OGS_BUILD_PROCESS_HT
951 if (type == "HT")
952 {
954 name, *_mesh_vec[0], std::move(jacobian_assembler),
955 _process_variables, _parameters, integration_order,
956 process_config, _mesh_vec, _media);
957 }
958 else
959#endif
960#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
961 if (type == "ComponentTransport")
962 {
963 process =
965 name, *_mesh_vec[0], std::move(jacobian_assembler),
966 _process_variables, _parameters, integration_order,
967 process_config, _mesh_vec, _media,
968 std::move(chemical_solver_interface));
969 }
970 else
971#endif
972#ifdef OGS_BUILD_PROCESS_PHASEFIELD
973 if (type == "PHASE_FIELD")
974 {
975 switch (_mesh_vec[0]->getDimension())
976 {
977 case 2:
978 process =
980 name, *_mesh_vec[0], std::move(jacobian_assembler),
982 _local_coordinate_system, integration_order,
983 process_config);
984 break;
985 case 3:
986 process =
988 name, *_mesh_vec[0], std::move(jacobian_assembler),
990 _local_coordinate_system, integration_order,
991 process_config);
992 break;
993 }
994 }
995 else
996#endif
997#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
998 if (type == "RichardsComponentTransport")
999 {
1002 name, *_mesh_vec[0], std::move(jacobian_assembler),
1003 _process_variables, _parameters, integration_order,
1004 process_config, _media);
1005 }
1006 else
1007#endif
1008#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1009 if (type == "SMALL_DEFORMATION")
1010 {
1011 switch (_mesh_vec[0]->getDimension())
1012 {
1013 case 2:
1016 name, *_mesh_vec[0], std::move(jacobian_assembler),
1018 _local_coordinate_system, integration_order,
1019 process_config, _media);
1020 break;
1021 case 3:
1024 name, *_mesh_vec[0], std::move(jacobian_assembler),
1026 _local_coordinate_system, integration_order,
1027 process_config, _media);
1028 break;
1029 default:
1030 OGS_FATAL(
1031 "SMALL_DEFORMATION process does not support given "
1032 "dimension");
1033 }
1034 }
1035 else
1036#endif
1037#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1038 if (type == "SMALL_DEFORMATION_NONLOCAL")
1039 {
1040 switch (_mesh_vec[0]->getDimension())
1041 {
1042 case 2:
1045 name, *_mesh_vec[0], std::move(jacobian_assembler),
1047 _local_coordinate_system, integration_order,
1048 process_config);
1049 break;
1050 case 3:
1053 name, *_mesh_vec[0], std::move(jacobian_assembler),
1055 _local_coordinate_system, integration_order,
1056 process_config);
1057 break;
1058 default:
1059 OGS_FATAL(
1060 "SMALL_DEFORMATION_NONLOCAL process does not support "
1061 "given dimension {:d}",
1062 _mesh_vec[0]->getDimension());
1063 }
1064 }
1065 else
1066#endif
1067#ifdef OGS_BUILD_PROCESS_LIE
1068 if (type == "SMALL_DEFORMATION_WITH_LIE")
1069 {
1070 if (
1071 process_config.getConfigParameterOptional<int>("dimension"))
1072 {
1073 OGS_FATAL(
1074 "The 'dimension' tag has been removed in the merge-request "
1075 "!4766."
1076 "The dimension is now taken from the main mesh and the tag "
1077 "must be"
1078 "removed. There is a python script in the merge-request "
1079 "description"
1080 "for automatic conversion.");
1081 }
1082 switch (_mesh_vec[0]->getDimension())
1083 {
1084 case 2:
1087 name, *_mesh_vec[0], std::move(jacobian_assembler),
1089 _local_coordinate_system, integration_order,
1090 process_config);
1091 break;
1092 case 3:
1095 name, *_mesh_vec[0], std::move(jacobian_assembler),
1097 _local_coordinate_system, integration_order,
1098 process_config);
1099 break;
1100 default:
1101 OGS_FATAL(
1102 "SMALL_DEFORMATION_WITH_LIE process does not support "
1103 "given dimension");
1104 }
1105 }
1106 else
1107#endif
1108#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1109 if (type == "THERMO_HYDRO_MECHANICS")
1110 {
1111 if (
1112 process_config.getConfigParameterOptional<int>("dimension"))
1113 {
1114 OGS_FATAL(
1115 "The 'dimension' tag has been removed in the merge-request "
1116 "!4766."
1117 "The dimension is now taken from the main mesh and the tag "
1118 "must be"
1119 "removed. There is a python script in the merge-request "
1120 "description"
1121 "for automatic conversion.");
1122 }
1123 switch (_mesh_vec[0]->getDimension())
1124 {
1125 case 2:
1128 name, *_mesh_vec[0], std::move(jacobian_assembler),
1130 _local_coordinate_system, integration_order,
1131 process_config, _media);
1132 break;
1133 case 3:
1136 name, *_mesh_vec[0], std::move(jacobian_assembler),
1138 _local_coordinate_system, integration_order,
1139 process_config, _media);
1140 break;
1141 default:
1142 OGS_FATAL(
1143 "THERMO_HYDRO_MECHANICS process does not support given "
1144 "dimension");
1145 }
1146 }
1147 else
1148#endif
1149#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1150 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1151 {
1152 switch (_mesh_vec[0]->getDimension())
1153 {
1154 case 2:
1157 name, *_mesh_vec[0], std::move(jacobian_assembler),
1159 _local_coordinate_system, integration_order,
1160 process_config);
1161 break;
1162 case 3:
1165 name, *_mesh_vec[0], std::move(jacobian_assembler),
1167 _local_coordinate_system, integration_order,
1168 process_config);
1169 break;
1170 }
1171 }
1172 else
1173#endif
1174#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1175 if (type == "THERMO_MECHANICS")
1176 {
1177 switch (_mesh_vec[0]->getDimension())
1178 {
1179 case 2:
1182 name, *_mesh_vec[0], std::move(jacobian_assembler),
1184 _local_coordinate_system, integration_order,
1185 process_config, _media);
1186 break;
1187 case 3:
1190 name, *_mesh_vec[0], std::move(jacobian_assembler),
1192 _local_coordinate_system, integration_order,
1193 process_config, _media);
1194 break;
1195 }
1196 }
1197 else
1198#endif
1199#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1200 if (type == "RICHARDS_FLOW")
1201 {
1203 name, *_mesh_vec[0], std::move(jacobian_assembler),
1204 _process_variables, _parameters, integration_order,
1205 process_config, _media);
1206 }
1207 else
1208#endif
1209#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1210 if (type == "RICHARDS_MECHANICS")
1211 {
1212 if (
1213 process_config.getConfigParameterOptional<int>("dimension"))
1214 {
1215 OGS_FATAL(
1216 "The 'dimension' tag has been removed in the merge-request "
1217 "!4766."
1218 "The dimension is now taken from the main mesh and the tag "
1219 "must be"
1220 "removed. There is a python script in the merge-request "
1221 "description"
1222 "for automatic conversion.");
1223 }
1224 switch (_mesh_vec[0]->getDimension())
1225 {
1226 case 2:
1229 name, *_mesh_vec[0], std::move(jacobian_assembler),
1231 _local_coordinate_system, integration_order,
1232 process_config, _media);
1233 break;
1234 case 3:
1237 name, *_mesh_vec[0], std::move(jacobian_assembler),
1239 _local_coordinate_system, integration_order,
1240 process_config, _media);
1241 break;
1242 }
1243 }
1244 else
1245#endif
1246#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1247 if (type == "THERMO_RICHARDS_FLOW")
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_THERMORICHARDSMECHANICS
1258 if (type == "THERMO_RICHARDS_MECHANICS")
1259 {
1260 switch (_mesh_vec[0]->getDimension())
1261 {
1262 case 2:
1265 name, *_mesh_vec[0], std::move(jacobian_assembler),
1267 _local_coordinate_system, integration_order,
1268 process_config, _media);
1269 break;
1270 case 3:
1273 name, *_mesh_vec[0], std::move(jacobian_assembler),
1275 _local_coordinate_system, integration_order,
1276 process_config, _media);
1277 break;
1278 }
1279 }
1280 else
1281#endif
1282
1283#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1284 if (type == "TWOPHASE_FLOW_PP")
1285 {
1286 process =
1288 name, *_mesh_vec[0], std::move(jacobian_assembler),
1289 _process_variables, _parameters, integration_order,
1290 process_config, _media);
1291 }
1292 else
1293#endif
1294#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1295 if (type == "TWOPHASE_FLOW_PRHO")
1296 {
1299 name, *_mesh_vec[0], std::move(jacobian_assembler),
1300 _process_variables, _parameters, integration_order,
1301 process_config, _media);
1302 }
1303 else
1304#endif
1305#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1306 if (type == "THERMAL_TWOPHASE_WITH_PP")
1307 {
1310 name, *_mesh_vec[0], std::move(jacobian_assembler),
1311 _process_variables, _parameters, integration_order,
1312 process_config, _media);
1313 }
1314 else
1315#endif
1316 {
1317 OGS_FATAL("Unknown process type: {:s}", type);
1318 }
1319
1320 if (ranges::contains(_processes, name,
1321 [](std::unique_ptr<ProcessLib::Process> const& p)
1322 { return p->name; }))
1323 {
1324 OGS_FATAL("The process name '{:s}' is not unique.", name);
1325 }
1326 _processes.push_back(std::move(process));
1327 }
1328}
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:148
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 488 of file ProjectData.cpp.

490{
491 DBUG("Parse process variables:");
492
493 std::set<std::string> names;
494
495 for (auto var_config
497 : process_variables_config.getConfigSubtreeList("process_variable"))
498 {
499 // Either the mesh name is given, or the first mesh's name will be
500 // taken. Taking the first mesh's value is deprecated.
501 auto const mesh_name =
503 var_config.getConfigParameter<std::string>("mesh",
504 _mesh_vec[0]->getName());
505
506 auto& mesh = *BaseLib::findElementOrError(
507 begin(_mesh_vec), end(_mesh_vec),
508 [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
509 "Expected to find a mesh named " + mesh_name + ".");
510
511 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
513 if (!names.insert(pv.getName()).second)
514 {
515 OGS_FATAL("A process variable with name `{:s}' already exists.",
516 pv.getName());
517 }
518
519 _process_variables.push_back(std::move(pv));
520 }
521}

References _curves, _mesh_vec, _parameters, _process_variables, DBUG(), BaseLib::findElementOrError(), 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 1330 of file ProjectData.cpp.

1332{
1333 DBUG("Reading time loop configuration.");
1334
1335 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1336 std::begin(_process_variables),
1337 std::end(_process_variables),
1338 [](auto const& process_variable)
1339 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1340
1342 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1343 compensate_non_equilibrium_initial_residuum);
1344
1345 if (!_time_loop)
1346 {
1347 OGS_FATAL("Initialization of time loop failed.");
1348 }
1349}
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: