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, std::string const &mesh_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,
std::string const &  mesh_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.
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.

288  : _mesh_vec(readMeshes(project_config, mesh_directory))
289 {
290  if (auto const python_script =
292  project_config.getConfigParameterOptional<std::string>("python_script"))
293  {
294 #ifdef OGS_USE_PYTHON
295  namespace py = pybind11;
296 
297  // Append to python's module search path
298  auto py_path = py::module::import("sys").attr("path");
299  py_path.attr("append")(project_directory); // .prj directory
300  // virtualenv
301  py_path.attr("append")(
302  CMakeInfoLib::CMakeInfo::python_virtualenv_sitepackages);
303 
304  auto const script_path =
306 
307  // Evaluate in scope of main module
308  py::object scope = py::module::import("__main__").attr("__dict__");
309  // add (global) variables
310  auto globals = py::dict(scope);
311  globals["ogs_prj_directory"] = project_directory;
312  py::eval_file(script_path, scope);
313 #else
314  OGS_FATAL("OpenGeoSys has not been built with Python support.");
315 #endif // OGS_USE_PYTHON
316  }
317 
319  parseCurves(project_config.getConfigSubtreeOptional("curves"));
320 
321  auto parameter_names_for_transformation =
323  parseParameters(project_config.getConfigSubtree("parameters"));
324 
327  project_config.getConfigSubtreeOptional("local_coordinate_system"),
328  _parameters);
329 
330  for (auto& parameter : _parameters)
331  {
332  if (std::find(begin(parameter_names_for_transformation),
333  end(parameter_names_for_transformation),
334  parameter->name) !=
335  end(parameter_names_for_transformation))
336  {
338  {
339  OGS_FATAL(
340  "The parameter '{:s}' is using the local coordinate system "
341  "but no local coordinate system was provided.",
342  parameter->name);
343  }
344  parameter->setCoordinateSystem(*_local_coordinate_system);
345  }
346 
347  parameter->initialize(_parameters);
348  }
349 
351  parseProcessVariables(project_config.getConfigSubtree("process_variables"));
352 
354  parseMedia(project_config.getConfigSubtreeOptional("media"));
355 
357  parseLinearSolvers(project_config.getConfigSubtree("linear_solvers"));
358 
359  auto chemical_solver_interface = parseChemicalSolverInterface(
361  project_config.getConfigSubtreeOptional("chemical_system"),
362  output_directory);
363 
365  parseProcesses(project_config.getConfigSubtree("processes"),
366  project_directory, output_directory,
367  std::move(chemical_solver_interface));
368 
370  parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
371 
373  parseTimeLoop(project_config.getConfigSubtree("time_loop"),
374  output_directory);
375 }
#define OGS_FATAL(...)
Definition: Error.h:26
std::optional< ParameterLib::CoordinateSystem > _local_coordinate_system
Definition: ProjectData.h:130
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:128
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:123
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:197
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 75 of file ProjectData.h.

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

References _processes.

◆ getTimeLoop()

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

Definition at line 81 of file ProjectData.h.

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

References _time_loop.

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

521 {
522  if (!config)
523  {
524  return nullptr;
525  }
526 
527  std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
528  chemical_solver_interface;
529 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
530  INFO(
531  "Ready for initializing interface to a chemical solver for water "
532  "chemistry calculation.");
533 
534  auto const chemical_solver =
536  config->getConfigAttribute<std::string>("chemical_solver");
537 
538  if (boost::iequals(chemical_solver, "Phreeqc"))
539  {
540  INFO(
541  "Configuring phreeqc interface for water chemistry calculation "
542  "using file-based approach.");
543 
544  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
546  *config, output_directory);
547  }
548  else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
549  {
550  OGS_FATAL(
551  "The chemical solver option of PhreeqcKernel is not accessible for "
552  "the time being. Please set 'Phreeqc'' as the chemical solver for "
553  "reactive transport modeling.");
554  }
555  else if (boost::iequals(chemical_solver, "SelfContained"))
556  {
557  INFO(
558  "Use self-contained chemical solver for water chemistry "
559  "calculation.");
560 
561  chemical_solver_interface = ChemistryLib::createChemicalSolverInterface<
563  _mesh_vec, _linear_solvers, *config, output_directory);
564  }
565  else
566  {
567  OGS_FATAL(
568  "Unknown chemical solver. Please specify either Phreeqc or "
569  "PhreeqcKernel as the solver for water chemistry calculation "
570  "instead.");
571  }
572 #else
573  (void)output_directory;
574 
575  OGS_FATAL(
576  "Found the type of the process to be solved is not component transport "
577  "process. Please specify the process type to ComponentTransport. At "
578  "the present, water chemistry calculation is only available for "
579  "component transport process.");
580 #endif
581  return chemical_solver_interface;
582 }
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:34
std::map< std::string, std::unique_ptr< GlobalLinearSolver > > _linear_solvers
Definition: ProjectData.h:137
std::unique_ptr< ChemicalSolverInterface > createChemicalSolverInterface(std::vector< std::unique_ptr< MeshLib::Mesh >> const &meshes, std::map< std::string, std::unique_ptr< GlobalLinearSolver >> const &linear_solvers, BaseLib::ConfigTree const &config, std::string const &output_directory)

References _linear_solvers, _mesh_vec, ChemistryLib::createChemicalSolverInterface(), INFO(), OGS_FATAL, ChemistryLib::Phreeqc, and ChemistryLib::SelfContained.

Referenced by ProjectData().

◆ parseCurves()

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

Definition at line 1204 of file ProjectData.cpp.

1205 {
1206  if (!config)
1207  {
1208  return;
1209  }
1210 
1211  DBUG("Reading curves configuration.");
1212 
1214  for (auto conf : config->getConfigSubtreeList("curve"))
1215  {
1217  auto const name = conf.getConfigParameter<std::string>("name");
1219  _curves,
1220  name,
1223  "The curve name is not unique.");
1224  }
1225 }
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:29
std::map< std::string, std::unique_ptr< MathLib::PiecewiseLinearInterpolation > > _curves
Definition: ProjectData.h:143
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 1157 of file ProjectData.cpp.

1158 {
1159  DBUG("Reading linear solver configuration.");
1160 
1162  for (auto conf : config.getConfigSubtreeList("linear_solver"))
1163  {
1165  auto const name = conf.getConfigParameter<std::string>("name");
1166  auto const linear_solver_parser =
1168  auto const solver_options =
1169  linear_solver_parser.parseNameAndOptions("", &conf);
1170 
1173  name,
1174  std::make_unique<GlobalLinearSolver>(std::get<0>(solver_options),
1175  std::get<1>(solver_options)),
1176  "The linear solver name is not unique");
1177  }
1178 }

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

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

1181 {
1182  DBUG("Reading non-linear solver configuration.");
1183 
1185  for (auto conf : config.getConfigSubtreeList("nonlinear_solver"))
1186  {
1187  auto const ls_name =
1189  conf.getConfigParameter<std::string>("linear_solver");
1190  auto& linear_solver = BaseLib::getOrError(
1191  _linear_solvers, ls_name,
1192  "A linear solver with the given name does not exist.");
1193 
1195  auto const name = conf.getConfigParameter<std::string>("name");
1198  name,
1199  NumLib::createNonlinearSolver(*linear_solver, conf).first,
1200  "The nonlinear solver name is not unique");
1201  }
1202 }
std::map< std::string, std::unique_ptr< NumLib::NonlinearSolverBase > > _nonlinear_solvers
Definition: ProjectData.h:140
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 412 of file ProjectData.cpp.

414 {
415  using namespace ProcessLib;
416 
417  std::set<std::string> names;
418  std::vector<std::string> parameter_names_for_transformation;
419 
420  DBUG("Reading parameters:");
421  for (auto parameter_config :
423  parameters_config.getConfigSubtreeList("parameter"))
424  {
425  auto p =
426  ParameterLib::createParameter(parameter_config, _mesh_vec, _curves);
427  if (!names.insert(p->name).second)
428  {
429  OGS_FATAL("A parameter with name `{:s}' already exists.", p->name);
430  }
431 
432  auto const use_local_coordinate_system =
434  parameter_config.getConfigParameterOptional<bool>(
435  "use_local_coordinate_system");
436  if (!!use_local_coordinate_system && *use_local_coordinate_system)
437  {
438  parameter_names_for_transformation.push_back(p->name);
439  }
440 
441  _parameters.push_back(std::move(p));
442  }
443 
444  _parameters.push_back(
445  std::make_unique<ParameterLib::ConstantParameter<double>>(
447  _parameters.push_back(
448  std::make_unique<ParameterLib::ConstantParameter<double>>(
450 
451  return parameter_names_for_transformation;
452 }
static PROCESSLIB_EXPORT const std::string constant_one_parameter_name
Definition: Process.h:45
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 PROCESSLIB_EXPORT const std::string zero_parameter_name

References _curves, _mesh_vec, _parameters, ProcessLib::Process::constant_one_parameter_name, 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 584 of file ProjectData.cpp.

590 {
591  (void)project_directory; // to avoid compilation warning
592  (void)output_directory; // to avoid compilation warning
593 
594  DBUG("Reading processes:");
596  for (auto process_config : processes_config.getConfigSubtreeList("process"))
597  {
598  auto const type =
600  process_config.peekConfigParameter<std::string>("type");
601 
602  auto const name =
604  process_config.getConfigParameter<std::string>("name");
605 
606  auto const integration_order =
608  process_config.getConfigParameter<int>("integration_order");
609 
610  std::unique_ptr<ProcessLib::Process> process;
611 
612  auto jacobian_assembler = ProcessLib::createJacobianAssembler(
614  process_config.getConfigSubtreeOptional("jacobian_assembler"));
615 
616 #ifdef OGS_BUILD_PROCESS_STEADYSTATEDIFFUSION
617  if (type == "STEADY_STATE_DIFFUSION")
618  {
619  // The existence check of the in the configuration referenced
620  // process variables is checked in the physical process.
621  // TODO at the moment we have only one mesh, later there can be
622  // several meshes. Then we have to assign the referenced mesh
623  // here.
624  process =
626  name, *_mesh_vec[0], std::move(jacobian_assembler),
627  _process_variables, _parameters, integration_order,
628  process_config, _mesh_vec, _media);
629  }
630  else
631 #endif
632 #ifdef OGS_BUILD_PROCESS_LIQUIDFLOW
633  if (type == "LIQUID_FLOW")
634  {
636  name, *_mesh_vec[0], std::move(jacobian_assembler),
637  _process_variables, _parameters, integration_order,
638  process_config, _mesh_vec, _media);
639  }
640  else
641 #endif
642 #ifdef OGS_BUILD_PROCESS_STOKESFLOW
643  if (type == "StokesFlow")
644  {
645  switch (_mesh_vec[0]->getDimension())
646  {
647  case 2:
648  process =
650  name, *_mesh_vec[0], std::move(jacobian_assembler),
651  _process_variables, _parameters, integration_order,
652  process_config, _media);
653  break;
654  default:
655  OGS_FATAL(
656  "StokesFlow process does not support given "
657  "dimension {:d}",
658  _mesh_vec[0]->getDimension());
659  }
660  }
661  else
662 #endif
663 #ifdef OGS_BUILD_PROCESS_TES
664  if (type == "TES")
665  {
667  name, *_mesh_vec[0], std::move(jacobian_assembler),
668  _process_variables, _parameters, integration_order,
669  process_config);
670  }
671  else
672 #endif
673 #ifdef OGS_BUILD_PROCESS_TH2M
674  if (type == "TH2M")
675  {
676  switch (_mesh_vec[0]->getDimension())
677  {
678  case 2:
680  name, *_mesh_vec[0], std::move(jacobian_assembler),
682  _local_coordinate_system, integration_order,
683  process_config, _media);
684  break;
685  case 3:
687  name, *_mesh_vec[0], std::move(jacobian_assembler),
689  _local_coordinate_system, integration_order,
690  process_config, _media);
691  break;
692  default:
693  OGS_FATAL("TH2M process does not support given dimension");
694  }
695  }
696  else
697 #endif
698 #ifdef OGS_BUILD_PROCESS_HEATCONDUCTION
699  if (type == "HEAT_CONDUCTION")
700  {
702  name, *_mesh_vec[0], std::move(jacobian_assembler),
703  _process_variables, _parameters, integration_order,
704  process_config, _media);
705  }
706  else
707 #endif
708 #ifdef OGS_BUILD_PROCESS_HEATTRANSPORTBHE
709  if (type == "HEAT_TRANSPORT_BHE")
710  {
711  if (_mesh_vec[0]->getDimension() != 3)
712  {
713  OGS_FATAL(
714  "HEAT_TRANSPORT_BHE can only work with a 3-dimensional "
715  "mesh! ");
716  }
717 
718  process =
720  name, *_mesh_vec[0], std::move(jacobian_assembler),
721  _process_variables, _parameters, integration_order,
722  process_config, _curves, _media);
723  }
724  else
725 #endif
726 #ifdef OGS_BUILD_PROCESS_HYDROMECHANICS
727  if (type == "HYDRO_MECHANICS")
728  {
730  switch (process_config.getConfigParameter<int>("dimension"))
731  {
732  case 2:
733  process =
735  2>(name, *_mesh_vec[0],
736  std::move(jacobian_assembler),
738  _local_coordinate_system, integration_order,
739  process_config, _media);
740  break;
741  case 3:
742  process =
744  3>(name, *_mesh_vec[0],
745  std::move(jacobian_assembler),
747  _local_coordinate_system, integration_order,
748  process_config, _media);
749  break;
750  default:
751  OGS_FATAL(
752  "HYDRO_MECHANICS process does not support given "
753  "dimension");
754  }
755  }
756  else
757 #endif
758 #ifdef OGS_BUILD_PROCESS_LIE
759  if (type == "HYDRO_MECHANICS_WITH_LIE")
760  {
762  switch (process_config.getConfigParameter<int>("dimension"))
763  {
764  case 2:
767  name, *_mesh_vec[0], std::move(jacobian_assembler),
769  _local_coordinate_system, integration_order,
770  process_config);
771  break;
772  case 3:
775  name, *_mesh_vec[0], std::move(jacobian_assembler),
777  _local_coordinate_system, integration_order,
778  process_config);
779  break;
780  default:
781  OGS_FATAL(
782  "HYDRO_MECHANICS_WITH_LIE process does not support "
783  "given dimension");
784  }
785  }
786  else
787 #endif
788 #ifdef OGS_BUILD_PROCESS_HT
789  if (type == "HT")
790  {
792  name, *_mesh_vec[0], std::move(jacobian_assembler),
793  _process_variables, _parameters, integration_order,
794  process_config, _mesh_vec, _media);
795  }
796  else
797 #endif
798 #ifdef OGS_BUILD_PROCESS_COMPONENTTRANSPORT
799  if (type == "ComponentTransport")
800  {
801  process =
803  name, *_mesh_vec[0], std::move(jacobian_assembler),
804  _process_variables, _parameters, integration_order,
805  process_config, _mesh_vec, _media,
806  std::move(chemical_solver_interface));
807  }
808  else
809 #endif
810 #ifdef OGS_BUILD_PROCESS_PHASEFIELD
811  if (type == "PHASE_FIELD")
812  {
813  switch (_mesh_vec[0]->getDimension())
814  {
815  case 2:
816  process =
818  name, *_mesh_vec[0], std::move(jacobian_assembler),
820  _local_coordinate_system, integration_order,
821  process_config);
822  break;
823  case 3:
824  process =
826  name, *_mesh_vec[0], std::move(jacobian_assembler),
828  _local_coordinate_system, integration_order,
829  process_config);
830  break;
831  }
832  }
833  else
834 #endif
835 #ifdef OGS_BUILD_PROCESS_RICHARDSCOMPONENTTRANSPORT
836  if (type == "RichardsComponentTransport")
837  {
840  name, *_mesh_vec[0], std::move(jacobian_assembler),
841  _process_variables, _parameters, integration_order,
842  process_config, _media);
843  }
844  else
845 #endif
846 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATION
847  if (type == "SMALL_DEFORMATION")
848  {
849  switch (_mesh_vec[0]->getDimension())
850  {
851  case 2:
854  name, *_mesh_vec[0], std::move(jacobian_assembler),
856  _local_coordinate_system, integration_order,
857  process_config);
858  break;
859  case 3:
862  name, *_mesh_vec[0], std::move(jacobian_assembler),
864  _local_coordinate_system, integration_order,
865  process_config);
866  break;
867  default:
868  OGS_FATAL(
869  "SMALL_DEFORMATION process does not support given "
870  "dimension");
871  }
872  }
873  else
874 #endif
875 #ifdef OGS_BUILD_PROCESS_SMALLDEFORMATIONNONLOCAL
876  if (type == "SMALL_DEFORMATION_NONLOCAL")
877  {
878  switch (_mesh_vec[0]->getDimension())
879  {
880  case 2:
883  name, *_mesh_vec[0], std::move(jacobian_assembler),
885  _local_coordinate_system, integration_order,
886  process_config);
887  break;
888  case 3:
891  name, *_mesh_vec[0], std::move(jacobian_assembler),
893  _local_coordinate_system, integration_order,
894  process_config);
895  break;
896  default:
897  OGS_FATAL(
898  "SMALL_DEFORMATION_NONLOCAL process does not support "
899  "given dimension {:d}",
900  _mesh_vec[0]->getDimension());
901  }
902  }
903  else
904 #endif
905 #ifdef OGS_BUILD_PROCESS_LIE
906  if (type == "SMALL_DEFORMATION_WITH_LIE")
907  {
909  switch (process_config.getConfigParameter<int>("dimension"))
910  {
911  case 2:
914  name, *_mesh_vec[0], std::move(jacobian_assembler),
916  _local_coordinate_system, integration_order,
917  process_config);
918  break;
919  case 3:
922  name, *_mesh_vec[0], std::move(jacobian_assembler),
924  _local_coordinate_system, integration_order,
925  process_config);
926  break;
927  default:
928  OGS_FATAL(
929  "SMALL_DEFORMATION_WITH_LIE process does not support "
930  "given dimension");
931  }
932  }
933  else
934 #endif
935 #ifdef OGS_BUILD_PROCESS_THERMOHYDROMECHANICS
936  if (type == "THERMO_HYDRO_MECHANICS")
937  {
939  switch (process_config.getConfigParameter<int>("dimension"))
940  {
941  case 2:
944  name, *_mesh_vec[0], std::move(jacobian_assembler),
946  _local_coordinate_system, integration_order,
947  process_config, _media);
948  break;
949  case 3:
952  name, *_mesh_vec[0], std::move(jacobian_assembler),
954  _local_coordinate_system, integration_order,
955  process_config, _media);
956  break;
957  default:
958  OGS_FATAL(
959  "THERMO_HYDRO_MECHANICS process does not support given "
960  "dimension");
961  }
962  }
963  else
964 #endif
965 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICALPHASEFIELD
966  if (type == "THERMO_MECHANICAL_PHASE_FIELD")
967  {
968  switch (_mesh_vec[0]->getDimension())
969  {
970  case 2:
973  name, *_mesh_vec[0], std::move(jacobian_assembler),
975  _local_coordinate_system, integration_order,
976  process_config);
977  break;
978  case 3:
981  name, *_mesh_vec[0], std::move(jacobian_assembler),
983  _local_coordinate_system, integration_order,
984  process_config);
985  break;
986  }
987  }
988  else
989 #endif
990 #ifdef OGS_BUILD_PROCESS_THERMOMECHANICS
991  if (type == "THERMO_MECHANICS")
992  {
993  switch (_mesh_vec[0]->getDimension())
994  {
995  case 2:
998  name, *_mesh_vec[0], std::move(jacobian_assembler),
1000  _local_coordinate_system, integration_order,
1001  process_config, _media);
1002  break;
1003  case 3:
1006  name, *_mesh_vec[0], std::move(jacobian_assembler),
1008  _local_coordinate_system, integration_order,
1009  process_config, _media);
1010  break;
1011  }
1012  }
1013  else
1014 #endif
1015 #ifdef OGS_BUILD_PROCESS_RICHARDSFLOW
1016  if (type == "RICHARDS_FLOW")
1017  {
1019  name, *_mesh_vec[0], std::move(jacobian_assembler),
1020  _process_variables, _parameters, integration_order,
1021  process_config, _curves, _media);
1022  }
1023  else
1024 #endif
1025 #ifdef OGS_BUILD_PROCESS_RICHARDSMECHANICS
1026  if (type == "RICHARDS_MECHANICS")
1027  {
1029  switch (process_config.getConfigParameter<int>("dimension"))
1030  {
1031  case 2:
1034  name, *_mesh_vec[0], std::move(jacobian_assembler),
1036  _local_coordinate_system, integration_order,
1037  process_config, _media);
1038  break;
1039  case 3:
1042  name, *_mesh_vec[0], std::move(jacobian_assembler),
1044  _local_coordinate_system, integration_order,
1045  process_config, _media);
1046  break;
1047  }
1048  }
1049  else
1050 #endif
1051 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSFLOW
1052  if (type == "THERMO_RICHARDS_FLOW")
1053  {
1054  process =
1056  name, *_mesh_vec[0], std::move(jacobian_assembler),
1057  _process_variables, _parameters, integration_order,
1058  process_config, _media);
1059  }
1060  else
1061 #endif
1062 #ifdef OGS_BUILD_PROCESS_THERMORICHARDSMECHANICS
1063  if (type == "THERMO_RICHARDS_MECHANICS")
1064  {
1065  switch (_mesh_vec[0]->getDimension())
1066  {
1067  case 2:
1070  name, *_mesh_vec[0], std::move(jacobian_assembler),
1072  _local_coordinate_system, integration_order,
1073  process_config, _media);
1074  break;
1075  case 3:
1078  name, *_mesh_vec[0], std::move(jacobian_assembler),
1080  _local_coordinate_system, integration_order,
1081  process_config, _media);
1082  break;
1083  }
1084  }
1085  else
1086 #endif
1087 
1088 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPP
1089  if (type == "TWOPHASE_FLOW_PP")
1090  {
1091  process =
1093  name, *_mesh_vec[0], std::move(jacobian_assembler),
1094  _process_variables, _parameters, integration_order,
1095  process_config, _curves, _media);
1096  }
1097  else
1098 #endif
1099 #ifdef OGS_BUILD_PROCESS_TWOPHASEFLOWWITHPRHO
1100  if (type == "TWOPHASE_FLOW_PRHO")
1101  {
1104  name, *_mesh_vec[0], std::move(jacobian_assembler),
1105  _process_variables, _parameters, integration_order,
1106  process_config, _curves);
1107  }
1108  else
1109 #endif
1110 #ifdef OGS_BUILD_PROCESS_THERMALTWOPHASEFLOWWITHPP
1111  if (type == "THERMAL_TWOPHASE_WITH_PP")
1112  {
1115  name, *_mesh_vec[0], std::move(jacobian_assembler),
1116  _process_variables, _parameters, integration_order,
1117  process_config, _curves, _media);
1118  }
1119  else
1120 #endif
1121  {
1122  OGS_FATAL("Unknown process type: {:s}", type);
1123  }
1124 
1125  if (BaseLib::containsIf(
1126  _processes,
1127  [&name](std::unique_ptr<ProcessLib::Process> const& p)
1128  { return p->name == name; }))
1129  {
1130  OGS_FATAL("The process name '{:s}' is not unique.", name);
1131  }
1132  _processes.push_back(std::move(process));
1133  }
1134 }
std::vector< ProcessLib::ProcessVariable > _process_variables
Definition: ProjectData.h:125
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, std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)
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 377 of file ProjectData.cpp.

379 {
380  DBUG("Parse process variables:");
381 
382  std::set<std::string> names;
383 
384  for (auto var_config
386  : process_variables_config.getConfigSubtreeList("process_variable"))
387  {
388  // Either the mesh name is given, or the first mesh's name will be
389  // taken. Taking the first mesh's value is deprecated.
390  auto const mesh_name =
392  var_config.getConfigParameter<std::string>("mesh",
393  _mesh_vec[0]->getName());
394 
395  auto& mesh = *BaseLib::findElementOrError(
396  begin(_mesh_vec), end(_mesh_vec),
397  [&mesh_name](auto const& m) { return m->getName() == mesh_name; },
398  "Expected to find a mesh named " + mesh_name + ".");
399 
400  auto pv = ProcessLib::ProcessVariable{var_config, mesh, _mesh_vec,
402  if (!names.insert(pv.getName()).second)
403  {
404  OGS_FATAL("A process variable with name `{:s}' already exists.",
405  pv.getName());
406  }
407 
408  _process_variables.push_back(std::move(pv));
409  }
410 }
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 1136 of file ProjectData.cpp.

1138 {
1139  DBUG("Reading time loop configuration.");
1140 
1141  bool const compensate_non_equilibrium_initial_residuum = std::any_of(
1142  std::begin(_process_variables),
1143  std::end(_process_variables),
1144  [](auto const& process_variable)
1145  { return process_variable.compensateNonEquilibriumInitialResiduum(); });
1146 
1148  config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
1149  compensate_non_equilibrium_initial_residuum);
1150 
1151  if (!_time_loop)
1152  {
1153  OGS_FATAL("Initialization of time loop failed.");
1154  }
1155 }
constexpr bool any_of(List const &values)
Checks if any of the elements in the given list is true.
Definition: Algorithm.h:325
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, bool const compensate_non_equilibrium_initial_residuum)
Builds a TimeLoop from the given configuration.

References _mesh_vec, _nonlinear_solvers, _process_variables, _processes, _time_loop, BaseLib::any_of(), 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 130 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 132 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 140 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 128 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 125 of file ProjectData.h.

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

◆ _processes

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

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

Referenced by getTimeLoop(), and parseTimeLoop().


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