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

335 : _mesh_vec(readMeshes(project_config, mesh_directory)),
336 _named_rasters(readRasters(project_config, project_directory,
337 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
338 _mesh_vec[0]->getNodes().end())
339 .getMinMaxPoints()))
340{
341 // for debugging raster reading implementation
342 // writeRasters(_named_rasters, output_directory);
343 if (auto const python_script =
345 project_config.getConfigParameterOptional<std::string>("python_script"))
346 {
347 namespace py = pybind11;
348
349#ifdef OGS_EMBED_PYTHON_INTERPRETER
350 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
351#endif
352
353 // Append to python's module search path
354 auto py_path = py::module::import("sys").attr("path");
355 py_path.attr("append")(script_directory); // .prj or -s directory
356 // virtualenv
357 py_path.attr("append")(
358 CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
359
360 auto const script_path =
361 BaseLib::copyPathToFileName(*python_script, script_directory);
362
363 // Evaluate in scope of main module
364 py::object scope = py::module::import("__main__").attr("__dict__");
365 // add (global) variables
366 auto globals = py::dict(scope);
367 globals["ogs_prj_directory"] = project_directory;
368 globals["ogs_mesh_directory"] = mesh_directory;
369 globals["ogs_script_directory"] = script_directory;
370 py::eval_file(script_path, scope);
371 }
372
374 parseCurves(project_config.getConfigSubtreeOptional("curves"));
375
376 auto parameter_names_for_transformation =
378 parseParameters(project_config.getConfigSubtree("parameters"));
379
382 project_config.getConfigSubtreeOptional("local_coordinate_system"),
384
385 for (auto& parameter : _parameters)
386 {
387 if (std::find(begin(parameter_names_for_transformation),
388 end(parameter_names_for_transformation),
389 parameter->name) !=
390 end(parameter_names_for_transformation))
391 {
393 {
394 OGS_FATAL(
395 "The parameter '{:s}' is using the local coordinate system "
396 "but no local coordinate system was provided.",
397 parameter->name);
398 }
399 parameter->setCoordinateSystem(*_local_coordinate_system);
400 }
401
402 parameter->initialize(_parameters);
403 }
404
406 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
407
409 parseMedia(project_config.getConfigSubtreeOptional("media"));
410
412 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
413
414 auto chemical_solver_interface = parseChemicalSolverInterface(
416 project_config.getConfigSubtreeOptional("chemical_system"),
417 output_directory);
418
420 parseProcesses(project_config.getConfigSubtree("processes"),
421 project_directory, output_directory,
422 std::move(chemical_solver_interface));
423
425 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
426
428 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
429 output_directory);
430}
#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 1362 of file ProjectData.cpp.

1363{
1364 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1365}
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 570 of file ProjectData.cpp.

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

1340{
1341 if (!config)
1342 {
1343 return;
1344 }
1345
1346 DBUG("Reading curves configuration.");
1347
1349 for (auto conf : config->getConfigSubtreeList("curve"))
1350 {
1352 auto const name = conf.getConfigParameter<std::string>("name");
1354 _curves,
1355 name,
1358 "The curve name is not unique.");
1359 }
1360}
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 1292 of file ProjectData.cpp.

1293{
1294 DBUG("Reading linear solver configuration.");
1295
1297 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1298 {
1300 auto const name = conf.getConfigParameter<std::string>("name");
1301 auto const linear_solver_parser =
1303 auto const solver_options =
1304 linear_solver_parser.parseNameAndOptions("", &conf);
1305
1308 name,
1309 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1310 std::get<1>(solver_options)),
1311 "The linear solver name is not unique");
1312 }
1313}

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

