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 &project_directory, std::string const &output_directory)
 
 ProjectData (ProjectData &)=delete
 
std::vector< std::unique_ptr< ProcessLib::Process > > const & getProcesses () const
 Provides read access to the process container. More...
 
ProcessLib::TimeLoopgetTimeLoop ()
 

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. More...
 
void parseProcesses (BaseLib::ConfigTree const &processes_config, std::string const &project_directory, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
 
void parseTimeLoop (BaseLib::ConfigTree const &config, const std::string &output_directory)
 Parses the time loop configuration. More...
 
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< 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. More...
 
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. More...
 
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
 
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
 
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
 

Constructor & Destructor Documentation

◆ ProjectData() [1/3]

ProjectData::ProjectData ( )
default

The empty constructor used in the gui, for example, when the project's configuration is not loaded yet.

◆ ProjectData() [2/3]

ProjectData::ProjectData ( BaseLib::ConfigTree const &  project_config,
std::string const &  project_directory,
std::string const &  output_directory 
)

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

287  : _mesh_vec(readMeshes(project_config, project_directory))
288 {
289  if (auto const python_script =
291  project_config.getConfigParameterOptional<std::string>("python_script"))
292  {
293 #ifdef OGS_USE_PYTHON
294  namespace py = pybind11;
295 
296  // Append to python's module search path
297  auto py_path = py::module::import("sys").attr("path");
298  py_path.attr("append")(project_directory); // .prj directory
299  // virtualenv
300  py_path.attr("append")(
301  CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
302 
303  auto const script_path =
305 
306  // Evaluate in scope of main module
307  py::object scope = py::module::import("__main__").attr("__dict__");
308  // add (global) variables
309  auto globals = py::dict(scope);
310  globals["ogs_prj_directory"] = project_directory;
311  py::eval_file(script_path, scope);
312 #else
313  OGS_FATAL("OpenGeoSys has not been built with Python support.");
314 #endif // OGS_USE_PYTHON
315  }
316 
318  parseCurves(project_config.getConfigSubtreeOptional("curves"));
319 
320  auto parameter_names_for_transformation =
322  parseParameters(project_config.getConfigSubtree("parameters"));
323 
326  project_config.getConfigSubtreeOptional("local_coordinate_system"),
327  _parameters);
328 
329  for (auto& parameter : _parameters)
330  {
331  if (std::find(begin(parameter_names_for_transformation),
332  end(parameter_names_for_transformation),
333  parameter->name) !=
334  end(parameter_names_for_transformation))
335  {
337  {
338  OGS_FATAL(
339  "The parameter '{:s}' is using the local coordinate system "
340  "but no local coordinate system was provided.",
341  parameter->name);
342  }
343  parameter->setCoordinateSystem(*_local_coordinate_system);
344  }
345 
346  parameter->initialize(_parameters);
347  }
348 
350  parseProcessVariables(project_config.getConfigSubtree("process_variables"));
351 
353  parseMedia(project_config.getConfigSubtreeOptional("media"));
354 
356  parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
357 
358  auto chemical_solver_interface = parseChemicalSolverInterface(
360  project_config.getConfigSubtreeOptional("chemical_system"),
361  output_directory);
362 
364  parseProcesses(project_config.getConfigSubtree("processes"),
365  project_directory, output_directory,
366  std::move(chemical_solver_interface));
367 
369  parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
370 
372  parseTimeLoop(project_config.getConfigSubtree("time_loop"),
373  output_directory);
374 }
#define OGS_FATAL(...)
Definition: Error.h:26
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:129
void parseProcesses(BaseLib::ConfigTree const &processes_config, std::string const &project_directory, std::string const &output_directory, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > parseChemicalSolverInterface(std::optional< BaseLib::ConfigTree > const &config, const std::string &output_directory)
void parseMedia(std::optional< BaseLib::ConfigTree > const &media_config)
Parses media configuration and saves them in an object.
void parseLinearSolvers(BaseLib::ConfigTree const &config)
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > _parameters
Buffer for each parameter config passed to the process.
Definition: ProjectData.h:127
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
Definition: ProjectData.h:122
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 copyPathToFileName(const std::string &file_name, const std::string &source)
Definition: FileTools.cpp:196
std::string project_directory
The directory where the prj file resides.
Definition: FileTools.cpp:27
std::optional< ParameterLib::CoordinateSystem > parseLocalCoordinateSystem(std::optional< BaseLib::ConfigTree > const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters)

References _local_coordinate_system, _parameters, BaseLib::copyPathToFileName(), BaseLib::ConfigTree::getConfigParameterOptional(), BaseLib::ConfigTree::getConfigSubtree(), BaseLib::ConfigTree::getConfigSubtreeOptional(), OGS_FATAL, parseChemicalSolverInterface(), parseCurves(), parseLinearSolvers(), anonymous_namespace{ProjectData.cpp}::parseLocalCoordinateSystem(), parseMedia(), parseNonlinearSolvers(), parseParameters(), parseProcesses(), parseProcessVariables(), parseTimeLoop(), and anonymous_namespace{FileTools.cpp}::project_directory.

◆ ProjectData() [3/3]

ProjectData::ProjectData ( ProjectData )
delete

Member Function Documentation

◆ getProcesses()

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

Provides read access to the process container.

Definition at line 74 of file ProjectData.h.

76  {
77  return _processes;
78  }
std::vector< std::unique_ptr< ProcessLib::Process > > _processes
Definition: ProjectData.h:123

References _processes.

Referenced by main().

◆ getTimeLoop()

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

Definition at line 80 of file ProjectData.h.

80 { return *_time_loop; }
std::unique_ptr< ProcessLib::TimeLoop > _time_loop
The time loop used to solve this project's processes.
Definition: ProjectData.h:134

References _time_loop.

Referenced by main().

◆ parseChemicalSolverInterface()

std::unique_ptr< ChemistryLib::ChemicalSolverInterface > ProjectData::parseChemicalSolverInterface ( std::optional< BaseLib::ConfigTree > const &  config,
const std::string &  output_directory 
)
private
Input File Parameter:
prj__chemical_system__chemical_solver

Definition at line 513 of file ProjectData.cpp.

516 {
517  if (!config)
518  {
519  return nullptr;
520  }
521 
522  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
523  chemical_solver_interface;
524 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
525  INFO(
526  "Ready for initializing interface to a chemical solver for water "
527  "chemistry calculation.");
528 
529  auto const chemical_solver =
531  config->getConfigAttribute<std::string>("chemical_solver");
532 
533  if (boost::iequals(chemical_solver, "Phreeqc"))
534  {
535  INFO(
536  "Configuring phreeqc interface for water chemistry calculation "
537  "using file-based approach.");
538 
539  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
541  *config, output_directory);
542  }
543  else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
544  {
545  OGS_FATAL(
546  "The chemical solver option of PhreeqcKernel is not accessible for "
547  "the time being. Please set 'Phreeqc'' as the chemical solver for "
548  "reactive transport modeling.");
549  }
550  else
551  {
552  OGS_FATAL(
553  "Unknown chemical solver. Please specify either Phreeqc or "
554  "PhreeqcKernel as the solver for water chemistry calculation "
555  "instead.");
556  }
557 #else
558  (void)output_directory;
559 
560  OGS_FATAL(
561  "Found the type of the process to be solved is not component transport "
562  "process. Please specify the process type to ComponentTransport. At "
563  "the present, water chemistry calculation is only available for "
564  "component transport process.");
565 #endif
566  return chemical_solver_interface;
567 }
void INFO(char const *fmt, Args const &... args)
Definition: Logging.h:32
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:136
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, and ChemistryLib::Phreeqc.

Referenced by ProjectData().

◆ parseCurves()

void ProjectData::parseCurves ( std::optional< BaseLib::ConfigTree > const &  config)
private
Input File Parameter:
prj__curves__curve
Input File Parameter:
prj__curves__curve__name

Definition at line 1176 of file ProjectData.cpp.

1177 {
1178  if (!config)
1179  {
1180  return;
1181  }
1182 
1183  DBUG("Reading curves configuration.");
1184 
1186  for (auto conf : config->getConfigSubtreeList("curve"))
1187  {
1189  auto const name = conf.getConfigParameter<std::string>("name");
1191  _curves,
1192  name,
1195  "The curve name is not unique.");
1196  }
1197 }
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:142
void insertIfKeyUniqueElseError(Map &map, Key const &key, Value &&value, std::string const &error_message)
Definition: Algorithm.h:106
std::unique_ptr< CurveType > createPiecewiseLinearCurve(BaseLib::ConfigTree const &config)

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

Referenced by ProjectData().

◆ parseLinearSolvers()

void ProjectData::parseLinearSolvers ( BaseLib::ConfigTree const &  config)
private
Input File Parameter:
prj__linear_solvers__linear_solver
Input File Parameter:
prj__linear_solvers__linear_solver__name

Definition at line 1135 of file ProjectData.cpp.

1136 {
1137  DBUG("Reading linear solver configuration.");
1138 
1140  for (auto conf : config.getConfigSubtreeList("linear_solver"))
1141  {
1143  auto const name = conf.getConfigParameter<std::string>("name");
1146  name,
1147  std::make_unique<GlobalLinearSolver>("", &conf),
1148  "The linear solver name is not unique");
1149  }
1150 }

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

Referenced by ProjectData().

◆ parseMedia()

void ProjectData::parseMedia ( std::optional< BaseLib::ConfigTree > const &  media_config)
private

Parses media configuration and saves them in an object.

Input File Parameter:
prj__media__medium
Input File Parameter:
prj__media__medium__id

Definition at line 450 of file ProjectData.cpp.

452 {
453  if (!media_config)
454  {
455  return;
456  }
457 
458  DBUG("Reading media:");
459 
460  if (_mesh_vec.empty() || _mesh_vec[0] == nullptr)
461  {
462  ERR("A mesh is required to define medium materials.");
463  return;
464  }
465 
466  for (auto const& medium_config :
468  media_config->getConfigSubtreeList("medium"))
469  {
470  auto material_id_string =
472  medium_config.getConfigAttribute<std::string>("id", "0");
473 
474  auto const material_ids_of_this_medium =
475  splitMaterialIdString(material_id_string);
476 
477  for (auto const& id : material_ids_of_this_medium)
478  {
479  if (_media.find(id) != end(_media))
480  {
481  OGS_FATAL(
482  "Multiple media were specified for the same material id "
483  "'{:d}'. Keep in mind, that if no material id is "
484  "specified, it is assumed to be 0 by default.",
485  id);
486  }
487 
488  if (id == material_ids_of_this_medium[0])
489  {
491  _mesh_vec[0]->getDimension(), medium_config, _parameters,
493  : nullptr,
494  _curves);
495  }
496  else
497  {
498  // This medium has multiple material IDs assigned and this is
499  // not the first material ID. Therefore we can reuse the medium
500  // we created before.
501  _media[id] = _media[material_ids_of_this_medium[0]];
502  }
503  }
504  }
505 
506  if (_media.empty())
507  {
508  OGS_FATAL("No entity is found inside <media>.");
509  }
510 }
void ERR(char const *fmt, Args const &... args)
Definition: Logging.h:42
std::vector< int > splitMaterialIdString(std::string const &material_id_string)
std::map< int, std::shared_ptr< MaterialPropertyLib::Medium > > _media
Definition: ProjectData.h:131
std::unique_ptr< Medium > createMedium(int const geometry_dimension, BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, ParameterLib::CoordinateSystem const *const local_coordinate_system, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
unsigned getDimension(MeshLib::MeshElemType eleType)

References _curves, _local_coordinate_system, _media, _mesh_vec, _parameters, MaterialPropertyLib::createMedium(), DBUG(), ERR(), anonymous_namespace{generateStructuredMesh.cpp}::getDimension(), OGS_FATAL, and splitMaterialIdString().

Referenced by ProjectData().

◆ parseNonlinearSolvers()

void ProjectData::parseNonlinearSolvers ( BaseLib::ConfigTree const &  config)
private
Input File Parameter:
prj__nonlinear_solvers__nonlinear_solver
Input File Parameter:
prj__nonlinear_solvers__nonlinear_solver__linear_solver
Input File Parameter:
prj__nonlinear_solvers__nonlinear_solver__name

Definition at line 1152 of file ProjectData.cpp.

1153 {
1154  DBUG("Reading non-linear solver configuration.");
1155 
1157  for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1158  {
1159  auto const ls_name =
1161  conf.getConfigParameter<std::string>("linear_solver");
1162  auto& linear_solver = BaseLib::getOrError(
1163  _linear_solvers, ls_name,
1164  "A linear solver with the given name does not exist.");
1165 
1167  auto const name = conf.getConfigParameter<std::string>("name");
1170  name,
1171  NumLib::createNonlinearSolver(*linear_solver, conf).first,
1172  "The nonlinear solver name is not unique");
1173  }
1174 }
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:139
std::pair< std::unique_ptr< NonlinearSolverBase >, NonlinearSolverTag > createNonlinearSolver(GlobalLinearSolver &linear_solver, BaseLib::ConfigTree const &config)
Map::mapped_type & getOrError(Map &map, Key const &key, std::string const &error_message)
Definition: Algorithm.h:147

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

Referenced by ProjectData().

◆ parseParameters()

std::vector< std::string > ProjectData::parseParameters ( BaseLib::ConfigTree const &  parameters_config)
private

Parses the parameters configuration and saves them. Checks for double parameters' names. Returns names of vectors which are to be transformed using local coordinate system.

Input File Parameter:
prj__parameters__parameter
Input File Parameter:
prj__parameters__parameter__use_local_coordinate_system

Definition at line 411 of file ProjectData.cpp.

413 {
414  using namespace ProcessLib;
415 
416  std::set<std::string> names;
417  std::vector<std::string> parameter_names_for_transformation;
418 
419  DBUG("Reading parameters:");
420  for (auto parameter_config :
422  parameters_config.getConfigSubtreeList("parameter"))
423  {
424  auto p =
425  ParameterLib::createParameter(parameter_config, _mesh_vec, _curves);
426  if (!names.insert(p->name).second)
427  {
428  OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
429  }
430 
431  auto const use_local_coordinate_system =
433  parameter_config.getConfigParameterOptional<bool>(
434  "use_local_coordinate_system");
435  if (!!use_local_coordinate_system && *use_local_coordinate_system)
436  {
437  parameter_names_for_transformation.push_back(p->name);
438  }
439 
440  _parameters.push_back(std::move(p));
441  }
442 
443  _parameters.push_back(
444  std::make_unique<ParameterLib::ConstantParameter<double>>(
446 
447  return parameter_names_for_transformation;
448 }
static const double p
std::unique_ptr< ParameterBase > createParameter(BaseLib::ConfigTree const &config, std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
Definition: Parameter.cpp:26
Single, constant value parameter.
static const std::string zero_parameter_name

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

Referenced by ProjectData().

◆ parseProcesses()

void ProjectData::parseProcesses ( BaseLib::ConfigTree const &  processes_config,
std::string const &  project_directory,
std::string const &  output_directory,
std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&  chemical_solver_interface 
)
private

Parses the processes configuration and creates new processes for each process entry passing the corresponding subtree to the process constructor.

Input File Parameter:
prj__processes__process
Input File Parameter:
prj__processes__process__type
Input File Parameter:
prj__processes__process__name
Input File Parameter:
prj__processes__process__integration_order
Input File Parameter:
prj__processes__process__jacobian_assembler
Input File Parameter:
prj__processes__process__HYDRO_MECHANICS__dimension
Input File Parameter:
prj__processes__process__HYDRO_MECHANICS_WITH_LIE__dimension
Input File Parameter:
prj__processes__process__SMALL_DEFORMATION_WITH_LIE__dimension
Input File Parameter:
prj__processes__process__THERMO_HYDRO_MECHANICS__dimension
Input File Parameter:
prj__processes__process__RICHARDS_MECHANICS__dimension

Definition at line 569 of file ProjectData.cpp.

575 {
576  (void)project_directory; // to avoid compilation warning
577  (void)output_directory; // to avoid compilation warning
578 
579  DBUG("Reading processes:");
581  for (auto process_config : processes_config.getConfigSubtreeList("process"))
582  {
583  auto const type =
585  process_config.peekConfigParameter<std::string>("type");
586 
587  auto const name =
589  process_config.getConfigParameter<std::string>("name");
590 
591  auto const integration_order =
593  process_config.getConfigParameter<int>("integration_order");
594 
595  std::unique_ptr<ProcessLib::Process> process;
596 
597  auto jacobian_assembler = ProcessLib::createJacobianAssembler(
599  process_config.getConfigSubtreeOptional("jacobian_assembler"));
600 
601 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
602  if (type == "STEADY_STATE_DIFFUSION")
603  {
604  // The existence check of the in the configuration referenced
605  // process variables is checked in the physical process.
606  // TODO at the moment we have only one mesh, later there can be
607  // several meshes. Then we have to assign the referenced mesh
608  // here.
609  process =
611  name, *_mesh_vec[0], std::move(jacobian_assembler),
612  _process_variables, _parameters, integration_order,
613  process_config, _mesh_vec, _media);
614  }
615  else
616 #endif
617 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
618  if (type == "LIQUID_FLOW")
619  {
621  name, *_mesh_vec[0], std::move(jacobian_assembler),
622  _process_variables, _parameters, integration_order,
623  process_config, _mesh_vec, _media);
624  }
625  else
626 #endif
627 #ifdef OGS_BUILD_PROCESS_STOKESFLOW
628  if (type == "StokesFlow")
629  {
630  switch (_mesh_vec[0]->getDimension())
631  {
632  case 2:
633  process =
635  name, *_mesh_vec[0], std::move(jacobian_assembler),
636  _process_variables, _parameters, integration_order,
637  process_config, _media);
638  break;
639  default:
640  OGS_FATAL(
641  "StokesFlow process does not support given "
642  "dimension {:d}",
643  _mesh_vec[0]->getDimension());
644  }
645  }
646  else
647 #endif
648 #ifdef OGS_BUILD_PROCESS_TES
649  if (type == "TES")
650  {
652  name, *_mesh_vec[0], std::move(jacobian_assembler),
653  _process_variables, _parameters, integration_order,
654  process_config);
655  }
656  else
657 #endif
658 #ifdef OGS_BUILD_PROCESS_TH2M
659  if (type == "TH2M")
660  {
661  switch (_mesh_vec[0]->getDimension())
662  {
663  case 2:
665  name, *_mesh_vec[0], std::move(jacobian_assembler),
667  _local_coordinate_system, integration_order,
668  process_config, _media);
669  break;
670  case 3:
672  name, *_mesh_vec[0], std::move(jacobian_assembler),
674  _local_coordinate_system, integration_order,
675  process_config, _media);
676  break;
677  default:
678  OGS_FATAL("TH2M process does not support given dimension");
679  }
680  }
681  else
682 #endif
683 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
684  if (type == "HEAT_CONDUCTION")
685  {
687  name, *_mesh_vec[0], std::move(jacobian_assembler),
688  _process_variables, _parameters, integration_order,
689  process_config, _media);
690  }
691  else
692 #endif
693 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
694  if (type == "HEAT_TRANSPORT_BHE")
695  {
696  if (_mesh_vec[0]->getDimension() != 3)
697  {
698  OGS_FATAL(
699  "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
700  "mesh! ");
701  }
702 
703  process =
705  name, *_mesh_vec[0], std::move(jacobian_assembler),
706  _process_variables, _parameters, integration_order,
707  process_config, _curves, _media);
708  }
709  else
710 #endif
711 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
712  if (type == "HYDRO_MECHANICS")
713  {
715  switch (process_config.getConfigParameter<int>("dimension"))
716  {
717  case 2:
718  process =
720  2>(name, *_mesh_vec[0],
721  std::move(jacobian_assembler),
723  _local_coordinate_system, integration_order,
724  process_config, _media);
725  break;
726  case 3:
727  process =
729  3>(name, *_mesh_vec[0],
730  std::move(jacobian_assembler),
732  _local_coordinate_system, integration_order,
733  process_config, _media);
734  break;
735  default:
736  OGS_FATAL(
737  "HYDRO_MECHANICS process does not support given "
738  "dimension");
739  }
740  }
741  else
742 #endif
743 #ifdef OGS_BUILD_PROCESS_LIE
744  if (type == "HYDRO_MECHANICS_WITH_LIE")
745  {
747  switch (process_config.getConfigParameter<int>("dimension"))
748  {
749  case 2:
752  name, *_mesh_vec[0], std::move(jacobian_assembler),
754  _local_coordinate_system, integration_order,
755  process_config);
756  break;
757  case 3:
760  name, *_mesh_vec[0], std::move(jacobian_assembler),
762  _local_coordinate_system, integration_order,
763  process_config);
764  break;
765  default:
766  OGS_FATAL(
767  "HYDRO_MECHANICS_WITH_LIE process does not support "
768  "given dimension");
769  }
770  }
771  else
772 #endif
773 #ifdef OGS_BUILD_PROCESS_HT
774  if (type == "HT")
775  {
777  name, *_mesh_vec[0], std::move(jacobian_assembler),
778  _process_variables, _parameters, integration_order,
779  process_config, _mesh_vec, _media);
780  }
781  else
782 #endif
783 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
784  if (type == "ComponentTransport")
785  {
786  process =
788  name, *_mesh_vec[0], std::move(jacobian_assembler),
789  _process_variables, _parameters, integration_order,
790  process_config, _mesh_vec, _media,
791  std::move(chemical_solver_interface));
792  }
793  else
794 #endif
795 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
796  if (type == "PHASE_FIELD")
797  {
798  switch (_mesh_vec[0]->getDimension())
799  {
800  case 2:
801  process =
803  name, *_mesh_vec[0], std::move(jacobian_assembler),
805  _local_coordinate_system, integration_order,
806  process_config);
807  break;
808  case 3:
809  process =
811  name, *_mesh_vec[0], std::move(jacobian_assembler),
813  _local_coordinate_system, integration_order,
814  process_config);
815  break;
816  }
817  }
818  else
819 #endif
820 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
821  if (type == "RichardsComponentTransport")
822  {
825  name, *_mesh_vec[0], std::move(jacobian_assembler),
826  _process_variables, _parameters, integration_order,
827  process_config, _media);
828  }
829  else
830 #endif
831 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
832  if (type == "SMALL_DEFORMATION")
833  {
834  switch (_mesh_vec[0]->getDimension())
835  {
836  case 2:
839  name, *_mesh_vec[0], std::move(jacobian_assembler),
841  _local_coordinate_system, integration_order,
842  process_config);
843  break;
844  case 3:
847  name, *_mesh_vec[0], std::move(jacobian_assembler),
849  _local_coordinate_system, integration_order,
850  process_config);
851  break;
852  default:
853  OGS_FATAL(
854  "SMALL_DEFORMATION process does not support given "
855  "dimension");
856  }
857  }
858  else
859 #endif
860 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
861  if (type == "SMALL_DEFORMATION_NONLOCAL")
862  {
863  switch (_mesh_vec[0]->getDimension())
864  {
865  case 2:
868  name, *_mesh_vec[0], std::move(jacobian_assembler),
870  _local_coordinate_system, integration_order,
871  process_config);
872  break;
873  case 3:
876  name, *_mesh_vec[0], std::move(jacobian_assembler),
878  _local_coordinate_system, integration_order,
879  process_config);
880  break;
881  default:
882  OGS_FATAL(
883  "SMALL_DEFORMATION_NONLOCAL process does not support "
884  "given dimension {:d}",
885  _mesh_vec[0]->getDimension());
886  }
887  }
888  else
889 #endif
890 #ifdef OGS_BUILD_PROCESS_LIE
891  if (type == "SMALL_DEFORMATION_WITH_LIE")
892  {
894  switch (process_config.getConfigParameter<int>("dimension"))
895  {
896  case 2:
899  name, *_mesh_vec[0], std::move(jacobian_assembler),
901  _local_coordinate_system, integration_order,
902  process_config);
903  break;
904  case 3:
907  name, *_mesh_vec[0], std::move(jacobian_assembler),
909  _local_coordinate_system, integration_order,
910  process_config);
911  break;
912  default:
913  OGS_FATAL(
914  "SMALL_DEFORMATION_WITH_LIE process does not support "
915  "given dimension");
916  }
917  }
918  else
919 #endif
920 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
921  if (type == "THERMO_HYDRO_MECHANICS")
922  {
924  switch (process_config.getConfigParameter<int>("dimension"))
925  {
926  case 2:
929  name, *_mesh_vec[0], std::move(jacobian_assembler),
931  _local_coordinate_system, integration_order,
932  process_config, _media);
933  break;
934  case 3:
937  name, *_mesh_vec[0], std::move(jacobian_assembler),
939  _local_coordinate_system, integration_order,
940  process_config, _media);
941  break;
942  default:
943  OGS_FATAL(
944  "THERMO_HYDRO_MECHANICS process does not support given "
945  "dimension");
946  }
947  }
948  else
949 #endif
950 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
951  if (type == "THERMO_MECHANICAL_PHASE_FIELD")
952  {
953  switch (_mesh_vec[0]->getDimension())
954  {
955  case 2:
958  name, *_mesh_vec[0], std::move(jacobian_assembler),
960  _local_coordinate_system, integration_order,
961  process_config);
962  break;
963  case 3:
966  name, *_mesh_vec[0], std::move(jacobian_assembler),
968  _local_coordinate_system, integration_order,
969  process_config);
970  break;
971  }
972  }
973  else
974 #endif
975 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
976  if (type == "THERMO_MECHANICS")
977  {
978  switch (_mesh_vec[0]->getDimension())
979  {
980  case 2:
983  name, *_mesh_vec[0], std::move(jacobian_assembler),
985  _local_coordinate_system, integration_order,
986  process_config, _media);
987  break;
988  case 3:
991  name, *_mesh_vec[0], std::move(jacobian_assembler),
993  _local_coordinate_system, integration_order,
994  process_config, _media);
995  break;
996  }
997  }
998  else
999 #endif
1000 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1001  if (type == "RICHARDS_FLOW")
1002  {
1004  name, *_mesh_vec[0], std::move(jacobian_assembler),
1005  _process_variables, _parameters, integration_order,
1006  process_config, _curves, _media);
1007  }
1008  else
1009 #endif
1010 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1011  if (type == "RICHARDS_MECHANICS")
1012  {
1014  switch (process_config.getConfigParameter<int>("dimension"))
1015  {
1016  case 2:
1019  name, *_mesh_vec[0], std::move(jacobian_assembler),
1021  _local_coordinate_system, integration_order,
1022  process_config, _media);
1023  break;
1024  case 3:
1027  name, *_mesh_vec[0], std::move(jacobian_assembler),
1029  _local_coordinate_system, integration_order,
1030  process_config, _media);
1031  break;
1032  }
1033  }
1034  else
1035 #endif
1036 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1037  if (type == "THERMO_RICHARDS_FLOW")
1038  {
1039  process =
1041  name, *_mesh_vec[0], std::move(jacobian_assembler),
1042  _process_variables, _parameters, integration_order,
1043  process_config, _media);
1044  }
1045  else
1046 #endif
1047 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1048  if (type == "THERMO_RICHARDS_MECHANICS")
1049  {
1050  switch (_mesh_vec[0]->getDimension())
1051  {
1052  case 2:
1055  name, *_mesh_vec[0], std::move(jacobian_assembler),
1057  _local_coordinate_system, integration_order,
1058  process_config, _media);
1059  break;
1060  case 3:
1063  name, *_mesh_vec[0], std::move(jacobian_assembler),
1065  _local_coordinate_system, integration_order,
1066  process_config, _media);
1067  break;
1068  }
1069  }
1070  else
1071 #endif
1072 
1073 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1074  if (type == "TWOPHASE_FLOW_PP")
1075  {
1076  process =
1078  name, *_mesh_vec[0], std::move(jacobian_assembler),
1079  _process_variables, _parameters, integration_order,
1080  process_config, _curves, _media);
1081  }
1082  else
1083 #endif
1084 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1085  if (type == "TWOPHASE_FLOW_PRHO")
1086  {
1089  name, *_mesh_vec[0], std::move(jacobian_assembler),
1090  _process_variables, _parameters, integration_order,
1091  process_config, _curves);
1092  }
1093  else
1094 #endif
1095 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1096  if (type == "THERMAL_TWOPHASE_WITH_PP")
1097  {
1100  name, *_mesh_vec[0], std::move(jacobian_assembler),
1101  _process_variables, _parameters, integration_order,
1102  process_config, _curves);
1103  }
1104  else
1105 #endif
1106  {
1107  OGS_FATAL("Unknown process type: {:s}", type);
1108  }
1109 
1110  if (BaseLib::containsIf(
1111  _processes,
1112  [&name](std::unique_ptr<ProcessLib::Process> const& p)
1113  { return p->name == name; }))
1114  {
1115  OGS_FATAL("The process name '{:s}' is not unique.", name);
1116  }
1117  _processes.push_back(std::move(process));
1118  }
1119 }
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:124
bool containsIf(Container const &container, Predicate &&predicate)
Definition: Algorithm.h:264
std::unique_ptr< Process > createComponentTransportProcess(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::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media, std::unique_ptr< ChemistryLib::ChemicalSolverInterface > &&chemical_solver_interface)
std::unique_ptr< Process > createHTProcess(std::string 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 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 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 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 name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createHydroMechanicsProcess< 3 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, std::optional< ParameterLib::CoordinateSystem > const &local_coordinate_system, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createSmallDeformationProcess< 2 >(std::string 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 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 > createLiquidFlowProcess(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::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 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 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 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 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 &, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createRichardsMechanicsProcess< 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 > createRichardsMechanicsProcess< 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 > createSmallDeformationNonlocalProcess< 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)
template std::unique_ptr< Process > createSmallDeformationNonlocalProcess< 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)
template std::unique_ptr< Process > createSmallDeformationProcess< 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)
template std::unique_ptr< Process > createSmallDeformationProcess< 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::unique_ptr< Process > createSteadyStateDiffusion(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::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
template std::unique_ptr< Process > createStokesFlowProcess< 2 >(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createTESProcess(std::string name, MeshLib::Mesh &mesh, std::unique_ptr< ProcessLib::AbstractJacobianAssembler > &&jacobian_assembler, std::vector< ProcessVariable > const &variables, std::vector< std::unique_ptr< ParameterLib::ParameterBase >> const &parameters, unsigned const integration_order, BaseLib::ConfigTree const &config)
template std::unique_ptr< Process > createTH2MProcess< 3 >(std::string 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 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 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)
template std::unique_ptr< Process > createThermoHydroMechanicsProcess< 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 > createThermoHydroMechanicsProcess< 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 > createThermoMechanicalPhaseFieldProcess< 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)
template std::unique_ptr< Process > createThermoMechanicalPhaseFieldProcess< 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)
template std::unique_ptr< Process > createThermoMechanicsProcess< 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 > createThermoMechanicsProcess< 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 > createThermoRichardsFlowProcess(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)
template std::unique_ptr< Process > createThermoRichardsMechanicsProcess< 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 > createThermoRichardsMechanicsProcess< 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 > createTwoPhaseFlowWithPPProcess(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< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
std::unique_ptr< Process > createTwoPhaseFlowWithPrhoProcess(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< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation >> const &curves)
std::unique_ptr< AbstractJacobianAssembler > createJacobianAssembler(std::optional< BaseLib::ConfigTree > const &config)

References _curves, _local_coordinate_system, _media, _mesh_vec, _parameters, _process_variables, _processes, BaseLib::containsIf(), ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::HeatConduction::createHeatConductionProcess(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 2 >(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess< 3 >(), ProcessLib::createJacobianAssembler(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), ProcessLib::PhaseField::createPhaseFieldProcess< 2 >(), ProcessLib::PhaseField::createPhaseFieldProcess< 3 >(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::RichardsFlow::createRichardsFlowProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 2 >(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess< 3 >(), ProcessLib::SmallDeformationNonlocal::createSmallDeformationNonlocalProcess< 2 >(), ProcessLib::SmallDeformationNonlocal::createSmallDeformationNonlocalProcess< 3 >(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 2 >(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SmallDeformation::createSmallDeformationProcess< 3 >(), ProcessLib::SteadyStateDiffusion::createSteadyStateDiffusion(), ProcessLib::StokesFlow::createStokesFlowProcess< 2 >(), ProcessLib::TES::createTESProcess(), ProcessLib::TH2M::createTH2MProcess< 2 >(), ProcessLib::TH2M::createTH2MProcess< 3 >(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 2 >(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess< 3 >(), ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess< 2 >(), ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess< 3 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 2 >(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess< 3 >(), ProcessLib::ThermoRichardsFlow::createThermoRichardsFlowProcess(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 2 >(), ProcessLib::ThermoRichardsMechanics::createThermoRichardsMechanicsProcess< 3 >(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowWithPrhoProcess(), DBUG(), BaseLib::ConfigTree::getConfigSubtreeList(), anonymous_namespace{generateStructuredMesh.cpp}::getDimension(), MaterialPropertyLib::name, OGS_FATAL, MathLib::p, and anonymous_namespace{FileTools.cpp}::project_directory.

Referenced by ProjectData().

◆ parseProcessVariables()

void ProjectData::parseProcessVariables ( BaseLib::ConfigTree const &  process_variables_config)
private

Parses the process variables configuration and creates new variables for each variable entry passing the corresponding subtree to the process variable constructor.

Input File Parameter:
prj__process_variables__process_variable
Input File Parameter:
prj__process_variables__process_variable__mesh

Definition at line 376 of file ProjectData.cpp.

378 {
379  DBUG("Parse process variables:");
380 
381  std::set<std::string> names;
382 
383  for (auto var_config
385  : process_variables_config.getConfigSubtreeList("process_variable"))
386  {
387  // Either the mesh name is given, or the first mesh's name will be
388  // taken. Taking the first mesh's value is deprecated.
389  auto const mesh_name =
391  var_config.getConfigParameter<std::string>("mesh",
392  _mesh_vec[0]->getName());
393 
394  auto& mesh = *BaseLib::findElementOrError(
395  begin(_mesh_vec), end(_mesh_vec),
396  [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
397  "Expected to find a mesh named " + mesh_name + ".");
398 
399  auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
401  if (!names.insert(pv.getName()).second)
402  {
403  OGS_FATAL("A process variable with name `{:s}' already exists.",
404  pv.getName());
405  }
406 
407  _process_variables.push_back(std::move(pv));
408  }
409 }
std::iterator_traits< InputIt >::reference findElementOrError(InputIt begin, InputIt end, Predicate predicate, std::string const &error="")
Definition: Algorithm.h:69

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

Referenced by ProjectData().

◆ parseTimeLoop()

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

Parses the time loop configuration.

Definition at line 1121 of file ProjectData.cpp.

1123 {
1124  DBUG("Reading time loop configuration.");
1125 
1127  config, output_directory, _processes, _nonlinear_solvers, _mesh_vec);
1128 
1129  if (!_time_loop)
1130  {
1131  OGS_FATAL("Initialization of time loop failed.");
1132  }
1133 }
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 >> const &meshes)
Builds a TimeLoop from the given configuration.

References _mesh_vec, _nonlinear_solvers, _processes, _time_loop, ProcessLib::createTimeLoop(), DBUG(), and OGS_FATAL.

Referenced by ProjectData().

Member Data Documentation

◆ _curves

std::map<std::string, std::unique_ptr<MathLib::PiecewiseLinearInterpolation> > ProjectData::_curves
private

◆ _linear_solvers

std::map<std::string, std::unique_ptr<GlobalLinearSolver> > ProjectData::_linear_solvers
private

◆ _local_coordinate_system

std::optional<ParameterLib::CoordinateSystem> ProjectData::_local_coordinate_system
private

Definition at line 129 of file ProjectData.h.

Referenced by ProjectData(), parseMedia(), and parseProcesses().

◆ _media

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

Definition at line 131 of file ProjectData.h.

Referenced by parseMedia(), and parseProcesses().

◆ _mesh_vec

std::vector<std::unique_ptr<MeshLib::Mesh> > ProjectData::_mesh_vec
private

◆ _nonlinear_solvers

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

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

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

◆ _process_variables

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

Definition at line 124 of file ProjectData.h.

Referenced by parseProcesses(), and parseProcessVariables().

◆ _processes

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

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

Referenced by getTimeLoop(), and parseTimeLoop().


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