Skip to content
Snippets Groups Projects
Commit 631266d3 authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[ProjectData] read processes.

parent 6be986b3
No related branches found
No related tags found
No related merge requests found
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
namespace detail namespace detail
{ {
void readGeometry(std::string const& fname, GeoLib::GEOObjects & geo_objects) void readGeometry(std::string const& fname, GeoLib::GEOObjects & geo_objects)
{ {
DBUG("Reading geometry file \'%s\'.", fname.c_str()); DBUG("Reading geometry file \'%s\'.", fname.c_str());
FileIO::BoostXmlGmlInterface gml_reader(geo_objects); FileIO::BoostXmlGmlInterface gml_reader(geo_objects);
gml_reader.readFile(fname); gml_reader.readFile(fname);
} }
} }
ProjectData::ProjectData() ProjectData::ProjectData()
...@@ -69,6 +69,9 @@ ProjectData::ProjectData(ConfigTree const& project_config, ...@@ -69,6 +69,9 @@ ProjectData::ProjectData(ConfigTree const& project_config,
// read process variables // read process variables
readProcessVariables(project_config.get_child("process_variables")); readProcessVariables(project_config.get_child("process_variables"));
// read processes
readProcesses(project_config.get_child("processes"));
} }
ProjectData::~ProjectData() ProjectData::~ProjectData()
...@@ -187,3 +190,21 @@ void ProjectData::readProcessVariables( ...@@ -187,3 +190,21 @@ void ProjectData::readProcessVariables(
_process_variables.emplace_back(var_config,*_mesh_vec[0],*_geoObjects); _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)
);
}
}
}
...@@ -82,6 +82,9 @@ private: ...@@ -82,6 +82,9 @@ private:
/// read the process variables from configuration /// read the process variables from configuration
void readProcessVariables(ConfigTree const& process_variables_config); void readProcessVariables(ConfigTree const& process_variables_config);
// read the processes from configuration
void readProcesses(ConfigTree const& process_config);
private: private:
#ifdef OGS_BUILD_GUI #ifdef OGS_BUILD_GUI
GEOModels *_geoObjects; GEOModels *_geoObjects;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment