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

371 : _mesh_vec(readMeshes(project_config, mesh_directory, project_directory)),
372 _named_rasters(readRasters(project_config, project_directory,
373 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
374 _mesh_vec[0]->getNodes().end())
375 .getMinMaxPoints()))
376{
377 // for debugging raster reading implementation
378 // writeRasters(_named_rasters, output_directory);
379 if (auto const python_script =
381 project_config.getConfigParameterOptional<std::string>("python_script"))
382 {
383 namespace py = pybind11;
384
385#ifdef OGS_EMBED_PYTHON_INTERPRETER
386 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
387#endif
388
389 // Append to python's module search path
390 auto py_path = py::module::import("sys").attr("path");
391 py_path.attr("append")(script_directory); // .prj or -s directory
392
393 auto const script_path =
394 BaseLib::joinPaths(script_directory, *python_script);
395
396 // Evaluate in scope of main module
397 py::object scope = py::module::import("__main__").attr("__dict__");
398 // add (global) variables
399 auto globals = py::dict(scope);
400 globals["ogs_prj_directory"] = project_directory;
401 globals["ogs_mesh_directory"] = mesh_directory;
402 globals["ogs_script_directory"] = script_directory;
403 try
404 {
405 py::eval_file(script_path, scope);
406 }
407 catch (py::error_already_set const& e)
408 {
409 OGS_FATAL("Error evaluating python script {}: {}", script_path,
410 e.what());
411 }
412 }
413
415 parseCurves(project_config.getConfigSubtreeOptional("curves"));
416
417 auto parameter_names_for_transformation =
419 parseParameters(project_config.getConfigSubtree("parameters"));
420
423 project_config.getConfigSubtreeOptional("local_coordinate_system"),
425
426 for (auto& parameter : _parameters)
427 {
428 if (std::find(begin(parameter_names_for_transformation),
429 end(parameter_names_for_transformation),
430 parameter->name) !=
431 end(parameter_names_for_transformation))
432 {
434 {
435 OGS_FATAL(
436 "The parameter '{:s}' is using the local coordinate system "
437 "but no local coordinate system was provided.",
438 parameter->name);
439 }
440 parameter->setCoordinateSystem(*_local_coordinate_system);
441 }
442
443 parameter->initialize(_parameters);
444 }
445
447 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
448
450 parseMedia(project_config.getConfigSubtreeOptional("media"));
451
453 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
454
455 auto chemical_solver_interface = parseChemicalSolverInterface(
457 project_config.getConfigSubtreeOptional("chemical_system"),
458 output_directory);
459
461 parseProcesses(project_config.getConfigSubtree("processes"),
462 project_directory, output_directory,
463 std::move(chemical_solver_interface));
464
466 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
467
469 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
470 output_directory);
471}
#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:34
std::vector< GeoLib::NamedRaster > readRasters(BaseLib::ConfigTree const &config, std::string const &raster_directory, GeoLib::MinMaxPoints const &min_max_points)

References BaseLib::ConfigTree::getConfigParameterOptional(), and OGS_FATAL.

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

1424{
1425 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1426}
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 598 of file ProjectData.cpp.

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

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

1401{
1402 if (!config)
1403 {
1404 return;
1405 }
1406
1407 DBUG("Reading curves configuration.");
1408
1410 for (auto conf : config->getConfigSubtreeList("curve"))
1411 {
1413 auto const name = conf.getConfigParameter<std::string>("name");
1415 _curves,
1416 name,
1419 "The curve name is not unique.");
1420 }
1421}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition Algorithm.h:100
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)

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

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

1354{
1355 DBUG("Reading linear solver configuration.");
1356
1358 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1359 {
1361 auto const name = conf.getConfigParameter<std::string>("name");
1362 auto const linear_solver_parser =
1364 auto const solver_options =
1365 linear_solver_parser.parseNameAndOptions("", &conf);
1366
1369 name,
1370 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1371 std::get<1>(solver_options)),
1372 "The linear solver name is not unique");
1373 }
1374}

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

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

549{
550 if (!media_config)
551 {
552 return;
553 }
554
555 DBUG("Reading media:");
556
557 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
558 {
559 ERR("A mesh is required to define medium materials.");
560 return;
561 }
562
563 for (auto const& medium_config :
565 media_config->getConfigSubtreeList("medium"))
566 {
567 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
568 &medium_config, this](int const id)
569 {
571 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
573 _curves);
574 };
575
576 auto const material_id_string =
578 medium_config.getConfigAttribute<std::string>("id", "0");
579
580 std::vector<int> const material_ids_of_this_medium =
581 MaterialLib::parseMaterialIdString(material_id_string,
583
584 for (auto const& id : material_ids_of_this_medium)
585 {
587 id, _media, material_ids_of_this_medium, create_medium);
588 }
589 }
590
591 if (_media.empty())
592 {
593 OGS_FATAL("No entity is found inside <media>.");
594 }
595}
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().

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

1377{
1378 DBUG("Reading non-linear solver configuration.");
1379
1381 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1382 {
1383 auto const ls_name =
1385 conf.getConfigParameter<std::string>("linear_solver");
1386 auto const& linear_solver = BaseLib::getOrError(
1387 _linear_solvers, ls_name,
1388 "A linear solver with the given name does not exist.");
1389
1391 auto const name = conf.getConfigParameter<std::string>("name");
1394 name,
1395 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1396 "The nonlinear solver name is not unique");
1397 }
1398}
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:114

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

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

507{
508 using namespace ProcessLib;
509
510 std::set<std::string> names;
511 std::vector<std::string> parameter_names_for_transformation;
512
513 DBUG("Reading parameters:");
514 for (auto parameter_config :
516 parameters_config.getConfigSubtreeList("parameter"))
517 {
518 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
520 if (!names.insert(p->name).second)
521 {
522 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
523 }
524
525 auto const use_local_coordinate_system =
527 parameter_config.getConfigParameterOptional<bool>(
528 "use_local_coordinate_system");
529 if (!!use_local_coordinate_system && *use_local_coordinate_system)
530 {
531 parameter_names_for_transformation.push_back(p->name);
532 }
533
534 _parameters.push_back(std::move(p));
535 }
536
537 _parameters.push_back(
540 _parameters.push_back(
543
544 return parameter_names_for_transformation;
545}
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:47
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:229
std::unique_ptr< ParameterBase > createParameter(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< GeoLib::NamedRaster > const &named_rasters, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves)
Definition Parameter.cpp:27
Single, constant value parameter.
static PROCESSLIB_EXPORT const std::string zero_parameter_name

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

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

670{
671 (void)project_directory; // to avoid compilation warning
672 (void)output_directory; // to avoid compilation warning
673
674 DBUG("Reading processes:");
676 for (auto process_config : processes_config.getConfigSubtreeList("process"))
677 {
678 auto const type =
680 process_config.peekConfigParameter<std::string>("type");
681
682 auto const name =
684 process_config.getConfigParameter<std::string>("name");
685
686 [[maybe_unused]] auto const integration_order =
688 process_config.getConfigParameter<int>("integration_order");
689
690 std::unique_ptr<ProcessLib::Process> process;
691
692 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
694 process_config.getConfigSubtreeOptional("jacobian_assembler"));
695
696#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
697 if (type == "STEADY_STATE_DIFFUSION")
698 {
699 // The existence check of the in the configuration referenced
700 // process variables is checked in the physical process.
701 // TODO at the moment we have only one mesh, later there can be
702 // several meshes. Then we have to assign the referenced mesh
703 // here.
704 process =
706 name, *_mesh_vec[0], std::move(jacobian_assembler),
707 _process_variables, _parameters, integration_order,
708 process_config, _mesh_vec, _media);
709 }
710 else
711#endif
712#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
713 if (type == "LIQUID_FLOW")
714 {
716 name, *_mesh_vec[0], std::move(jacobian_assembler),
717 _process_variables, _parameters, integration_order,
718 process_config, _mesh_vec, _media);
719 }
720 else
721#endif
722#ifdef OGS_BUILD_PROCESS_STOKESFLOW
723 if (type == "StokesFlow")
724 {
725 WARN(
726 "The StokesFlow process is deprecated and will be removed in "
727 "OGS-6.5.5.");
728 switch (_mesh_vec[0]->getDimension())
729 {
730 case 2:
731 process =
733 name, *_mesh_vec[0], std::move(jacobian_assembler),
734 _process_variables, _parameters, integration_order,
735 process_config, _media);
736 break;
737 default:
738 OGS_FATAL(
739 "StokesFlow process does not support given "
740 "dimension {:d}",
741 _mesh_vec[0]->getDimension());
742 }
743 }
744 else
745#endif
746#ifdef OGS_BUILD_PROCESS_TES
747 if (type == "TES")
748 {
749 WARN(
750 "The TES process is deprecated and will be removed in "
751 "OGS-6.5.5.");
753 name, *_mesh_vec[0], std::move(jacobian_assembler),
754 _process_variables, _parameters, integration_order,
755 process_config);
756 }
757 else
758#endif
759#ifdef OGS_BUILD_PROCESS_TH2M
760 if (type == "TH2M")
761 {
762 switch (_mesh_vec[0]->getDimension())
763 {
764 case 2:
766 name, *_mesh_vec[0], std::move(jacobian_assembler),
768 _local_coordinate_system, integration_order,
769 process_config, _media);
770 break;
771 case 3:
773 name, *_mesh_vec[0], std::move(jacobian_assembler),
775 _local_coordinate_system, integration_order,
776 process_config, _media);
777 break;
778 default:
779 OGS_FATAL("TH2M process does not support given dimension");
780 }
781 }
782 else
783#endif
784#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
785 if (type == "HEAT_CONDUCTION")
786 {
788 name, *_mesh_vec[0], std::move(jacobian_assembler),
789 _process_variables, _parameters, integration_order,
790 process_config, _media);
791 }
792 else
793#endif
794#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
795 if (type == "HEAT_TRANSPORT_BHE")
796 {
797 if (_mesh_vec[0]->getDimension() != 3)
798 {
799 OGS_FATAL(
800 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
801 "mesh! ");
802 }
803
804 process =
806 name, *_mesh_vec[0], std::move(jacobian_assembler),
807 _process_variables, _parameters, integration_order,
808 process_config, _curves, _media);
809 }
810 else
811#endif
812#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
813 if (type == "WELLBORE_SIMULATOR")
814 {
815 if (_mesh_vec[0]->getDimension() != 1)
816 {
817 OGS_FATAL(
818 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
819 "mesh!");
820 }
821
822 process =
824 name, *_mesh_vec[0], std::move(jacobian_assembler),
825 _process_variables, _parameters, integration_order,
826 process_config, _media);
827 }
828 else
829#endif
830#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
831 if (type == "HYDRO_MECHANICS")
832 {
833 if (
834 process_config.getConfigParameterOptional<int>("dimension"))
835 {
836 OGS_FATAL(
837 "The 'dimension' tag has been removed in the merge-request "
838 "!4766."
839 "The dimension is now taken from the main mesh and the tag "
840 "must be"
841 "removed. There is a python script in the merge-request "
842 "description"
843 "for automatic conversion.");
844 }
845 switch (_mesh_vec[0]->getDimension())
846 {
847 case 2:
848 process =
850 2>(name, *_mesh_vec[0],
851 std::move(jacobian_assembler),
853 _local_coordinate_system, integration_order,
854 process_config, _media);
855 break;
856 case 3:
857 process =
859 3>(name, *_mesh_vec[0],
860 std::move(jacobian_assembler),
862 _local_coordinate_system, integration_order,
863 process_config, _media);
864 break;
865 default:
866 OGS_FATAL(
867 "HYDRO_MECHANICS process does not support given "
868 "dimension");
869 }
870 }
871 else
872#endif
873#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
874 if (type == "LARGE_DEFORMATION")
875 {
876 switch (_mesh_vec[0]->getDimension())
877 {
878 case 2:
881 name, *_mesh_vec[0], std::move(jacobian_assembler),
883 _local_coordinate_system, integration_order,
884 process_config, _media);
885 break;
886 case 3:
889 name, *_mesh_vec[0], std::move(jacobian_assembler),
891 _local_coordinate_system, integration_order,
892 process_config, _media);
893 break;
894 default:
895 OGS_FATAL(
896 "LARGE_DEFORMATION process does not support given "
897 "dimension");
898 }
899 }
900 else
901#endif
902#ifdef OGS_BUILD_PROCESS_LIE_HM
903 if (type == "HYDRO_MECHANICS_WITH_LIE")
904 {
905 if (
906 process_config.getConfigParameterOptional<int>("dimension"))
907 {
908 OGS_FATAL(
909 "The 'dimension' tag has been removed in the merge-request "
910 "!4766."
911 "The dimension is now taken from the main mesh and the tag "
912 "must be"
913 "removed. There is a python script in the merge-request "
914 "description"
915 "for automatic conversion.");
916 }
917 switch (_mesh_vec[0]->getDimension())
918 {
919 case 2:
922 name, *_mesh_vec[0], std::move(jacobian_assembler),
924 _local_coordinate_system, integration_order,
925 process_config);
926 break;
927 case 3:
930 name, *_mesh_vec[0], std::move(jacobian_assembler),
932 _local_coordinate_system, integration_order,
933 process_config);
934 break;
935 default:
936 OGS_FATAL(
937 "HYDRO_MECHANICS_WITH_LIE process does not support "
938 "given dimension");
939 }
940 }
941 else
942#endif
943#ifdef OGS_BUILD_PROCESS_HT
944 if (type == "HT")
945 {
947 name, *_mesh_vec[0], std::move(jacobian_assembler),
948 _process_variables, _parameters, integration_order,
949 process_config, _mesh_vec, _media);
950 }
951 else
952#endif
953#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
954 if (type == "ComponentTransport")
955 {
956 process =
958 name, *_mesh_vec[0], std::move(jacobian_assembler),
959 _process_variables, _parameters, integration_order,
960 process_config, _mesh_vec, _media,
961 std::move(chemical_solver_interface));
962 }
963 else
964#endif
965#ifdef OGS_BUILD_PROCESS_PHASEFIELD
966 if (type == "PHASE_FIELD")
967 {
968 switch (_mesh_vec[0]->getDimension())
969 {
970 case 2:
971 process =
973 name, *_mesh_vec[0], std::move(jacobian_assembler),
975 _local_coordinate_system, integration_order,
976 process_config);
977 break;
978 case 3:
979 process =
981 name, *_mesh_vec[0], std::move(jacobian_assembler),
983 _local_coordinate_system, integration_order,
984 process_config);
985 break;
986 }
987 }
988 else
989#endif
990#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
991 if (type == "RichardsComponentTransport")
992 {
995 name, *_mesh_vec[0], std::move(jacobian_assembler),
996 _process_variables, _parameters, integration_order,
997 process_config, _media);
998 }
999 else
1000#endif
1001#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1002 if (type == "SMALL_DEFORMATION")
1003 {
1004 switch (_mesh_vec[0]->getDimension())
1005 {
1006 case 2:
1009 name, *_mesh_vec[0], std::move(jacobian_assembler),
1011 _local_coordinate_system, integration_order,
1012 process_config, _media);
1013 break;
1014 case 3:
1017 name, *_mesh_vec[0], std::move(jacobian_assembler),
1019 _local_coordinate_system, integration_order,
1020 process_config, _media);
1021 break;
1022 default:
1023 OGS_FATAL(
1024 "SMALL_DEFORMATION process does not support given "
1025 "dimension");
1026 }
1027 }
1028 else
1029#endif
1030#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
1031 if (type == "SMALL_DEFORMATION_NONLOCAL")
1032 {
1033 WARN(
1034 "The SMALL_DEFORMATION_NONLOCAL process is deprecated and will "
1035 "be removed in OGS-6.5.5.");
1036 switch (_mesh_vec[0]->getDimension())
1037 {
1038 case 2:
1041 name, *_mesh_vec[0], std::move(jacobian_assembler),
1043 _local_coordinate_system, integration_order,
1044 process_config);
1045 break;
1046 case 3:
1049 name, *_mesh_vec[0], std::move(jacobian_assembler),
1051 _local_coordinate_system, integration_order,
1052 process_config);
1053 break;
1054 default:
1055 OGS_FATAL(
1056 "SMALL_DEFORMATION_NONLOCAL process does not support "
1057 "given dimension {:d}",
1058 _mesh_vec[0]->getDimension());
1059 }
1060 }
1061 else
1062#endif
1063#ifdef OGS_BUILD_PROCESS_LIE_M
1064 if (type == "SMALL_DEFORMATION_WITH_LIE")
1065 {
1066 if (
1067 process_config.getConfigParameterOptional<int>("dimension"))
1068 {
1069 OGS_FATAL(
1070 "The 'dimension' tag has been removed in the merge-request "
1071 "!4766."
1072 "The dimension is now taken from the main mesh and the tag "
1073 "must be"
1074 "removed. There is a python script in the merge-request "
1075 "description"
1076 "for automatic conversion.");
1077 }
1078 switch (_mesh_vec[0]->getDimension())
1079 {
1080 case 2:
1083 name, *_mesh_vec[0], std::move(jacobian_assembler),
1085 _local_coordinate_system, integration_order,
1086 process_config);
1087 break;
1088 case 3:
1091 name, *_mesh_vec[0], std::move(jacobian_assembler),
1093 _local_coordinate_system, integration_order,
1094 process_config);
1095 break;
1096 default:
1097 OGS_FATAL(
1098 "SMALL_DEFORMATION_WITH_LIE process does not support "
1099 "given dimension");
1100 }
1101 }
1102 else
1103#endif
1104#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1105 if (type == "THERMO_HYDRO_MECHANICS")
1106 {
1107 if (
1108 process_config.getConfigParameterOptional<int>("dimension"))
1109 {
1110 OGS_FATAL(
1111 "The 'dimension' tag has been removed in the merge-request "
1112 "!4766."
1113 "The dimension is now taken from the main mesh and the tag "
1114 "must be"
1115 "removed. There is a python script in the merge-request "
1116 "description"
1117 "for automatic conversion.");
1118 }
1119 switch (_mesh_vec[0]->getDimension())
1120 {
1121 case 2:
1124 name, *_mesh_vec[0], std::move(jacobian_assembler),
1126 _local_coordinate_system, integration_order,
1127 process_config, _media);
1128 break;
1129 case 3:
1132 name, *_mesh_vec[0], std::move(jacobian_assembler),
1134 _local_coordinate_system, integration_order,
1135 process_config, _media);
1136 break;
1137 default:
1138 OGS_FATAL(
1139 "THERMO_HYDRO_MECHANICS process does not support given "
1140 "dimension");
1141 }
1142 }
1143 else
1144#endif
1145#ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
1146 if (type == "THERMO_MECHANICAL_PHASE_FIELD")
1147 {
1148 WARN(
1149 "The THERMO_MECHANICAL_PHASE_FIELD process is deprecated and "
1150 "will be removed in OGS-6.5.5.");
1151 switch (_mesh_vec[0]->getDimension())
1152 {
1153 case 2:
1156 name, *_mesh_vec[0], std::move(jacobian_assembler),
1158 _local_coordinate_system, integration_order,
1159 process_config);
1160 break;
1161 case 3:
1164 name, *_mesh_vec[0], std::move(jacobian_assembler),
1166 _local_coordinate_system, integration_order,
1167 process_config);
1168 break;
1169 }
1170 }
1171 else
1172#endif
1173#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1174 if (type == "THERMO_MECHANICS")
1175 {
1176 switch (_mesh_vec[0]->getDimension())
1177 {
1178 case 2:
1181 name, *_mesh_vec[0], std::move(jacobian_assembler),
1183 _local_coordinate_system, integration_order,
1184 process_config, _media);
1185 break;
1186 case 3:
1189 name, *_mesh_vec[0], std::move(jacobian_assembler),
1191 _local_coordinate_system, integration_order,
1192 process_config, _media);
1193 break;
1194 }
1195 }
1196 else
1197#endif
1198#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1199 if (type == "RICHARDS_FLOW")
1200 {
1202 name, *_mesh_vec[0], std::move(jacobian_assembler),
1203 _process_variables, _parameters, integration_order,
1204 process_config, _media);
1205 }
1206 else
1207#endif
1208#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1209 if (type == "RICHARDS_MECHANICS")
1210 {
1211 if (
1212 process_config.getConfigParameterOptional<int>("dimension"))
1213 {
1214 OGS_FATAL(
1215 "The 'dimension' tag has been removed in the merge-request "
1216 "!4766."
1217 "The dimension is now taken from the main mesh and the tag "
1218 "must be"
1219 "removed. There is a python script in the merge-request "
1220 "description"
1221 "for automatic conversion.");
1222 }
1223 switch (_mesh_vec[0]->getDimension())
1224 {
1225 case 2:
1228 name, *_mesh_vec[0], std::move(jacobian_assembler),
1230 _local_coordinate_system, integration_order,
1231 process_config, _media);
1232 break;
1233 case 3:
1236 name, *_mesh_vec[0], std::move(jacobian_assembler),
1238 _local_coordinate_system, integration_order,
1239 process_config, _media);
1240 break;
1241 }
1242 }
1243 else
1244#endif
1245#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1246 if (type == "THERMO_RICHARDS_FLOW")
1247 {
1248 process =
1250 name, *_mesh_vec[0], std::move(jacobian_assembler),
1251 _process_variables, _parameters, integration_order,
1252 process_config, _media);
1253 }
1254 else
1255#endif
1256#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1257 if (type == "THERMO_RICHARDS_MECHANICS")
1258 {
1259 switch (_mesh_vec[0]->getDimension())
1260 {
1261 case 2:
1264 name, *_mesh_vec[0], std::move(jacobian_assembler),
1266 _local_coordinate_system, integration_order,
1267 process_config, _media);
1268 break;
1269 case 3:
1272 name, *_mesh_vec[0], std::move(jacobian_assembler),
1274 _local_coordinate_system, integration_order,
1275 process_config, _media);
1276 break;
1277 }
1278 }
1279 else
1280#endif
1281
1282#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1283 if (type == "TWOPHASE_FLOW_PP")
1284 {
1285 process =
1287 name, *_mesh_vec[0], std::move(jacobian_assembler),
1288 _process_variables, _parameters, integration_order,
1289 process_config, _media);
1290 }
1291 else
1292#endif
1293#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1294 if (type == "TWOPHASE_FLOW_PRHO")
1295 {
1296 WARN(
1297 "The TWOPHASE_FLOW_PRHO process is deprecated and will be "
1298 "removed in OGS-6.5.5.");
1301 name, *_mesh_vec[0], std::move(jacobian_assembler),
1302 _process_variables, _parameters, integration_order,
1303 process_config, _media);
1304 }
1305 else
1306#endif
1307#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1308 if (type == "THERMAL_TWOPHASE_WITH_PP")
1309 {
1312 name, *_mesh_vec[0], std::move(jacobian_assembler),
1313 _process_variables, _parameters, integration_order,
1314 process_config, _media);
1315 }
1316 else
1317#endif
1318 {
1319 OGS_FATAL("Unknown process type: {:s}", type);
1320 }
1321
1322 if (ranges::contains(_processes, name,
1323 [](std::unique_ptr<ProcessLib::Process> const& p)
1324 { return p->name; }))
1325 {
1326 OGS_FATAL("The process name '{:s}' is not unique.", name);
1327 }
1328 _processes.push_back(std::move(process));
1329 }
1330}
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
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< 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::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(), ProcessLib::WellboreSimulator::createWellboreSimulatorProcess(), DBUG(), BaseLib::ConfigTree::getConfigSubtreeList(), OGS_FATAL, and WARN().

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

475{
476 DBUG("Parse process variables:");
477
478 std::set<std::string> names;
479
480 for (auto var_config
482 : process_variables_config.getConfigSubtreeList("process_variable"))
483 {
484 // Either the mesh name is given, or the first mesh's name will be
485 // taken. Taking the first mesh's value is deprecated.
486 auto const mesh_name =
488 var_config.getConfigParameter<std::string>("mesh",
489 _mesh_vec[0]->getName());
490
491 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
492
493 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
495 if (!names.insert(pv.getName()).second)
496 {
497 OGS_FATAL("A process variable with name `{:s}' already exists.",
498 pv.getName());
499 }
500
501 _process_variables.push_back(std::move(pv));
502 }
503}

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

◆ parseTimeLoop()

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

Parses the time loop configuration.

Definition at line 1332 of file ProjectData.cpp.

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

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 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 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: