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

344 : _mesh_vec(readMeshes(project_config, mesh_directory)),
345 _named_rasters(readRasters(project_config,
346 GeoLib::AABB(_mesh_vec[0]->getNodes().begin(),
347 _mesh_vec[0]->getNodes().end())
348 .getMinMaxPoints()))
349{
350 // for debugging raster reading implementation
351 // writeRasters(_named_rasters, output_directory);
352 if (auto const python_script =
354 project_config.getConfigParameterOptional<std::string>("python_script"))
355 {
356 namespace py = pybind11;
357
358#ifdef OGS_EMBED_PYTHON_INTERPRETER
359 _py_scoped_interpreter.emplace(ApplicationsLib::setupEmbeddedPython());
361#endif
362
363 // Append to python's module search path
364 auto py_path = py::module::import("sys").attr("path");
365 py_path.attr("append")(script_directory); // .prj or -s directory
366
367 auto const script_path =
368 BaseLib::joinPaths(script_directory, *python_script);
369
370 // Evaluate in scope of main module
371 py::object scope = py::module::import("__main__").attr("__dict__");
372 // add (global) variables
373 auto globals = py::dict(scope);
374 globals["ogs_prj_directory"] =
375 project_config.projectDirectory().string();
376 globals["ogs_mesh_directory"] = mesh_directory;
377 globals["ogs_script_directory"] = script_directory;
378 try
379 {
380 py::eval_file(script_path, scope);
381 }
382 catch (py::error_already_set const& e)
383 {
384 OGS_FATAL("Error evaluating python script {}: {}", script_path,
385 e.what());
386 }
387 }
388
390 parseCurves(project_config.getConfigSubtreeOptional("curves"));
391
392 auto parameter_names_for_transformation =
394 parseParameters(project_config.getConfigSubtree("parameters"));
395
398 project_config.getConfigSubtreeOptional("local_coordinate_system"),
400
401 for (auto& parameter : _parameters)
402 {
403 if (std::find(begin(parameter_names_for_transformation),
404 end(parameter_names_for_transformation),
405 parameter->name) !=
406 end(parameter_names_for_transformation))
407 {
409 {
410 OGS_FATAL(
411 "The parameter '{:s}' is using the local coordinate system "
412 "but no local coordinate system was provided.",
413 parameter->name);
414 }
415 parameter->setCoordinateSystem(*_local_coordinate_system);
416 }
417
418 parameter->initialize(_parameters);
419 }
420
422 parseProcessVariables(project_config.getConfigSubtree("process_variables"));
423
425 parseMedia(project_config.getConfigSubtreeOptional("media"));
426
428 parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
429
430 auto chemical_solver_interface = parseChemicalSolverInterface(
432 project_config.getConfigSubtreeOptional("chemical_system"),
433 output_directory);
434
436 parseProcesses(project_config.getConfigSubtree("processes"),
437 output_directory,
438 std::move(chemical_solver_interface));
439
441 parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
442
444 parseTimeLoop(project_config.getConfigSubtree("time_loop"),
445 output_directory);
446}
#define OGS_FATAL(...)
Definition Error.h:19
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)
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)
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::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 89 of file ProjectData.h.

90 {
91 return _media;
92 }
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 1306 of file ProjectData.cpp.

1307{
1308 return MeshLib::findMeshByName(_mesh_vec, mesh_name);
1309}
Mesh & findMeshByName(std::vector< std::unique_ptr< Mesh > > const &meshes, std::string_view const name)
Definition Mesh.cpp:354

References _mesh_vec, and MeshLib::findMeshByName().

◆ getMeshNames()

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

Definition at line 1311 of file ProjectData.cpp.

1312{
1313 return _mesh_vec | MeshLib::views::names | ranges::to<std::vector>;
1314}
constexpr ranges::views::view_closure names
For an element of a range view return its name.
Definition Mesh.h:220

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

79 {
80 return _processes;
81 }
std::vector< std::unique_ptr< ProcessLib::Process > > _processes

References _processes.

◆ getTimeLoop()

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

Definition at line 83 of file ProjectData.h.

83{ 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 573 of file ProjectData.cpp.

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

1284{
1285 if (!config)
1286 {
1287 return;
1288 }
1289
1290 DBUG("Reading curves configuration.");
1291
1293 for (auto conf : config->getConfigSubtreeList("curve"))
1294 {
1296 auto const name = conf.getConfigParameter<std::string>("name");
1298 _curves,
1299 name,
1301 MathLib::PiecewiseLinearInterpolation>(conf),
1302 "The curve name is not unique.");
1303 }
1304}
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:97
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 1236 of file ProjectData.cpp.

1237{
1238 DBUG("Reading linear solver configuration.");
1239
1241 for (auto conf : config.getConfigSubtreeList("linear_solver"))
1242 {
1244 auto const name = conf.getConfigParameter<std::string>("name");
1245 auto const linear_solver_parser =
1246 MathLib::LinearSolverOptionsParser<GlobalLinearSolver>{};
1247 auto const solver_options =
1248 linear_solver_parser.parseNameAndOptions("", &conf);
1249
1252 name,
1253 std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1254 std::get<1>(solver_options)),
1255 "The linear solver name is not unique");
1256 }
1257}

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

524{
525 if (!media_config)
526 {
527 return;
528 }
529
530 DBUG("Reading media:");
531
532 if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
533 {
534 ERR("A mesh is required to define medium materials.");
535 return;
536 }
537
538 for (auto const& medium_config :
540 media_config->getConfigSubtreeList("medium"))
541 {
542 auto create_medium = [dim = _mesh_vec[0]->getDimension(),
543 &medium_config, this](int const id)
544 {
546 id, _mesh_vec[0]->getDimension(), medium_config, _parameters,
548 _curves);
549 };
550
551 auto const material_id_string =
553 medium_config.getConfigAttribute<std::string>("id", "0");
554
555 std::vector<int> const material_ids_of_this_medium =
556 MaterialLib::parseMaterialIdString(material_id_string,
558
559 for (auto const& id : material_ids_of_this_medium)
560 {
562 id, _media, material_ids_of_this_medium, create_medium);
563 }
564 }
565
566 if (_media.empty())
567 {
568 OGS_FATAL("No entity is found inside <media>.");
569 }
570}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
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 > > &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:258
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 1259 of file ProjectData.cpp.

1260{
1261 DBUG("Reading non-linear solver configuration.");
1262
1264 for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1265 {
1266 auto const ls_name =
1268 conf.getConfigParameter<std::string>("linear_solver");
1269 auto const& linear_solver = BaseLib::getOrError(
1270 _linear_solvers, ls_name,
1271 "A linear solver with the given name does not exist.");
1272
1274 auto const name = conf.getConfigParameter<std::string>("name");
1277 name,
1278 NumLib::createNonlinearSolver(*linear_solver, conf).first,
1279 "The nonlinear solver name is not unique");
1280 }
1281}
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:111

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

482{
483 using namespace ProcessLib;
484
485 std::set<std::string> names;
486 std::vector<std::string> parameter_names_for_transformation;
487
488 DBUG("Reading parameters:");
489 for (auto parameter_config :
491 parameters_config.getConfigSubtreeList("parameter"))
492 {
493 auto p = ParameterLib::createParameter(parameter_config, _mesh_vec,
495 if (!names.insert(p->name).second)
496 {
497 OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
498 }
499
500 auto const use_local_coordinate_system =
502 parameter_config.getConfigParameterOptional<bool>(
503 "use_local_coordinate_system");
504 if (!!use_local_coordinate_system && *use_local_coordinate_system)
505 {
506 parameter_names_for_transformation.push_back(p->name);
507 }
508
509 _parameters.push_back(std::move(p));
510 }
511
512 _parameters.push_back(
513 std::make_unique<ParameterLib::ConstantParameter<double>>(
515 _parameters.push_back(
516 std::make_unique<ParameterLib::ConstantParameter<double>>(
518
519 return parameter_names_for_transformation;
520}
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 639 of file ProjectData.cpp.

644{
645 (void)output_directory; // to avoid compilation warning
646
647 DBUG("Reading processes:");
649 for (auto process_config : processes_config.getConfigSubtreeList("process"))
650 {
651 auto const type =
653 process_config.peekConfigParameter<std::string>("type");
654
655 auto const name =
657 process_config.getConfigParameter<std::string>("name");
658
659 [[maybe_unused]] auto const integration_order =
661 process_config.getConfigParameter<int>("integration_order");
662
663 std::unique_ptr<ProcessLib::Process> process;
664
665 auto jacobian_assembler = ProcessLib::createJacobianAssembler(
667 process_config.getConfigSubtreeOptional("jacobian_assembler"));
668
669#ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
670 if (type == "STEADY_STATE_DIFFUSION")
671 {
672 // The existence check of the in the configuration referenced
673 // process variables is checked in the physical process.
674 // TODO at the moment we have only one mesh, later there can be
675 // several meshes. Then we have to assign the referenced mesh
676 // here.
677 process =
679 name, *_mesh_vec[0], std::move(jacobian_assembler),
680 _process_variables, _parameters, integration_order,
681 process_config, _mesh_vec, _media);
682 }
683 else
684#endif
685#ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
686 if (type == "LIQUID_FLOW")
687 {
689 name, *_mesh_vec[0], std::move(jacobian_assembler),
690 _process_variables, _parameters, integration_order,
691 process_config, _mesh_vec, _media);
692 }
693 else
694#endif
695#ifdef OGS_BUILD_PROCESS_TH2M
696 if (type == "TH2M")
697 {
698 switch (_mesh_vec[0]->getDimension())
699 {
700 case 2:
702 name, *_mesh_vec[0], std::move(jacobian_assembler),
704 _local_coordinate_system, integration_order,
705 process_config, _media);
706 break;
707 case 3:
709 name, *_mesh_vec[0], std::move(jacobian_assembler),
711 _local_coordinate_system, integration_order,
712 process_config, _media);
713 break;
714 default:
715 OGS_FATAL("TH2M process does not support given dimension");
716 }
717 }
718 else
719#endif
720#ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
721 if (type == "HEAT_CONDUCTION")
722 {
724 name, *_mesh_vec[0], std::move(jacobian_assembler),
725 _process_variables, _parameters, integration_order,
726 process_config, _media);
727 }
728 else
729#endif
730#ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
731 if (type == "HEAT_TRANSPORT_BHE")
732 {
733 if (_mesh_vec[0]->getDimension() != 3)
734 {
735 OGS_FATAL(
736 "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
737 "mesh! ");
738 }
739
740 process =
742 name, *_mesh_vec[0], std::move(jacobian_assembler),
743 _process_variables, _parameters, integration_order,
744 process_config, _curves, _media);
745 }
746 else
747#endif
748#ifdef OGS_BUILD_PROCESS_WELLBORESIMULATOR
749 if (type == "WELLBORE_SIMULATOR")
750 {
751 if (_mesh_vec[0]->getDimension() != 1)
752 {
753 OGS_FATAL(
754 "WELLBORE_SIMULATOR can only work with a 1-dimensional "
755 "mesh!");
756 }
757
758 process =
760 name, *_mesh_vec[0], std::move(jacobian_assembler),
761 _process_variables, _parameters, integration_order,
762 process_config, _media);
763 }
764 else
765#endif
766#ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
767 if (type == "HYDRO_MECHANICS")
768 {
769 if (
770 process_config.getConfigParameterOptional<int>("dimension"))
771 {
772 OGS_FATAL(
773 "The 'dimension' tag has been removed in the merge-request "
774 "!4766. The dimension is now taken from the main mesh and "
775 "the tag must be removed. There is a python script in the "
776 "merge-request description for automatic conversion.");
777 }
778 switch (_mesh_vec[0]->getDimension())
779 {
780 case 2:
781 process =
783 2>(name, *_mesh_vec[0],
784 std::move(jacobian_assembler),
786 _local_coordinate_system, integration_order,
787 process_config, _media);
788 break;
789 case 3:
790 process =
792 3>(name, *_mesh_vec[0],
793 std::move(jacobian_assembler),
795 _local_coordinate_system, integration_order,
796 process_config, _media);
797 break;
798 default:
799 OGS_FATAL(
800 "HYDRO_MECHANICS process does not support given "
801 "dimension");
802 }
803 }
804 else
805#endif
806#ifdef OGS_BUILD_PROCESS_LARGEDEFORMATION
807 if (type == "LARGE_DEFORMATION")
808 {
809 switch (_mesh_vec[0]->getDimension())
810 {
811 case 2:
814 name, *_mesh_vec[0], std::move(jacobian_assembler),
816 _local_coordinate_system, integration_order,
817 process_config, _media);
818 break;
819 case 3:
822 name, *_mesh_vec[0], std::move(jacobian_assembler),
824 _local_coordinate_system, integration_order,
825 process_config, _media);
826 break;
827 default:
828 OGS_FATAL(
829 "LARGE_DEFORMATION process does not support given "
830 "dimension");
831 }
832 }
833 else
834#endif
835#ifdef OGS_BUILD_PROCESS_LIE_HM
836 if (type == "HYDRO_MECHANICS_WITH_LIE")
837 {
838 if (
839 process_config.getConfigParameterOptional<int>("dimension"))
840 {
841 OGS_FATAL(
842 "The 'dimension' tag has been removed in the merge-request "
843 "!4766."
844 "The dimension is now taken from the main mesh and the tag "
845 "must be"
846 "removed. There is a python script in the merge-request "
847 "description"
848 "for automatic conversion.");
849 }
850 switch (_mesh_vec[0]->getDimension())
851 {
852 case 2:
855 name, *_mesh_vec[0], std::move(jacobian_assembler),
857 _local_coordinate_system, integration_order,
858 process_config, _media);
859 break;
860 case 3:
863 name, *_mesh_vec[0], std::move(jacobian_assembler),
865 _local_coordinate_system, integration_order,
866 process_config, _media);
867 break;
868 default:
869 OGS_FATAL(
870 "HYDRO_MECHANICS_WITH_LIE process does not support "
871 "given dimension");
872 }
873 }
874 else
875#endif
876#ifdef OGS_BUILD_PROCESS_HT
877 if (type == "HT")
878 {
880 name, *_mesh_vec[0], std::move(jacobian_assembler),
881 _process_variables, _parameters, integration_order,
882 process_config, _mesh_vec, _media);
883 }
884 else
885#endif
886#ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
887 if (type == "ComponentTransport")
888 {
889 process =
891 name, *_mesh_vec[0], std::move(jacobian_assembler),
892 _process_variables, _parameters, integration_order,
893 process_config, _mesh_vec, _media,
894 std::move(chemical_solver_interface));
895 }
896 else
897#endif
898#ifdef OGS_BUILD_PROCESS_PHASEFIELD
899 if (type == "PHASE_FIELD")
900 {
901 switch (_mesh_vec[0]->getDimension())
902 {
903 case 2:
904 process =
906 name, *_mesh_vec[0], std::move(jacobian_assembler),
908 _local_coordinate_system, integration_order,
909 process_config);
910 break;
911 case 3:
912 process =
914 name, *_mesh_vec[0], std::move(jacobian_assembler),
916 _local_coordinate_system, integration_order,
917 process_config);
918 break;
919 }
920 }
921 else
922#endif
923#ifdef OGS_BUILD_PROCESS_HMPHASEFIELD
924 if (type == "HM_PHASE_FIELD")
925 {
926 switch (_mesh_vec[0]->getDimension())
927 {
928 case 2:
929 process =
931 name, *_mesh_vec[0], std::move(jacobian_assembler),
933 _local_coordinate_system, integration_order,
934 process_config, _media);
935 break;
936 case 3:
937 process =
939 name, *_mesh_vec[0], std::move(jacobian_assembler),
941 _local_coordinate_system, integration_order,
942 process_config, _media);
943 break;
944 }
945 }
946 else
947#endif
948#ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
949 if (type == "RichardsComponentTransport")
950 {
953 name, *_mesh_vec[0], std::move(jacobian_assembler),
954 _process_variables, _parameters, integration_order,
955 process_config, _media);
956 }
957 else
958#endif
959#ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
960 if (type == "SMALL_DEFORMATION")
961 {
962 switch (_mesh_vec[0]->getDimension())
963 {
964 case 2:
967 name, *_mesh_vec[0], std::move(jacobian_assembler),
969 _local_coordinate_system, integration_order,
970 process_config, _media);
971 break;
972 case 3:
975 name, *_mesh_vec[0], std::move(jacobian_assembler),
977 _local_coordinate_system, integration_order,
978 process_config, _media);
979 break;
980 default:
981 OGS_FATAL(
982 "SMALL_DEFORMATION process does not support given "
983 "dimension");
984 }
985 }
986 else
987#endif
988#ifdef OGS_BUILD_PROCESS_LIE_M
989 if (type == "SMALL_DEFORMATION_WITH_LIE")
990 {
991 if (
992 process_config.getConfigParameterOptional<int>("dimension"))
993 {
994 OGS_FATAL(
995 "The 'dimension' tag has been removed in the merge-request "
996 "!4766."
997 "The dimension is now taken from the main mesh and the tag "
998 "must be"
999 "removed. There is a python script in the merge-request "
1000 "description"
1001 "for automatic conversion.");
1002 }
1003 switch (_mesh_vec[0]->getDimension())
1004 {
1005 case 2:
1008 name, *_mesh_vec[0], std::move(jacobian_assembler),
1010 _local_coordinate_system, integration_order,
1011 process_config);
1012 break;
1013 case 3:
1016 name, *_mesh_vec[0], std::move(jacobian_assembler),
1018 _local_coordinate_system, integration_order,
1019 process_config);
1020 break;
1021 default:
1022 OGS_FATAL(
1023 "SMALL_DEFORMATION_WITH_LIE process does not support "
1024 "given dimension");
1025 }
1026 }
1027 else
1028#endif
1029#ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
1030 if (type == "THERMO_HYDRO_MECHANICS")
1031 {
1032 if (
1033 process_config.getConfigParameterOptional<int>("dimension"))
1034 {
1035 OGS_FATAL(
1036 "The 'dimension' tag has been removed in the merge-request "
1037 "!4766."
1038 "The dimension is now taken from the main mesh and the tag "
1039 "must be"
1040 "removed. There is a python script in the merge-request "
1041 "description"
1042 "for automatic conversion.");
1043 }
1044 switch (_mesh_vec[0]->getDimension())
1045 {
1046 case 2:
1049 name, *_mesh_vec[0], std::move(jacobian_assembler),
1051 _local_coordinate_system, integration_order,
1052 process_config, _media);
1053 break;
1054 case 3:
1057 name, *_mesh_vec[0], std::move(jacobian_assembler),
1059 _local_coordinate_system, integration_order,
1060 process_config, _media);
1061 break;
1062 default:
1063 OGS_FATAL(
1064 "THERMO_HYDRO_MECHANICS process does not support given "
1065 "dimension");
1066 }
1067 }
1068 else
1069#endif
1070#ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
1071 if (type == "THERMO_MECHANICS")
1072 {
1073 switch (_mesh_vec[0]->getDimension())
1074 {
1075 case 2:
1078 name, *_mesh_vec[0], std::move(jacobian_assembler),
1080 _local_coordinate_system, integration_order,
1081 process_config, _media);
1082 break;
1083 case 3:
1086 name, *_mesh_vec[0], std::move(jacobian_assembler),
1088 _local_coordinate_system, integration_order,
1089 process_config, _media);
1090 break;
1091 }
1092 }
1093 else
1094#endif
1095#ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1096 if (type == "RICHARDS_FLOW")
1097 {
1099 name, *_mesh_vec[0], std::move(jacobian_assembler),
1100 _process_variables, _parameters, integration_order,
1101 process_config, _media);
1102 }
1103 else
1104#endif
1105#ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1106 if (type == "RICHARDS_MECHANICS")
1107 {
1108 if (
1109 process_config.getConfigParameterOptional<int>("dimension"))
1110 {
1111 OGS_FATAL(
1112 "The 'dimension' tag has been removed in the merge-request "
1113 "!4766."
1114 "The dimension is now taken from the main mesh and the tag "
1115 "must be"
1116 "removed. There is a python script in the merge-request "
1117 "description"
1118 "for automatic conversion.");
1119 }
1120 switch (_mesh_vec[0]->getDimension())
1121 {
1122 case 2:
1125 name, *_mesh_vec[0], std::move(jacobian_assembler),
1127 _local_coordinate_system, integration_order,
1128 process_config, _media);
1129 break;
1130 case 3:
1133 name, *_mesh_vec[0], std::move(jacobian_assembler),
1135 _local_coordinate_system, integration_order,
1136 process_config, _media);
1137 break;
1138 }
1139 }
1140 else
1141#endif
1142#ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1143 if (type == "THERMO_RICHARDS_FLOW")
1144 {
1145 process =
1147 name, *_mesh_vec[0], std::move(jacobian_assembler),
1148 _process_variables, _parameters, integration_order,
1149 process_config, _media);
1150 }
1151 else
1152#endif
1153#ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1154 if (type == "THERMO_RICHARDS_MECHANICS")
1155 {
1156 switch (_mesh_vec[0]->getDimension())
1157 {
1158 case 2:
1161 name, *_mesh_vec[0], std::move(jacobian_assembler),
1163 _local_coordinate_system, integration_order,
1164 process_config, _media);
1165 break;
1166 case 3:
1169 name, *_mesh_vec[0], std::move(jacobian_assembler),
1171 _local_coordinate_system, integration_order,
1172 process_config, _media);
1173 break;
1174 }
1175 }
1176 else
1177#endif
1178
1179#ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1180 if (type == "TWOPHASE_FLOW_PP")
1181 {
1182 process =
1184 name, *_mesh_vec[0], std::move(jacobian_assembler),
1185 _process_variables, _parameters, integration_order,
1186 process_config, _media);
1187 }
1188 else
1189#endif
1190#ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1191 if (type == "THERMAL_TWOPHASE_WITH_PP")
1192 {
1195 name, *_mesh_vec[0], std::move(jacobian_assembler),
1196 _process_variables, _parameters, integration_order,
1197 process_config, _media);
1198 }
1199 else
1200#endif
1201 {
1202 OGS_FATAL("Unknown process type: {:s}", type);
1203 }
1204
1205 if (ranges::contains(_processes, name,
1206 [](std::unique_ptr<ProcessLib::Process> const& p)
1207 { return p->name; }))
1208 {
1209 OGS_FATAL("The process name '{:s}' is not unique.", name);
1210 }
1211 _processes.push_back(std::move(process));
1212 }
1213}
std::vector< ProcessLib::ProcessVariable > _process_variables
std::unique_ptr< Process > createComponentTransportProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
template std::unique_ptr< Process > createHMPhaseFieldProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createHMPhaseFieldProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHTProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHeatConductionProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHeatTransportBHEProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > const &curves, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createHydroMechanicsProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createHydroMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createHydroMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createSmallDeformationProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createLargeDeformationProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createLargeDeformationProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createLiquidFlowProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createPhaseFieldProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createPhaseFieldProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
std::unique_ptr< Process > createRichardsComponentTransportProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createRichardsFlowProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createRichardsMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createRichardsMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createSmallDeformationProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createSmallDeformationProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createSteadyStateDiffusion(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createTH2MProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createTH2MProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createThermalTwoPhaseFlowWithPPProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoHydroMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoHydroMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createThermoRichardsFlowProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 3 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 2 >(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createTwoPhaseFlowWithPPProcess(std::string const &name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< Process > createWellboreSimulatorProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > const &media)
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(std::optional< BaseLib::ConfigTree > const &config)

References _curves, _local_coordinate_system, _media, _mesh_vec, _parameters, _process_variables, _processes, ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::HeatConduction::createHeatConductionProcess(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HMPhaseField::createHMPhaseFieldProcess< 2 >(), ProcessLib::HMPhaseField::createHMPhaseFieldProcess< 3 >(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 2 >(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 3 >(), ProcessLib::createJacobianAssembler(), ProcessLib::LargeDeformation::createLargeDeformationProcess< 2 >(), ProcessLib::LargeDeformation::createLargeDeformationProcess< 3 >(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), ProcessLib::PhaseField::createPhaseFieldProcess< 2 >(), ProcessLib::PhaseField::createPhaseFieldProcess< 3 >(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::RichardsFlow::createRichardsFlowProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 2 >(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 3 >(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SteadyStateDiffusion::createSteadyStateDiffusion(), ProcessLib::TH2M::createTH2MProcess< 2 >(), ProcessLib::TH2M::createTH2MProcess< 3 >(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 2 >(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 3 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 2 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 3 >(), ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 2 >(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 3 >(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::WellboreSimulator::createWellboreSimulatorProcess(), DBUG(), BaseLib::ConfigTree::getConfigSubtreeList(), and OGS_FATAL.

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

450{
451 DBUG("Parse process variables:");
452
453 std::set<std::string> names;
454
455 for (auto var_config
457 : process_variables_config.getConfigSubtreeList("process_variable"))
458 {
459 // Either the mesh name is given, or the first mesh's name will be
460 // taken. Taking the first mesh's value is deprecated.
461 auto const mesh_name =
463 var_config.getConfigParameter<std::string>("mesh",
464 _mesh_vec[0]->getName());
465
466 auto& mesh = MeshLib::findMeshByName(_mesh_vec, mesh_name);
467
468 auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
470 if (!names.insert(pv.getName()).second)
471 {
472 OGS_FATAL("A process variable with name `{:s}' already exists.",
473 pv.getName());
474 }
475
476 _process_variables.push_back(std::move(pv));
477 }
478}

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

1217{
1218 DBUG("Reading time loop configuration.");
1219
1220 bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1221 std::begin(_process_variables),
1222 std::end(_process_variables),
1223 [](auto const& process_variable)
1224 { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1225
1227 config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1228 compensate_non_equilibrium_initial_residuum);
1229
1230 if (!_time_loop)
1231 {
1232 OGS_FATAL("Initialization of time loop failed.");
1233 }
1234}
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 141 of file ProjectData.h.

Referenced by parseMedia(), and parseProcesses().

◆ _media

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

Definition at line 143 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 134 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 151 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 139 of file ProjectData.h.

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

◆ _process_variables

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

Definition at line 136 of file ProjectData.h.

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

◆ _processes

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

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

Referenced by getTimeLoop(), and parseTimeLoop().


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