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 45 of file ProjectData.h.

#include <ProjectData.h>

Public Member Functions

 ProjectData ()
 ProjectData (BaseLib::ConfigTree const &project_config, 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::vector< std::string > getMeshNames () 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 &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.

Referenced by ProjectData().

◆ ProjectData() [2/3]

ProjectData::ProjectData ( BaseLib::ConfigTree const & project_config,
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.
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 522 of file ProjectData.cpp.

526 : _mesh_vec(readMeshes(project_config, mesh_directory)),
527 _named_rasters(readRasters(project_config,
528 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
529 _mesh_vec[0]->getNodes().end())
530 .getMinMaxPoints()))
531{
532 // for debugging raster reading implementation
533 // writeRasters(_named_rasters, output_directory);
534 if (auto const python_script =
536 project_config.getConfigParameterOptional<std::string>("python_script"))
537 {
538 namespace py = pybind11;
539
540 // Append to python's module search path
541 auto py_path = py::module::import("sys").attr("path");
542 py_path.attr("append")(script_directory); // .prj or -s directory
543
544 auto const script_path =
545 BaseLib::joinPaths(script_directory, *python_script);
546
547 // Evaluate in scope of main module
548 py::object scope = py::module::import("__main__").attr("__dict__");
549 // add (global) variables
550 auto globals = py::dict(scope);
551 globals["ogs_prj_directory"] =
552 project_config.projectDirectory().string();
553 globals["ogs_mesh_directory"] = mesh_directory;
554 globals["ogs_script_directory"] = script_directory;
555 try
556 {
557 py::eval_file(script_path, scope);
558 }
559 catch (py::error_already_set const& e)
560 {
561 OGS_FATAL("Error evaluating python script {}: {}", script_path,
562 e.what());
563 }
564 }
565
567 parseCurves(project_config.getConfigSubtreeOptional("curves"));
568
569 auto parameter_names_for_transformation =
571 parseParameters(project_config.getConfigSubtree("parameters"));
572
575 project_config.getConfigSubtreeOptional("local_coordinate_system"),
577
578 for (auto& parameter : _parameters)
579 {
580 if (std::find(begin(parameter_names_for_transformation),
581 end(parameter_names_for_transformation),
582 parameter->name) !=
583 end(parameter_names_for_transformation))
584 {
586 {
587 OGS_FATAL(
588 "The parameter '{:s}' is using the local coordinate system "
589 "but no local coordinate system was provided.",
590 parameter->name);
591 }
592 parameter->setCoordinateSystem(*_local_coordinate_system);
593 }
594
595 parameter->initialize(_parameters);
596 }
597 std::vector<MeshToolsLib::InitialConditionDataSet> data_initial_conditions;
598 parseOverwriteMeshData(project_config, data_initial_conditions, _mesh_vec,
601
603 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
604
606 parseMedia(project_config.getConfigSubtreeOptional("media"));
607
609 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
610
611 auto chemical_solver_interface = parseChemicalSolverInterface(
613 project_config.getConfigSubtreeOptional("chemical_system"),
614 output_directory);
615
617 parseProcesses(project_config.getConfigSubtree("processes"),
618 output_directory,
619 std::move(chemical_solver_interface));
620
622 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
623
625 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
626 output_directory);
627}
#define OGS_FATAL(...)
Definition Error.h:10
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)
void parseOverwriteMeshData(BaseLib::ConfigTree const &project_config, std::vector< MeshToolsLib::InitialConditionDataSet > &data_initial_conditions, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
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)
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
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)
std::string joinPaths(std::string const &pathA, std::string const &pathB)
void overwriteMeshFieldDataByMaterialIDs(std::vector< InitialConditionDataSet > &data_initial_conditions)
std::optional< ParameterLib::CoordinateSystem > createCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
std::vector< GeoLib::NamedRaster > readRasters(BaseLib::ConfigTree const &config, GeoLib::MinMaxPoints const &min_max_points)

References _mesh_vec, _named_rasters, BaseLib::ConfigTree::getConfigParameterOptional(), getNodes(), OGS_FATAL, and readMeshes().

◆ ProjectData() [3/3]

ProjectData::ProjectData ( ProjectData & )
delete

References ProjectData().

Member Function Documentation

◆ getMedia()

std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const & ProjectData::getMedia ( ) const
inline

Definition at line 83 of file ProjectData.h.

84 {
85 return _media;
86 }
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 1487 of file ProjectData.cpp.

1488{
1489 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1490}
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
Definition Mesh.cpp:356

References _mesh_vec, and MeshLib::findMeshByName().

◆ getMeshNames()

std::vector< std::string > ProjectData::getMeshNames ( ) const

Definition at line 1492 of file ProjectData.cpp.

1493{
1494 return _mesh_vec | MeshLib::views::names | ranges::to<std::vector>;
1495}
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:227

References _mesh_vec, and MeshLib::views::names.

◆ getProcesses()

std::vector< std::unique_ptr< ProcessLib::Process > > const & ProjectData::getProcesses ( ) const
inline

Provides read access to the process container.

Definition at line 71 of file ProjectData.h.

73 {
74 return _processes;
75 }
std::vector< std::unique_ptr< ProcessLib::Process > > _processes

References _processes.

◆ getTimeLoop()

ProcessLib::TimeLoop & ProjectData::getTimeLoop ( )
inline

Definition at line 77 of file ProjectData.h.

77{ 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 754 of file ProjectData.cpp.

757{
758 if (!config)
759 {
760 return nullptr;
761 }
762
763 std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
764 chemical_solver_interface;
765#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
766 INFO(
767 "Ready for initializing interface to a chemical solver for water "
768 "chemistry calculation.");
769
770 auto const chemical_solver =
772 config->getConfigAttribute<std::string>("chemical_solver");
773
774 if (boost::iequals(chemical_solver, "Phreeqc"))
775 {
776 INFO(
777 "Configuring phreeqc interface for water chemistry calculation "
778 "using file-based approach.");
779
780 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
782 *config, output_directory);
783 }
784 else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
785 {
786 OGS_FATAL(
787 "The chemical solver option of PhreeqcKernel is not accessible for "
788 "the time being. Please set 'Phreeqc'' as the chemical solver for "
789 "reactive transport modeling.");
790 }
791 else if (boost::iequals(chemical_solver, "SelfContained"))
792 {
793 INFO(
794 "Use self-contained chemical solver for water chemistry "
795 "calculation.");
796
797 chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
799 _mesh_vec, _linear_solvers, *config, output_directory);
800 }
801 else
802 {
803 OGS_FATAL(
804 "Unknown chemical solver. Please specify either Phreeqc or "
805 "PhreeqcKernel as the solver for water chemistry calculation "
806 "instead.");
807 }
808#else
809 (void)output_directory;
810
811 OGS_FATAL(
812 "Found the type of the process to be solved is not component transport "
813 "process. Please specify the process type to ComponentTransport. At "
814 "the present, water chemistry calculation is only available for "
815 "component transport process.");
816#endif
817 return chemical_solver_interface;
818}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:28
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 1464 of file ProjectData.cpp.

1465{
1466 if (!config)
1467 {
1468 return;
1469 }
1470
1471 DBUG("Reading curves configuration.");
1472
1474 for (auto conf : config->getConfigSubtreeList("curve"))
1475 {
1477 auto const name = conf.getConfigParameter<std::string>("name");
1479 _curves,
1480 name,
1482 MathLib::PiecewiseLinearInterpolation>(conf),
1483 "The curve name is not unique.");
1484 }
1485}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
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:98
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 1417 of file ProjectData.cpp.

1418{
1419 DBUG("Reading linear solver configuration.");
1420
1422 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1423 {
1425 auto const name = conf.getConfigParameter<std::string>("name");
1426 auto const linear_solver_parser =
1427 MathLib::LinearSolverOptionsParser<GlobalLinearSolver>{};
1428 auto const solver_options =
1429 linear_solver_parser.parseNameAndOptions("", &conf);
1430
1433 name,
1434 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1435 std::get<1>(solver_options)),
1436 "The linear solver name is not unique");
1437 }
1438}

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

705{
706 if (!media_config)
707 {
708 return;
709 }
710
711 DBUG("Reading media:");
712
713 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
714 {
715 ERR("A mesh is required to define medium materials.");
716 return;
717 }
718
719 for (auto const& medium_config :
721 media_config->getConfigSubtreeList("medium"))
722 {
723 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
724 &medium_config, this](int const id)
725 {
727 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
729 _curves);
730 };
731
732 auto const material_id_string =
734 medium_config.getConfigAttribute<std::string>("id", "0");
735
736 std::vector<int> const material_ids_of_this_medium =
737 MaterialLib::parseMaterialIdString(material_id_string,
739
740 for (auto const& id : material_ids_of_this_medium)
741 {
743 id, _media, material_ids_of_this_medium, create_medium);
744 }
745 }
746
747 if (_media.empty())
748 {
749 OGS_FATAL("No entity is found inside <media>.");
750 }
751}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
std::vector< int > parseMaterialIdString(std::string const &material_id_string, MeshLib::PropertyVector< int > const *const material_ids, char const separator, bool const validate)
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::unique_ptr< Medium > createMedium(int const material_id, int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > &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:260
constexpr unsigned getDimension(MeshElemType t)
Returns the dimension of the given MeshElemType.
Definition MeshEnums.h:122

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

1441{
1442 DBUG("Reading non-linear solver configuration.");
1443
1445 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1446 {
1447 auto const ls_name =
1449 conf.getConfigParameter<std::string>("linear_solver");
1450 auto const& linear_solver = BaseLib::getOrError(
1451 _linear_solvers, ls_name,
1452 "A linear solver with the given name does not exist.");
1453
1455 auto const name = conf.getConfigParameter<std::string>("name");
1458 name,
1459 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1460 "The nonlinear solver name is not unique");
1461 }
1462}
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
OGS_NO_DANGLING Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition Algorithm.h:112
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)

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

663{
664 using namespace ProcessLib;
665
666 std::set<std::string> names;
667 std::vector<std::string> parameter_names_for_transformation;
668
669 DBUG("Reading parameters:");
670 for (auto parameter_config :
672 parameters_config.getConfigSubtreeList("parameter"))
673 {
674 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
676 if (!names.insert(p->name).second)
677 {
678 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
679 }
680
681 auto const use_local_coordinate_system =
683 parameter_config.getConfigParameterOptional<bool>(
684 "use_local_coordinate_system");
685 if (!!use_local_coordinate_system && *use_local_coordinate_system)
686 {
687 parameter_names_for_transformation.push_back(p->name);
688 }
689
690 _parameters.push_back(std::move(p));
691 }
692
693 _parameters.push_back(
694 std::make_unique<ParameterLib::ConstantParameter<double>>(
696 _parameters.push_back(
697 std::make_unique<ParameterLib::ConstantParameter<double>>(
699
700 return parameter_names_for_transformation;
701}
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition Process.h:40
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)
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 & 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 820 of file ProjectData.cpp.

825{
826 (void)output_directory; // to avoid compilation warning
827
828 DBUG("Reading processes:");
830 for (auto process_config : processes_config.getConfigSubtreeList("process"))
831 {
832 auto const type =
834 process_config.peekConfigParameter<std::string>("type");
835
836 auto const name =
838 process_config.getConfigParameter<std::string>("name");
839
840 [[maybe_unused]] auto const integration_order =
842 process_config.getConfigParameter<int>("integration_order");
843
844 std::unique_ptr<ProcessLib::Process> process;
845
846 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
848 process_config.getConfigSubtreeOptional("jacobian_assembler"));
849
850#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
851 if (type == "STEADY_STATE_DIFFUSION")
852 {
853 // The existence check of the in the configuration referenced
854 // process variables is checked in the physical process.
855 // TODO at the moment we have only one mesh, later there can be
856 // several meshes. Then we have to assign the referenced mesh
857 // here.
858 process =
860 name, *_mesh_vec[0], std::move(jacobian_assembler),
861 _process_variables, _parameters, integration_order,
862 process_config, _mesh_vec, _media);
863 }
864 else
865#endif
866#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
867 if (type == "LIQUID_FLOW")
868 {
870 name, *_mesh_vec[0], std::move(jacobian_assembler),
871 _process_variables, _parameters, integration_order,
872 process_config, _mesh_vec, _media);
873 }
874 else
875#endif
876#ifdef OGS_BUILD_PROCESS_TH2M
877 if (type == "TH2M")
878 {
879 switch (_mesh_vec[0]->getDimension())
880 {
881 case 2:
883 name, *_mesh_vec[0], std::move(jacobian_assembler),
885 _local_coordinate_system, integration_order,
886 process_config, _media);
887 break;
888 case 3:
890 name, *_mesh_vec[0], std::move(jacobian_assembler),
892 _local_coordinate_system, integration_order,
893 process_config, _media);
894 break;
895 default:
896 OGS_FATAL("TH2M process does not support given dimension");
897 }
898 }
899 else
900#endif
901#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
902 if (type == "HEAT_CONDUCTION")
903 {
905 name, *_mesh_vec[0], std::move(jacobian_assembler),
906 _process_variables, _parameters, integration_order,
907 process_config, _media);
908 }
909 else
910#endif
911#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
912 if (type == "HEAT_TRANSPORT_BHE")
913 {
914 if (_mesh_vec[0]->getDimension() != 3)
915 {
916 OGS_FATAL(
917 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
918 "mesh! ");
919 }
920
921 process =
923 name, *_mesh_vec[0], std::move(jacobian_assembler),
924 _process_variables, _parameters, integration_order,
925 process_config, _curves, _media);
926 }
927 else
928#endif
929#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
930 if (type == "WELLBORE_SIMULATOR")
931 {
932 if (_mesh_vec[0]->getDimension() != 1)
933 {
934 OGS_FATAL(
935 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
936 "mesh!");
937 }
938
939 process =
941 name, *_mesh_vec[0], std::move(jacobian_assembler),
942 _process_variables, _parameters, integration_order,
943 process_config, _media);
944 }
945 else
946#endif
947#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
948 if (type == "HYDRO_MECHANICS")
949 {
950 if (
951 process_config.getConfigParameterOptional<int>("dimension"))
952 {
953 OGS_FATAL(
954 "The 'dimension' tag has been removed in the merge-request "
955 "!4766. The dimension is now taken from the main mesh and "
956 "the tag must be removed. There is a python script in the "
957 "merge-request description for automatic conversion.");
958 }
959 switch (_mesh_vec[0]->getDimension())
960 {
961 case 2:
962 process =
964 2>(name, *_mesh_vec[0],
965 std::move(jacobian_assembler),
967 _local_coordinate_system, integration_order,
968 process_config, _media);
969 break;
970 case 3:
971 process =
973 3>(name, *_mesh_vec[0],
974 std::move(jacobian_assembler),
976 _local_coordinate_system, integration_order,
977 process_config, _media);
978 break;
979 default:
980 OGS_FATAL(
981 "HYDRO_MECHANICS process does not support given "
982 "dimension");
983 }
984 }
985 else
986#endif
987#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
988 if (type == "LARGE_DEFORMATION")
989 {
990 switch (_mesh_vec[0]->getDimension())
991 {
992 case 2:
995 name, *_mesh_vec[0], std::move(jacobian_assembler),
997 _local_coordinate_system, integration_order,
998 process_config, _media);
999 break;
1000 case 3:
1003 name, *_mesh_vec[0], std::move(jacobian_assembler),
1005 _local_coordinate_system, integration_order,
1006 process_config, _media);
1007 break;
1008 default:
1009 OGS_FATAL(
1010 "LARGE_DEFORMATION process does not support given "
1011 "dimension");
1012 }
1013 }
1014 else
1015#endif
1016#ifdef OGS_BUILD_PROCESS_LIE_HM
1017 if (type == "HYDRO_MECHANICS_WITH_LIE")
1018 {
1019 if (
1020 process_config.getConfigParameterOptional<int>("dimension"))
1021 {
1022 OGS_FATAL(
1023 "The 'dimension' tag has been removed in the merge-request "
1024 "!4766."
1025 "The dimension is now taken from the main mesh and the tag "
1026 "must be"
1027 "removed. There is a python script in the merge-request "
1028 "description"
1029 "for automatic conversion.");
1030 }
1031 switch (_mesh_vec[0]->getDimension())
1032 {
1033 case 2:
1036 name, *_mesh_vec[0], std::move(jacobian_assembler),
1038 _local_coordinate_system, integration_order,
1039 process_config, _media);
1040 break;
1041 case 3:
1044 name, *_mesh_vec[0], std::move(jacobian_assembler),
1046 _local_coordinate_system, integration_order,
1047 process_config, _media);
1048 break;
1049 default:
1050 OGS_FATAL(
1051 "HYDRO_MECHANICS_WITH_LIE process does not support "
1052 "given dimension");
1053 }
1054 }
1055 else
1056#endif
1057#ifdef OGS_BUILD_PROCESS_HT
1058 if (type == "HT")
1059 {
1061 name, *_mesh_vec[0], std::move(jacobian_assembler),
1062 _process_variables, _parameters, integration_order,
1063 process_config, _mesh_vec, _media);
1064 }
1065 else
1066#endif
1067#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
1068 if (type == "ComponentTransport")
1069 {
1070 process =
1072 name, *_mesh_vec[0], std::move(jacobian_assembler),
1073 _process_variables, _parameters, integration_order,
1074 process_config, _mesh_vec, _media,
1075 std::move(chemical_solver_interface));
1076 }
1077 else
1078#endif
1079#ifdef OGS_BUILD_PROCESS_PHASEFIELD
1080 if (type == "PHASE_FIELD")
1081 {
1082 switch (_mesh_vec[0]->getDimension())
1083 {
1084 case 2:
1085 process =
1087 name, *_mesh_vec[0], std::move(jacobian_assembler),
1089 _local_coordinate_system, integration_order,
1090 process_config);
1091 break;
1092 case 3:
1093 process =
1095 name, *_mesh_vec[0], std::move(jacobian_assembler),
1097 _local_coordinate_system, integration_order,
1098 process_config);
1099 break;
1100 }
1101 }
1102 else
1103#endif
1104#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
1105 if (type == "HM_PHASE_FIELD")
1106 {
1107 switch (_mesh_vec[0]->getDimension())
1108 {
1109 case 2:
1110 process =
1112 name, *_mesh_vec[0], std::move(jacobian_assembler),
1114 _local_coordinate_system, integration_order,
1115 process_config, _media);
1116 break;
1117 case 3:
1118 process =
1120 name, *_mesh_vec[0], std::move(jacobian_assembler),
1122 _local_coordinate_system, integration_order,
1123 process_config, _media);
1124 break;
1125 }
1126 }
1127 else
1128#endif
1129#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
1130 if (type == "RichardsComponentTransport")
1131 {
1134 name, *_mesh_vec[0], std::move(jacobian_assembler),
1135 _process_variables, _parameters, integration_order,
1136 process_config, _media);
1137 }
1138 else
1139#endif
1140#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
1141 if (type == "SMALL_DEFORMATION")
1142 {
1143 switch (_mesh_vec[0]->getDimension())
1144 {
1145 case 2:
1148 name, *_mesh_vec[0], std::move(jacobian_assembler),
1150 _local_coordinate_system, integration_order,
1151 process_config, _media);
1152 break;
1153 case 3:
1156 name, *_mesh_vec[0], std::move(jacobian_assembler),
1158 _local_coordinate_system, integration_order,
1159 process_config, _media);
1160 break;
1161 default:
1162 OGS_FATAL(
1163 "SMALL_DEFORMATION process does not support given "
1164 "dimension");
1165 }
1166 }
1167 else
1168#endif
1169#ifdef OGS_BUILD_PROCESS_LIE_M
1170 if (type == "SMALL_DEFORMATION_WITH_LIE")
1171 {
1172 if (
1173 process_config.getConfigParameterOptional<int>("dimension"))
1174 {
1175 OGS_FATAL(
1176 "The 'dimension' tag has been removed in the merge-request "
1177 "!4766."
1178 "The dimension is now taken from the main mesh and the tag "
1179 "must be"
1180 "removed. There is a python script in the merge-request "
1181 "description"
1182 "for automatic conversion.");
1183 }
1184 switch (_mesh_vec[0]->getDimension())
1185 {
1186 case 2:
1189 name, *_mesh_vec[0], std::move(jacobian_assembler),
1191 _local_coordinate_system, integration_order,
1192 process_config);
1193 break;
1194 case 3:
1197 name, *_mesh_vec[0], std::move(jacobian_assembler),
1199 _local_coordinate_system, integration_order,
1200 process_config);
1201 break;
1202 default:
1203 OGS_FATAL(
1204 "SMALL_DEFORMATION_WITH_LIE process does not support "
1205 "given dimension");
1206 }
1207 }
1208 else
1209#endif
1210#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1211 if (type == "THERMO_HYDRO_MECHANICS")
1212 {
1213 if (
1214 process_config.getConfigParameterOptional<int>("dimension"))
1215 {
1216 OGS_FATAL(
1217 "The 'dimension' tag has been removed in the merge-request "
1218 "!4766."
1219 "The dimension is now taken from the main mesh and the tag "
1220 "must be"
1221 "removed. There is a python script in the merge-request "
1222 "description"
1223 "for automatic conversion.");
1224 }
1225 switch (_mesh_vec[0]->getDimension())
1226 {
1227 case 2:
1230 name, *_mesh_vec[0], std::move(jacobian_assembler),
1232 _local_coordinate_system, integration_order,
1233 process_config, _media);
1234 break;
1235 case 3:
1238 name, *_mesh_vec[0], std::move(jacobian_assembler),
1240 _local_coordinate_system, integration_order,
1241 process_config, _media);
1242 break;
1243 default:
1244 OGS_FATAL(
1245 "THERMO_HYDRO_MECHANICS process does not support given "
1246 "dimension");
1247 }
1248 }
1249 else
1250#endif
1251#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1252 if (type == "THERMO_MECHANICS")
1253 {
1254 switch (_mesh_vec[0]->getDimension())
1255 {
1256 case 2:
1259 name, *_mesh_vec[0], std::move(jacobian_assembler),
1261 _local_coordinate_system, integration_order,
1262 process_config, _media);
1263 break;
1264 case 3:
1267 name, *_mesh_vec[0], std::move(jacobian_assembler),
1269 _local_coordinate_system, integration_order,
1270 process_config, _media);
1271 break;
1272 }
1273 }
1274 else
1275#endif
1276#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1277 if (type == "RICHARDS_FLOW")
1278 {
1280 name, *_mesh_vec[0], std::move(jacobian_assembler),
1281 _process_variables, _parameters, integration_order,
1282 process_config, _media);
1283 }
1284 else
1285#endif
1286#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1287 if (type == "RICHARDS_MECHANICS")
1288 {
1289 if (
1290 process_config.getConfigParameterOptional<int>("dimension"))
1291 {
1292 OGS_FATAL(
1293 "The 'dimension' tag has been removed in the merge-request "
1294 "!4766."
1295 "The dimension is now taken from the main mesh and the tag "
1296 "must be"
1297 "removed. There is a python script in the merge-request "
1298 "description"
1299 "for automatic conversion.");
1300 }
1301 switch (_mesh_vec[0]->getDimension())
1302 {
1303 case 2:
1306 name, *_mesh_vec[0], std::move(jacobian_assembler),
1308 _local_coordinate_system, integration_order,
1309 process_config, _media);
1310 break;
1311 case 3:
1314 name, *_mesh_vec[0], std::move(jacobian_assembler),
1316 _local_coordinate_system, integration_order,
1317 process_config, _media);
1318 break;
1319 }
1320 }
1321 else
1322#endif
1323#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1324 if (type == "THERMO_RICHARDS_FLOW")
1325 {
1326 process =
1328 name, *_mesh_vec[0], std::move(jacobian_assembler),
1329 _process_variables, _parameters, integration_order,
1330 process_config, _media);
1331 }
1332 else
1333#endif
1334#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1335 if (type == "THERMO_RICHARDS_MECHANICS")
1336 {
1337 switch (_mesh_vec[0]->getDimension())
1338 {
1339 case 2:
1342 name, *_mesh_vec[0], std::move(jacobian_assembler),
1344 _local_coordinate_system, integration_order,
1345 process_config, _media);
1346 break;
1347 case 3:
1350 name, *_mesh_vec[0], std::move(jacobian_assembler),
1352 _local_coordinate_system, integration_order,
1353 process_config, _media);
1354 break;
1355 }
1356 }
1357 else
1358#endif
1359
1360#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1361 if (type == "TWOPHASE_FLOW_PP")
1362 {
1363 process =
1365 name, *_mesh_vec[0], std::move(jacobian_assembler),
1366 _process_variables, _parameters, integration_order,
1367 process_config, _media);
1368 }
1369 else
1370#endif
1371#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1372 if (type == "THERMAL_TWOPHASE_WITH_PP")
1373 {
1376 name, *_mesh_vec[0], std::move(jacobian_assembler),
1377 _process_variables, _parameters, integration_order,
1378 process_config, _media);
1379 }
1380 else
1381#endif
1382 {
1383 OGS_FATAL("Unknown process type: {:s}", type);
1384 }
1385
1386 if (ranges::contains(_processes, name,
1387 [](std::unique_ptr<ProcessLib::Process> const& p)
1388 { return p->name; }))
1389 {
1390 OGS_FATAL("The process name '{:s}' is not unique.", name);
1391 }
1392 _processes.push_back(std::move(process));
1393 }
1394}
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 > > &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.

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

631{
632 DBUG("Parse process variables:");
633
634 std::set<std::string> names;
635
636 for (auto var_config
638 : process_variables_config.getConfigSubtreeList("process_variable"))
639 {
640 // Either the mesh name is given, or the first mesh's name will be
641 // taken. Taking the first mesh's value is deprecated.
642 auto const mesh_name =
644 var_config.getConfigParameter<std::string>("mesh",
645 _mesh_vec[0]->getName());
646
647 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
648
649 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
651 if (!names.insert(pv.getName()).second)
652 {
653 OGS_FATAL("A process variable with name `{:s}' already exists.",
654 pv.getName());
655 }
656
657 _process_variables.push_back(std::move(pv));
658 }
659}

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

1398{
1399 DBUG("Reading time loop configuration.");
1400
1401 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1402 std::begin(_process_variables),
1403 std::end(_process_variables),
1404 [](auto const& process_variable)
1405 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1406
1408 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1409 compensate_non_equilibrium_initial_residuum);
1410
1411 if (!_time_loop)
1412 {
1413 OGS_FATAL("Initialization of time loop failed.");
1414 }
1415}
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 135 of file ProjectData.h.

Referenced by parseMedia(), and parseProcesses().

◆ _media

std::map<int, std::shared_ptr<MaterialPropertyLib::Medium> > ProjectData::_media
private

Definition at line 137 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 128 of file ProjectData.h.

Referenced by ProjectData(), and parseParameters().

◆ _nonlinear_solvers

std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase> > ProjectData::_nonlinear_solvers
private

Definition at line 145 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 133 of file ProjectData.h.

Referenced by parseMedia(), parseParameters(), parseProcesses(), and parseProcessVariables().

◆ _process_variables

std::vector<ProcessLib::ProcessVariable> ProjectData::_process_variables
private

Definition at line 130 of file ProjectData.h.

Referenced by parseProcesses(), parseProcessVariables(), and parseTimeLoop().

◆ _processes

std::vector<std::unique_ptr<ProcessLib::Process> > ProjectData::_processes
private

Definition at line 129 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 140 of file ProjectData.h.

Referenced by getTimeLoop(), and parseTimeLoop().


The documentation for this class was generated from the following files: