From 631266d3882a9efcbfd0a3f1770a1a73823a985e Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Tue, 9 Sep 2014 12:45:25 +0200
Subject: [PATCH] [ProjectData] read processes.

---
 OGS/ProjectData.cpp | 23 ++++++++++++++++++++++-
 OGS/ProjectData.h   |  3 +++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/OGS/ProjectData.cpp b/OGS/ProjectData.cpp
index 28c4d549681..8bfe3344580 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 caeefe212c1..397e30a3b0e 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;
-- 
GitLab