508{
509 if (!media_config)
510 {
511 return;
512 }
513
514 DBUG("Reading media:");
515
516 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
517 {
518 ERR("A mesh is required to define medium materials.");
519 return;
520 }
521
522 for (auto const& medium_config :
524 media_config->getConfigSubtreeList("medium"))
525 {
526 auto material_id_string =
528 medium_config.getConfigAttribute<std::string>("id", "0");
529
530 auto const material_ids_of_this_medium =
531 BaseLib::splitMaterialIdString(material_id_string);
532
533 for (auto const& id : material_ids_of_this_medium)
534 {
535 if (_media.find(id) != end(_media))
536 {
537 OGS_FATAL(
538 "Multiple media were specified for the same material id "
539 "'{:d}'. Keep in mind, that if no material id is "
540 "specified, it is assumed to be 0 by default.",
541 id);
542 }
543
544 if (id == material_ids_of_this_medium[0])
545 {
547 id, _mesh_vec[0]->getDimension(), medium_config,
550 : nullptr,
551 _curves);
552 }
553 else
554 {
555 // This medium has multiple material IDs assigned and this is
556 // not the first material ID. Therefore we can reuse the medium
557 // we created before.
558 _media[id] = _media[material_ids_of_this_medium[0]];
559 }
560 }
561 }
562
563 if (_media.empty())
564 {
565 OGS_FATAL("No entity is found inside <media>.");
566 }
567}
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 1315 of file ProjectData.cpp.

1316{
1317 DBUG("Reading non-linear solver configuration.");
1318
1320 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1321 {
1322 auto const ls_name =
1324 conf.getConfigParameter<std::string>("linear_solver");
1325 auto const& linear_solver = BaseLib::getOrError(
1326 _linear_solvers, ls_name,
1327 "A linear solver with the given name does not exist.");
1328
1330 auto const name = conf.getConfigParameter<std::string>("name");
1333 name,
1334 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1335 "The nonlinear solver name is not unique");
1336 }
1337}
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 464 of file ProjectData.cpp.

466{
467 using namespace ProcessLib;
468
469 std::set<std::string> names;
470 std::vector<std::string> parameter_names_for_transformation;
471
472 DBUG("Reading parameters:");
473 for (auto parameter_config :
475 parameters_config.getConfigSubtreeList("parameter"))
476 {
477 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
479 if (!names.insert(p->name).second)
480 {
481 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
482 }
483
484 auto const use_local_coordinate_system =
486 parameter_config.getConfigParameterOptional<bool>(
487 "use_local_coordinate_system");
488 if (!!use_local_coordinate_system && *use_local_coordinate_system)
489 {
490 parameter_names_for_transformation.push_back(p->name);
491 }
492
493 _parameters.push_back(std::move(p));
494 }
495
496 _parameters.push_back(
499 _parameters.push_back(
502
503 return parameter_names_for_transformation;
504}
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 636 of file ProjectData.cpp.

642{
643 (void)project_directory; // to avoid compilation warning
644 (void)output_directory; // to avoid compilation warning
645
646 DBUG("Reading processes:");
648 for (auto process_config : processes_config.getConfigSubtreeList("process"))
649 {
650 auto const type =
652 process_config.peekConfigParameter<std::string>("type");
653
654 auto const name =
656 process_config.getConfigParameter<std::string>("name");
657
658 [[maybe_unused]] auto const integration_order =
660 process_config.getConfigParameter<int>("integration_order");
661
662 std::unique_ptr<ProcessLib::Process> process;
663
664 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
666 process_config.getConfigSubtreeOptional("jacobian_assembler"));
667
668#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
669 if (type == "STEADY_STATE_DIFFUSION")
670 {
671 // The existence check of the in the configuration referenced
672 // process variables is checked in the physical process.
673 // TODO at the moment we have only one mesh, later there can be
674 // several meshes. Then we have to assign the referenced mesh
675 // here.
676 process =
678 name, *_mesh_vec[0], std::move(jacobian_assembler),
679 _process_variables, _parameters, integration_order,
680 process_config, _mesh_vec, _media);
681 }
682 else
683#endif
684#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
685 if (type == "LIQUID_FLOW")
686 {
688 name, *_mesh_vec[0], std::move(jacobian_assembler),
689 _process_variables, _parameters, integration_order,
690 process_config, _mesh_vec, _media);
691 }
692 else
693#endif
694#ifdef OGS_BUILD_PROCESS_STOKESFLOW
695 if (type == "StokesFlow")
696 {
697 switch (_mesh_vec[0]->getDimension())
698 {
699 case 2:
700 process =
702 name, *_mesh_vec[0], std::move(jacobian_assembler),
703 _process_variables, _parameters, integration_order,
704 process_config, _media);
705 break;
706 default:
707 OGS_FATAL(
708 "StokesFlow process does not support given "
709 "dimension {:d}",
710 _mesh_vec[0]->getDimension());
711 }
712 }
713 else
714#endif
715#ifdef OGS_BUILD_PROCESS_TES
716 if (type == "TES")
717 {
719 name, *_mesh_vec[0], std::move(jacobian_assembler),
720 _process_variables, _parameters, integration_order,
721 process_config);
722 }
723 else
724#endif
725#ifdef OGS_BUILD_PROCESS_TH2M
726 if (type == "TH2M")
727 {
728 switch (_mesh_vec[0]->getDimension())
729 {
730 case 2:
732 name, *_mesh_vec[0], std::move(jacobian_assembler),
734 _local_coordinate_system, integration_order,
735 process_config, _media);
736 break;
737 case 3:
739 name, *_mesh_vec[0], std::move(jacobian_assembler),
741 _local_coordinate_system, integration_order,
742 process_config, _media);
743 break;
744 default:
745 OGS_FATAL("TH2M process does not support given dimension");
746 }
747 }
748 else
749#endif
750#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
751 if (type == "HEAT_CONDUCTION")
752 {
754 name, *_mesh_vec[0], std::move(jacobian_assembler),
755 _process_variables, _parameters, integration_order,
756 process_config, _media);
757 }
758 else
759#endif
760#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
761 if (type == "HEAT_TRANSPORT_BHE")
762 {
763 if (_mesh_vec[0]->getDimension() != 3)
764 {
765 OGS_FATAL(
766 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
767 "mesh! ");
768 }
769
770 process =
772 name, *_mesh_vec[0], std::move(jacobian_assembler),
773 _process_variables, _parameters, integration_order,
774 process_config, _curves, _media);
775 }
776 else
777#endif
778#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
779 if (type == "HYDRO_MECHANICS")
780 {
781 if (
782 process_config.getConfigParameterOptional<int>("dimension"))
783 {
784 OGS_FATAL(
785 "The 'dimension' tag has been removed in the merge-request "
786 "!4766."
787 "The dimension is now taken from the main mesh and the tag "
788 "must be"
789 "removed. There is a python script in the merge-request "
790 "description"
791 "for automatic conversion.");
792 }
793 switch (_mesh_vec[0]->getDimension())
794 {
795 case 2:
796 process =
798 2>(name, *_mesh_vec[0],
799 std::move(jacobian_assembler),
801 _local_coordinate_system, integration_order,
802 process_config, _media);
803 break;
804 case 3:
805 process =
807 3>(name, *_mesh_vec[0],
808 std::move(jacobian_assembler),
810 _local_coordinate_system, integration_order,
811 process_config, _media);
812 break;
813 default:
814 OGS_FATAL(
815 "HYDRO_MECHANICS process does not support given "
816 "dimension");
817 }
818 }
819 else
820#endif
821#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
822 if (type == "LARGE_DEFORMATION")
823 {
824 switch (_mesh_vec[0]->getDimension())
825 {
826 case 2:
829 name, *_mesh_vec[0], std::move(jacobian_assembler),
831 _local_coordinate_system, integration_order,
832 process_config, _media);
833 break;
834 case 3:
837 name, *_mesh_vec[0], std::move(jacobian_assembler),
839 _local_coordinate_system, integration_order,
840 process_config, _media);
841 break;
842 default:
843 OGS_FATAL(
844 "LARGE_DEFORMATION process does not support given "
845 "dimension");
846 }
847 }
848 else
849#endif
850#ifdef OGS_BUILD_PROCESS_LIE
851 if (type == "HYDRO_MECHANICS_WITH_LIE")
852 {
853 if (
854 process_config.getConfigParameterOptional<int>("dimension"))
855 {
856 OGS_FATAL(
857 "The 'dimension' tag has been removed in the merge-request "
858 "!4766."
859 "The dimension is now taken from the main mesh and the tag "
860 "must be"
861 "removed. There is a python script in the merge-request "
862 "description"
863 "for automatic conversion.");
864 }
865 switch (_mesh_vec[0]->getDimension())
866 {
867 case 2:
870 name, *_mesh_vec[0], std::move(jacobian_assembler),
872 _local_coordinate_system, integration_order,
873 process_config);
874 break;
875 case 3:
878 name, *_mesh_vec[0], std::move(jacobian_assembler),
880 _local_coordinate_system, integration_order,
881 process_config);
882 break;
883 default:
884 OGS_FATAL(
885 "HYDRO_MECHANICS_WITH_LIE process does not support "
886 "given dimension");
887 }
888 }
889 else
890#endif
891#ifdef OGS_BUILD_PROCESS_HT
892 if (type == "HT")
893 {
895 name, *_mesh_vec[0], std::move(jacobian_assembler),
896 _process_variables, _parameters, integration_order,
897 process_config, _mesh_vec, _media);
898 }
899 else
900#endif
901#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
902 if (type == "ComponentTransport")
903 {
904 process =
906 name, *_mesh_vec[0], std::move(jacobian_assembler),
907 _process_variables, _parameters, integration_order,
908 process_config, _mesh_vec, _media,
909 std::move(chemical_solver_interface));
910 }
911 else
912#endif
913#ifdef OGS_BUILD_PROCESS_PHASEFIELD
914 if (type == "PHASE_FIELD")
915 {
916 switch (_mesh_vec[0]->getDimension())
917 {
918 case 2:
919 process =
921 name, *_mesh_vec[0], std::move(jacobian_assembler),
923 _local_coordinate_system, integration_order,
924 process_config);
925 break;
926 case 3:
927 process =
929 name, *_mesh_vec[0], std::move(jacobian_assembler),
931 _local_coordinate_system, integration_order,
932 process_config);
933 break;
934 }
935 }
936 else
937#endif
938#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
939 if (type == "RichardsComponentTransport")
940 {
943 name, *_mesh_vec[0], std::move(jacobian_assembler),
944 _process_variables, _parameters, integration_order,
945 process_config, _media);
946 }
947 else
948#endif
949#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
950 if (type == "SMALL_DEFORMATION")
951 {
952 switch (_mesh_vec[0]->getDimension())
953 {
954 case 2:
957 name, *_mesh_vec[0], std::move(jacobian_assembler),
959 _local_coordinate_system, integration_order,
960 process_config, _media);
961 break;
962 case 3:
965 name, *_mesh_vec[0], std::move(jacobian_assembler),
967 _local_coordinate_system, integration_order,
968 process_config, _media);
969 break;
970 default:
971 OGS_FATAL(
972 "SMALL_DEFORMATION process does not support given "
973 "dimension");
974 }
975 }
976 else
977#endif
978#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
979 if (type == "SMALL_DEFORMATION_NONLOCAL")
980 {
981 switch (_mesh_vec[0]->getDimension())
982 {
983 case 2:
986 name, *_mesh_vec[0], std::move(jacobian_assembler),
988 _local_coordinate_system, integration_order,
989 process_config);
990 break;
991 case 3:
994 name, *_mesh_vec[0], std::move(jacobian_assembler),
996 _local_coordinate_system, integration_order,
997 process_config);
998 break;
999 default:
1000 OGS_FATAL(
1001 "SMALL_DEFORMATION_NONLOCAL process does not support "
1002 "given dimension {:d}",
1003 _mesh_vec[0]->getDimension());
1004 }
1005 }
1006 else
1007#endif
1008#ifdef OGS_BUILD_PROCESS_LIE
1009 if (type == "SMALL_DEFORMATION_WITH_LIE")
1010 {
1011 if (
1012 process_config.getConfigParameterOptional<int>("dimension"))
1013 {
1014 OGS_FATAL(
1015 "The 'dimension' tag has been removed in the merge-request "
1016 "!4766."
1017 "The dimension is now taken from the main mesh and the tag "
1018 "must be"
1019 "removed. There is a python script in the merge-request "
1020 "description"
1021 "for automatic conversion.");
1022 }
1023 switch (_mesh_vec[0]->getDimension())
1024 {
1025 case 2:
1028 name, *_mesh_vec[0], std::move(jacobian_assembler),
1030 _local_coordinate_system, integration_order,
1031 process_config);
1032 break;
1033 case 3:
1036 name, *_mesh_vec[0], std::move(jacobian_assembler),
1038 _local_coordinate_system, integration_order,
1039 process_config);
1040 break;
1041 default:
1042 OGS_FATAL(
1043 "SMALL_DEFORMATION_WITH_LIE process does not support "
1044 "given dimension");
1045 }
1046 }
1047 else
1048#endif
1049#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1050 if (type == "THERMO_HYDRO_MECHANICS")
1051 {
1052 if (
1053 process_config.getConfigParameterOptional<int>("dimension"))
1054 {
1055 OGS_FATAL(
1056 "The 'dimension' tag has been removed in the merge-request "
1057 "!4766."
1058 "The dimension is now taken from the main mesh and the tag "
1059 "must be"
1060 "removed. There is a python script in the merge-request "
1061 "description"
1062 "for automatic conversion.");
1063 }
1064 switch (_mesh_vec[0]->getDimension())
1065 {
1066 case 2:
1069 name, *_mesh_vec[0], std::move(jacobian_assembler),
1071 _local_coordinate_system, integration_order,
1072 process_config, _media);
1073 break;
1074 case 3:
1077 name, *_mesh_vec[0], std::move(jacobian_assembler),
1079 _local_coordinate_system, integration_order,
1080 process_config, _media);
1081 break;
1082 default:
1083 OGS_FATAL(
1084 "THERMO_HYDRO_MECHANICS process does not support given "
1085 "dimension");
1086 }
1087 }
1088 else
1089#endif
1090#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1091 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1092 {
1093 switch (_mesh_vec[0]->getDimension())
1094 {
1095 case 2:
1098 name, *_mesh_vec[0], std::move(jacobian_assembler),
1100 _local_coordinate_system, integration_order,
1101 process_config);
1102 break;
1103 case 3:
1106 name, *_mesh_vec[0], std::move(jacobian_assembler),
1108 _local_coordinate_system, integration_order,
1109 process_config);
1110 break;
1111 }
1112 }
1113 else
1114#endif
1115#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1116 if (type == "THERMO_MECHANICS")
1117 {
1118 switch (_mesh_vec[0]->getDimension())
1119 {
1120 case 2:
1123 name, *_mesh_vec[0], std::move(jacobian_assembler),
1125 _local_coordinate_system, integration_order,
1126 process_config, _media);
1127 break;
1128 case 3:
1131 name, *_mesh_vec[0], std::move(jacobian_assembler),
1133 _local_coordinate_system, integration_order,
1134 process_config, _media);
1135 break;
1136 }
1137 }
1138 else
1139#endif
1140#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1141 if (type == "RICHARDS_FLOW")
1142 {
1144 name, *_mesh_vec[0], std::move(jacobian_assembler),
1145 _process_variables, _parameters, integration_order,
1146 process_config, _media);
1147 }
1148 else
1149#endif
1150#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1151 if (type == "RICHARDS_MECHANICS")
1152 {
1153 if (
1154 process_config.getConfigParameterOptional<int>("dimension"))
1155 {
1156 OGS_FATAL(
1157 "The 'dimension' tag has been removed in the merge-request "
1158 "!4766."
1159 "The dimension is now taken from the main mesh and the tag "
1160 "must be"
1161 "removed. There is a python script in the merge-request "
1162 "description"
1163 "for automatic conversion.");
1164 }
1165 switch (_mesh_vec[0]->getDimension())
1166 {
1167 case 2:
1170 name, *_mesh_vec[0], std::move(jacobian_assembler),
1172 _local_coordinate_system, integration_order,
1173 process_config, _media);
1174 break;
1175 case 3:
1178 name, *_mesh_vec[0], std::move(jacobian_assembler),
1180 _local_coordinate_system, integration_order,
1181 process_config, _media);
1182 break;
1183 }
1184 }
1185 else
1186#endif
1187#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1188 if (type == "THERMO_RICHARDS_FLOW")
1189 {
1190 process =
1192 name, *_mesh_vec[0], std::move(jacobian_assembler),
1193 _process_variables, _parameters, integration_order,
1194 process_config, _media);
1195 }
1196 else
1197#endif
1198#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1199 if (type == "THERMO_RICHARDS_MECHANICS")
1200 {
1201 switch (_mesh_vec[0]->getDimension())
1202 {
1203 case 2:
1206 name, *_mesh_vec[0], std::move(jacobian_assembler),
1208 _local_coordinate_system, integration_order,
1209 process_config, _media);
1210 break;
1211 case 3:
1214 name, *_mesh_vec[0], std::move(jacobian_assembler),
1216 _local_coordinate_system, integration_order,
1217 process_config, _media);
1218 break;
1219 }
1220 }
1221 else
1222#endif
1223
1224#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1225 if (type == "TWOPHASE_FLOW_PP")
1226 {
1227 process =
1229 name, *_mesh_vec[0], std::move(jacobian_assembler),
1230 _process_variables, _parameters, integration_order,
1231 process_config, _media);
1232 }
1233 else
1234#endif
1235#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1236 if (type == "TWOPHASE_FLOW_PRHO")
1237 {
1240 name, *_mesh_vec[0], std::move(jacobian_assembler),
1241 _process_variables, _parameters, integration_order,
1242 process_config, _media);
1243 }
1244 else
1245#endif
1246#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1247 if (type == "THERMAL_TWOPHASE_WITH_PP")
1248 {
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 {
1258 OGS_FATAL("Unknown process type: {:s}", type);
1259 }
1260
1261 if (ranges::contains(_processes, name,
1262 [](std::unique_ptr<ProcessLib::Process> const& p)
1263 { return p->name; }))
1264 {
1265 OGS_FATAL("The process name '{:s}' is not unique.", name);
1266 }
1267 _processes.push_back(std::move(process));
1268 }
1269}
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 432 of file ProjectData.cpp.

434{
435 DBUG("Parse process variables:");
436
437 std::set<std::string> names;
438
439 for (auto var_config
441 : process_variables_config.getConfigSubtreeList("process_variable"))
442 {
443 // Either the mesh name is given, or the first mesh's name will be
444 // taken. Taking the first mesh's value is deprecated.
445 auto const mesh_name =
447 var_config.getConfigParameter<std::string>("mesh",
448 _mesh_vec[0]->getName());
449
450 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
451
452 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
454 if (!names.insert(pv.getName()).second)
455 {
456 OGS_FATAL("A process variable with name `{:s}' already exists.",
457 pv.getName());
458 }
459
460 _process_variables.push_back(std::move(pv));
461 }
462}

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

1273{
1274 DBUG("Reading time loop configuration.");
1275
1276 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1277 std::begin(_process_variables),
1278 std::end(_process_variables),
1279 [](auto const& process_variable)
1280 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1281
1283 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1284 compensate_non_equilibrium_initial_residuum);
1285
1286 if (!_time_loop)
1287 {
1288 OGS_FATAL("Initialization of time loop failed.");
1289 }
1290}
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: