diff --git a/OGS/ProjectData.cpp b/OGS/ProjectData.cpp index 28c4d549681b4ac37a7ef02614c7f532bfd673a6..8bfe3344580aa37bc833988a2ae35c005585bd1d 100644 --- a/OGS/ProjectData.cpp +++ b/OGS/ProjectData.cpp @@ -28,12 +28,12 @@ namespace detail { void readGeometry(std::string const& fname, GeoLib::GEOObjects & geo_objects) - { DBUG("Reading geometry file \'%s\'.", fname.c_str()); FileIO::BoostXmlGmlInterface gml_reader(geo_objects); gml_reader.readFile(fname); } + } ProjectData::ProjectData() @@ -69,6 +69,9 @@ ProjectData::ProjectData(ConfigTree const& project_config, // read process variables readProcessVariables(project_config.get_child("process_variables")); + + // read processes + readProcesses(project_config.get_child("processes")); } ProjectData::~ProjectData() @@ -187,3 +190,21 @@ void ProjectData::readProcessVariables( _process_variables.emplace_back(var_config,*_mesh_vec[0],*_geoObjects); } } + +void ProjectData::readProcesses(ConfigTree const& processes_config) +{ + DBUG("Reading processes:\n"); + for (auto pc_it : processes_config) { + ConfigTree const& process_config = pc_it.second; + if (process_config.get<std::string>("type") == "GROUNDWATER_FLOW") { + // The existence check of the in the configuration referenced + // process variables is checked in the physical process. + // TODO at the moment we have only one mesh, later there can be + // several meshes. Then we have to assign the referenced mesh + // here. + _processes.push_back(new ProcessLib::GroundwaterFlowProcess( + *_mesh_vec[0], _process_variables, process_config) + ); + } + } +} diff --git a/OGS/ProjectData.h b/OGS/ProjectData.h index caeefe212c11cf01e0e03866a93f77778c698602..397e30a3b0e44dd46c7629eb562c77b507a6c40d 100644 --- a/OGS/ProjectData.h +++ b/OGS/ProjectData.h @@ -82,6 +82,9 @@ private: /// read the process variables from configuration void readProcessVariables(ConfigTree const& process_variables_config); + // read the processes from configuration + void readProcesses(ConfigTree const& process_config); + private: #ifdef OGS_BUILD_GUI GEOModels *_geoObjects;