Loading [MathJax]/extensions/tex2jax.js
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 355 of file ProjectData.cpp.

360 : _mesh_vec(readMeshes(project_config, mesh_directory, project_directory)),
361 _named_rasters(readRasters(project_config, project_directory,
362 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
363 _mesh_vec[0]->getNodes().end())
364 .getMinMaxPoints()))
365{
366 // for debugging raster reading implementation
367 // writeRasters(_named_rasters, output_directory);
368 if (auto const python_script =
370 project_config.getConfigParameterOptional<std::string>("python_script"))
371 {
372 namespace py = pybind11;
373
374#ifdef OGS_EMBED_PYTHON_INTERPRETER
375 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
376#endif
377
378 // Append to python's module search path
379 auto py_path = py::module::import("sys").attr("path");
380 py_path.attr("append")(script_directory); // .prj or -s directory
381
382 auto const script_path =
383 BaseLib::joinPaths(script_directory, *python_script);
384
385 // Evaluate in scope of main module
386 py::object scope = py::module::import("__main__").attr("__dict__");
387 // add (global) variables
388 auto globals = py::dict(scope);
389 globals["ogs_prj_directory"] = project_directory;
390 globals["ogs_mesh_directory"] = mesh_directory;
391 globals["ogs_script_directory"] = script_directory;
392 try
393 {
394 py::eval_file(script_path, scope);
395 }
396 catch (py::error_already_set const& e)
397 {
398 OGS_FATAL("Error evaluating python script {}: {}", script_path,
399 e.what());
400 }
401 }
402
404 parseCurves(project_config.getConfigSubtreeOptional("curves"));
405
406 auto parameter_names_for_transformation =
408 parseParameters(project_config.getConfigSubtree("parameters"));
409
412 project_config.getConfigSubtreeOptional("local_coordinate_system"),
414
415 for (auto& parameter : _parameters)
416 {
417 if (std::find(begin(parameter_names_for_transformation),
418 end(parameter_names_for_transformation),
419 parameter->name) !=
420 end(parameter_names_for_transformation))
421 {
423 {
424 OGS_FATAL(
425 "The parameter '{:s}' is using the local coordinate system "
426 "but no local coordinate system was provided.",
427 parameter->name);
428 }
429 parameter->setCoordinateSystem(*_local_coordinate_system);
430 }
431
432 parameter->initialize(_parameters);
433 }
434
436 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
437
439 parseMedia(project_config.getConfigSubtreeOptional("media"));
440
442 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
443
444 auto chemical_solver_interface = parseChemicalSolverInterface(
446 project_config.getConfigSubtreeOptional("chemical_system"),
447 output_directory);
448
450 parseProcesses(project_config.getConfigSubtree("processes"),
451 project_directory, output_directory,
452 std::move(chemical_solver_interface));
453
455 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
456
458 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
459 output_directory);
460}
#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 joinPaths(std::string const &pathA, std::string const &pathB)
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:32
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, ParameterLib::createCoordinateSystem(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), BaseLib::joinPaths(), 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 1322 of file ProjectData.cpp.

1323{
1324 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1325}
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
Definition Mesh.cpp:364

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

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

1300{
1301 if (!config)
1302 {
1303 return;
1304 }
1305
1306 DBUG("Reading curves configuration.");
1307
1309 for (auto conf : config->getConfigSubtreeList("curve"))
1310 {
1312 auto const name = conf.getConfigParameter<std::string>("name");
1314 _curves,
1315 name,
1318 "The curve name is not unique.");
1319 }
1320}
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:104
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 1252 of file ProjectData.cpp.

1253{
1254 DBUG("Reading linear solver configuration.");
1255
1257 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1258 {
1260 auto const name = conf.getConfigParameter<std::string>("name");
1261 auto const linear_solver_parser =
1263 auto const solver_options =
1264 linear_solver_parser.parseNameAndOptions("", &conf);
1265
1268 name,
1269 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1270 std::get<1>(solver_options)),
1271 "The linear solver name is not unique");
1272 }
1273}

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

538{
539 if (!media_config)
540 {
541 return;
542 }
543
544 DBUG("Reading media:");
545
546 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
547 {
548 ERR("A mesh is required to define medium materials.");
549 return;
550 }
551
552 for (auto const& medium_config :
554 media_config->getConfigSubtreeList("medium"))
555 {
556 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
557 &medium_config, this](int const id)
558 {
560 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
562 _curves);
563 };
564
565 auto const material_id_string =
567 medium_config.getConfigAttribute<std::string>("id", "0");
568
569 std::vector<int> const material_ids_of_this_medium =
570 MaterialLib::parseMaterialIdString(material_id_string,
572
573 for (auto const& id : material_ids_of_this_medium)
574 {
576 id, _media, material_ids_of_this_medium, create_medium);
577 }
578 }
579
580 if (_media.empty())
581 {
582 OGS_FATAL("No entity is found inside <media>.");
583 }
584}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
void createMediumForId(int const id, std::map< int, std::shared_ptr< T > > &media, std::vector< int > const &material_ids_of_this_medium, CreateMedium &&create_medium)
std::vector< int > parseMaterialIdString(std::string const &material_id_string, MeshLib::PropertyVector< int > const *const material_ids)
std::unique_ptr< Medium > createMedium(int const material_id, int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
PropertyVector< int > const * materialIDs(Mesh const &mesh)
Definition Mesh.cpp:268
unsigned getDimension(MeshLib::MeshElemType eleType)

References _curves, _local_coordinate_system, _media, _mesh_vec, _parameters, MaterialPropertyLib::createMedium(), MaterialLib::createMediumForId(), DBUG(), ERR(), OGS_FATAL, and MaterialLib::parseMaterialIdString().

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

1276{
1277 DBUG("Reading non-linear solver configuration.");
1278
1280 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1281 {
1282 auto const ls_name =
1284 conf.getConfigParameter<std::string>("linear_solver");
1285 auto const& linear_solver = BaseLib::getOrError(
1286 _linear_solvers, ls_name,
1287 "A linear solver with the given name does not exist.");
1288
1290 auto const name = conf.getConfigParameter<std::string>("name");
1293 name,
1294 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1295 "The nonlinear solver name is not unique");
1296 }
1297}
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:118

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

496{
497 using namespace ProcessLib;
498
499 std::set<std::string> names;
500 std::vector<std::string> parameter_names_for_transformation;
501
502 DBUG("Reading parameters:");
503 for (auto parameter_config :
505 parameters_config.getConfigSubtreeList("parameter"))
506 {
507 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
509 if (!names.insert(p->name).second)
510 {
511 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
512 }
513
514 auto const use_local_coordinate_system =
516 parameter_config.getConfigParameterOptional<bool>(
517 "use_local_coordinate_system");
518 if (!!use_local_coordinate_system && *use_local_coordinate_system)
519 {
520 parameter_names_for_transformation.push_back(p->name);
521 }
522
523 _parameters.push_back(std::move(p));
524 }
525
526 _parameters.push_back(
529 _parameters.push_back(
532
533 return parameter_names_for_transformation;
534}
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:47
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:231
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 653 of file ProjectData.cpp.

659{
660 (void)project_directory; // to avoid compilation warning
661 (void)output_directory; // to avoid compilation warning
662
663 DBUG("Reading processes:");
665 for (auto process_config : processes_config.getConfigSubtreeList("process"))
666 {
667 auto const type =
669 process_config.peekConfigParameter<std::string>("type");
670
671 auto const name =
673 process_config.getConfigParameter<std::string>("name");
674
675 [[maybe_unused]] auto const integration_order =
677 process_config.getConfigParameter<int>("integration_order");
678
679 std::unique_ptr<ProcessLib::Process> process;
680
681 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
683 process_config.getConfigSubtreeOptional("jacobian_assembler"));
684
685#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
686 if (type == "STEADY_STATE_DIFFUSION")
687 {
688 // The existence check of the in the configuration referenced
689 // process variables is checked in the physical process.
690 // TODO at the moment we have only one mesh, later there can be
691 // several meshes. Then we have to assign the referenced mesh
692 // here.
693 process =
695 name, *_mesh_vec[0], std::move(jacobian_assembler),
696 _process_variables, _parameters, integration_order,
697 process_config, _mesh_vec, _media);
698 }
699 else
700#endif
701#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
702 if (type == "LIQUID_FLOW")
703 {
705 name, *_mesh_vec[0], std::move(jacobian_assembler),
706 _process_variables, _parameters, integration_order,
707 process_config, _mesh_vec, _media);
708 }
709 else
710#endif
711#ifdef OGS_BUILD_PROCESS_TH2M
712 if (type == "TH2M")
713 {
714 switch (_mesh_vec[0]->getDimension())
715 {
716 case 2:
718 name, *_mesh_vec[0], std::move(jacobian_assembler),
720 _local_coordinate_system, integration_order,
721 process_config, _media);
722 break;
723 case 3:
725 name, *_mesh_vec[0], std::move(jacobian_assembler),
727 _local_coordinate_system, integration_order,
728 process_config, _media);
729 break;
730 default:
731 OGS_FATAL("TH2M process does not support given dimension");
732 }
733 }
734 else
735#endif
736#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
737 if (type == "HEAT_CONDUCTION")
738 {
740 name, *_mesh_vec[0], std::move(jacobian_assembler),
741 _process_variables, _parameters, integration_order,
742 process_config, _media);
743 }
744 else
745#endif
746#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
747 if (type == "HEAT_TRANSPORT_BHE")
748 {
749 if (_mesh_vec[0]->getDimension() != 3)
750 {
751 OGS_FATAL(
752 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
753 "mesh! ");
754 }
755
756 process =
758 name, *_mesh_vec[0], std::move(jacobian_assembler),
759 _process_variables, _parameters, integration_order,
760 process_config, _curves, _media);
761 }
762 else
763#endif
764#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
765 if (type == "WELLBORE_SIMULATOR")
766 {
767 if (_mesh_vec[0]->getDimension() != 1)
768 {
769 OGS_FATAL(
770 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
771 "mesh!");
772 }
773
774 process =
776 name, *_mesh_vec[0], std::move(jacobian_assembler),
777 _process_variables, _parameters, integration_order,
778 process_config, _media);
779 }
780 else
781#endif
782#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
783 if (type == "HYDRO_MECHANICS")
784 {
785 if (
786 process_config.getConfigParameterOptional<int>("dimension"))
787 {
788 OGS_FATAL(
789 "The 'dimension' tag has been removed in the merge-request "
790 "!4766. The dimension is now taken from the main mesh and "
791 "the tag must be removed. There is a python script in the "
792 "merge-request description for automatic conversion.");
793 }
794 switch (_mesh_vec[0]->getDimension())
795 {
796 case 2:
797 process =
799 2>(name, *_mesh_vec[0],
800 std::move(jacobian_assembler),
802 _local_coordinate_system, integration_order,
803 process_config, _media);
804 break;
805 case 3:
806 process =
808 3>(name, *_mesh_vec[0],
809 std::move(jacobian_assembler),
811 _local_coordinate_system, integration_order,
812 process_config, _media);
813 break;
814 default:
815 OGS_FATAL(
816 "HYDRO_MECHANICS process does not support given "
817 "dimension");
818 }
819 }
820 else
821#endif
822#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
823 if (type == "LARGE_DEFORMATION")
824 {
825 switch (_mesh_vec[0]->getDimension())
826 {
827 case 2:
830 name, *_mesh_vec[0], std::move(jacobian_assembler),
832 _local_coordinate_system, integration_order,
833 process_config, _media);
834 break;
835 case 3:
838 name, *_mesh_vec[0], std::move(jacobian_assembler),
840 _local_coordinate_system, integration_order,
841 process_config, _media);
842 break;
843 default:
844 OGS_FATAL(
845 "LARGE_DEFORMATION process does not support given "
846 "dimension");
847 }
848 }
849 else
850#endif
851#ifdef OGS_BUILD_PROCESS_LIE_HM
852 if (type == "HYDRO_MECHANICS_WITH_LIE")
853 {
854 if (
855 process_config.getConfigParameterOptional<int>("dimension"))
856 {
857 OGS_FATAL(
858 "The 'dimension' tag has been removed in the merge-request "
859 "!4766."
860 "The dimension is now taken from the main mesh and the tag "
861 "must be"
862 "removed. There is a python script in the merge-request "
863 "description"
864 "for automatic conversion.");
865 }
866 switch (_mesh_vec[0]->getDimension())
867 {
868 case 2:
871 name, *_mesh_vec[0], std::move(jacobian_assembler),
873 _local_coordinate_system, integration_order,
874 process_config, _media);
875 break;
876 case 3:
879 name, *_mesh_vec[0], std::move(jacobian_assembler),
881 _local_coordinate_system, integration_order,
882 process_config, _media);
883 break;
884 default:
885 OGS_FATAL(
886 "HYDRO_MECHANICS_WITH_LIE process does not support "
887 "given dimension");
888 }
889 }
890 else
891#endif
892#ifdef OGS_BUILD_PROCESS_HT
893 if (type == "HT")
894 {
896 name, *_mesh_vec[0], std::move(jacobian_assembler),
897 _process_variables, _parameters, integration_order,
898 process_config, _mesh_vec, _media);
899 }
900 else
901#endif
902#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
903 if (type == "ComponentTransport")
904 {
905 process =
907 name, *_mesh_vec[0], std::move(jacobian_assembler),
908 _process_variables, _parameters, integration_order,
909 process_config, _mesh_vec, _media,
910 std::move(chemical_solver_interface));
911 }
912 else
913#endif
914#ifdef OGS_BUILD_PROCESS_PHASEFIELD
915 if (type == "PHASE_FIELD")
916 {
917 switch (_mesh_vec[0]->getDimension())
918 {
919 case 2:
920 process =
922 name, *_mesh_vec[0], std::move(jacobian_assembler),
924 _local_coordinate_system, integration_order,
925 process_config);
926 break;
927 case 3:
928 process =
930 name, *_mesh_vec[0], std::move(jacobian_assembler),
932 _local_coordinate_system, integration_order,
933 process_config);
934 break;
935 }
936 }
937 else
938#endif
939#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
940 if (type == "HM_PHASE_FIELD")
941 {
942 switch (_mesh_vec[0]->getDimension())
943 {
944 case 2:
945 process =
947 name, *_mesh_vec[0], std::move(jacobian_assembler),
949 _local_coordinate_system, integration_order,
950 process_config, _media);
951 break;
952 case 3:
953 process =
955 name, *_mesh_vec[0], std::move(jacobian_assembler),
957 _local_coordinate_system, integration_order,
958 process_config, _media);
959 break;
960 }
961 }
962 else
963#endif
964#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
965 if (type == "RichardsComponentTransport")
966 {
969 name, *_mesh_vec[0], std::move(jacobian_assembler),
970 _process_variables, _parameters, integration_order,
971 process_config, _media);
972 }
973 else
974#endif
975#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
976 if (type == "SMALL_DEFORMATION")
977 {
978 switch (_mesh_vec[0]->getDimension())
979 {
980 case 2:
983 name, *_mesh_vec[0], std::move(jacobian_assembler),
985 _local_coordinate_system, integration_order,
986 process_config, _media);
987 break;
988 case 3:
991 name, *_mesh_vec[0], std::move(jacobian_assembler),
993 _local_coordinate_system, integration_order,
994 process_config, _media);
995 break;
996 default:
997 OGS_FATAL(
998 "SMALL_DEFORMATION process does not support given "
999 "dimension");
1000 }
1001 }
1002 else
1003#endif
1004#ifdef OGS_BUILD_PROCESS_LIE_M
1005 if (type == "SMALL_DEFORMATION_WITH_LIE")
1006 {
1007 if (
1008 process_config.getConfigParameterOptional<int>("dimension"))
1009 {
1010 OGS_FATAL(
1011 "The 'dimension' tag has been removed in the merge-request "
1012 "!4766."
1013 "The dimension is now taken from the main mesh and the tag "
1014 "must be"
1015 "removed. There is a python script in the merge-request "
1016 "description"
1017 "for automatic conversion.");
1018 }
1019 switch (_mesh_vec[0]->getDimension())
1020 {
1021 case 2:
1024 name, *_mesh_vec[0], std::move(jacobian_assembler),
1026 _local_coordinate_system, integration_order,
1027 process_config);
1028 break;
1029 case 3:
1032 name, *_mesh_vec[0], std::move(jacobian_assembler),
1034 _local_coordinate_system, integration_order,
1035 process_config);
1036 break;
1037 default:
1038 OGS_FATAL(
1039 "SMALL_DEFORMATION_WITH_LIE process does not support "
1040 "given dimension");
1041 }
1042 }
1043 else
1044#endif
1045#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1046 if (type == "THERMO_HYDRO_MECHANICS")
1047 {
1048 if (
1049 process_config.getConfigParameterOptional<int>("dimension"))
1050 {
1051 OGS_FATAL(
1052 "The 'dimension' tag has been removed in the merge-request "
1053 "!4766."
1054 "The dimension is now taken from the main mesh and the tag "
1055 "must be"
1056 "removed. There is a python script in the merge-request "
1057 "description"
1058 "for automatic conversion.");
1059 }
1060 switch (_mesh_vec[0]->getDimension())
1061 {
1062 case 2:
1065 name, *_mesh_vec[0], std::move(jacobian_assembler),
1067 _local_coordinate_system, integration_order,
1068 process_config, _media);
1069 break;
1070 case 3:
1073 name, *_mesh_vec[0], std::move(jacobian_assembler),
1075 _local_coordinate_system, integration_order,
1076 process_config, _media);
1077 break;
1078 default:
1079 OGS_FATAL(
1080 "THERMO_HYDRO_MECHANICS process does not support given "
1081 "dimension");
1082 }
1083 }
1084 else
1085#endif
1086#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1087 if (type == "THERMO_MECHANICS")
1088 {
1089 switch (_mesh_vec[0]->getDimension())
1090 {
1091 case 2:
1094 name, *_mesh_vec[0], std::move(jacobian_assembler),
1096 _local_coordinate_system, integration_order,
1097 process_config, _media);
1098 break;
1099 case 3:
1102 name, *_mesh_vec[0], std::move(jacobian_assembler),
1104 _local_coordinate_system, integration_order,
1105 process_config, _media);
1106 break;
1107 }
1108 }
1109 else
1110#endif
1111#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1112 if (type == "RICHARDS_FLOW")
1113 {
1115 name, *_mesh_vec[0], std::move(jacobian_assembler),
1116 _process_variables, _parameters, integration_order,
1117 process_config, _media);
1118 }
1119 else
1120#endif
1121#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1122 if (type == "RICHARDS_MECHANICS")
1123 {
1124 if (
1125 process_config.getConfigParameterOptional<int>("dimension"))
1126 {
1127 OGS_FATAL(
1128 "The 'dimension' tag has been removed in the merge-request "
1129 "!4766."
1130 "The dimension is now taken from the main mesh and the tag "
1131 "must be"
1132 "removed. There is a python script in the merge-request "
1133 "description"
1134 "for automatic conversion.");
1135 }
1136 switch (_mesh_vec[0]->getDimension())
1137 {
1138 case 2:
1141 name, *_mesh_vec[0], std::move(jacobian_assembler),
1143 _local_coordinate_system, integration_order,
1144 process_config, _media);
1145 break;
1146 case 3:
1149 name, *_mesh_vec[0], std::move(jacobian_assembler),
1151 _local_coordinate_system, integration_order,
1152 process_config, _media);
1153 break;
1154 }
1155 }
1156 else
1157#endif
1158#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1159 if (type == "THERMO_RICHARDS_FLOW")
1160 {
1161 process =
1163 name, *_mesh_vec[0], std::move(jacobian_assembler),
1164 _process_variables, _parameters, integration_order,
1165 process_config, _media);
1166 }
1167 else
1168#endif
1169#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1170 if (type == "THERMO_RICHARDS_MECHANICS")
1171 {
1172 switch (_mesh_vec[0]->getDimension())
1173 {
1174 case 2:
1177 name, *_mesh_vec[0], std::move(jacobian_assembler),
1179 _local_coordinate_system, integration_order,
1180 process_config, _media);
1181 break;
1182 case 3:
1185 name, *_mesh_vec[0], std::move(jacobian_assembler),
1187 _local_coordinate_system, integration_order,
1188 process_config, _media);
1189 break;
1190 }
1191 }
1192 else
1193#endif
1194
1195#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1196 if (type == "TWOPHASE_FLOW_PP")
1197 {
1198 process =
1200 name, *_mesh_vec[0], std::move(jacobian_assembler),
1201 _process_variables, _parameters, integration_order,
1202 process_config, _media);
1203 }
1204 else
1205#endif
1206#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1207 if (type == "THERMAL_TWOPHASE_WITH_PP")
1208 {
1211 name, *_mesh_vec[0], std::move(jacobian_assembler),
1212 _process_variables, _parameters, integration_order,
1213 process_config, _media);
1214 }
1215 else
1216#endif
1217 {
1218 OGS_FATAL("Unknown process type: {:s}", type);
1219 }
1220
1221 if (ranges::contains(_processes, name,
1222 [](std::unique_ptr<ProcessLib::Process> const& p)
1223 { return p->name; }))
1224 {
1225 OGS_FATAL("The process name '{:s}' is not unique.", name);
1226 }
1227 _processes.push_back(std::move(process));
1228 }
1229}
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)
template std::unique_ptr< Process > createHMPhaseFieldProcess< 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)
template std::unique_ptr< Process > createHMPhaseFieldProcess< 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)
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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createHydroMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &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)
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 > 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 > 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 > 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 > createWellboreSimulatorProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &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::HMPhaseField::createHMPhaseFieldProcess< 2 >(), ProcessLib::HMPhaseField::createHMPhaseFieldProcess< 3 >(), 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::LIE::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SteadyStateDiffusion::createSteadyStateDiffusion(), ProcessLib::TH2M::createTH2MProcess< 2 >(), ProcessLib::TH2M::createTH2MProcess< 3 >(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 2 >(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 3 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 2 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 3 >(), ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 2 >(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 3 >(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::WellboreSimulator::createWellboreSimulatorProcess(), 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 462 of file ProjectData.cpp.

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

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

1233{
1234 DBUG("Reading time loop configuration.");
1235
1236 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1237 std::begin(_process_variables),
1238 std::end(_process_variables),
1239 [](auto const& process_variable)
1240 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1241
1243 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1244 compensate_non_equilibrium_initial_residuum);
1245
1246 if (!_time_loop)
1247 {
1248 OGS_FATAL("Initialization of time loop failed.");
1249 }
1250}
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: