Commit 4502231c authored by Arne Graf's avatar Arne Graf

inifile:ffRouter:parameters:write_VTK_files true/false

parent 160d9340
Pipeline #4469 failed with stages
in 66 minutes and 57 seconds
......@@ -1163,6 +1163,15 @@ bool IniFileParser::ParseFfRouterOps(TiXmlNode* routingNode, RoutingStrategy s)
}
}
}
_config->set_write_VTK_files(false);
if (routingNode->FirstChild("parameters")) {
TiXmlNode* pParametersForAllFF = routingNode->FirstChild("parameters");
if (pParametersForAllFF->FirstChild("write_VTK_files")) {
//remark: std::strcmp returns 0 if the strings are equal
bool tmp_write_VTK = !std::strcmp(pParametersForAllFF->FirstChild("write_VTK_files")->FirstChild()->Value(), "true");
_config->set_write_VTK_files(tmp_write_VTK);
}
}
FFRouter* r = static_cast<FFRouter*>(_config->GetRoutingEngine()->GetAvailableRouters().back());
......
......@@ -109,6 +109,7 @@ public:
//ff router
_has_specific_goals = false;
_write_VTK_files = false;
}
int GetSolver() const { return _solver; };
......@@ -248,6 +249,10 @@ public:
void set_has_specific_goals(bool has_specific_goals) { _has_specific_goals = has_specific_goals;}
void set_write_VTK_files(bool write_VTK_files) {_write_VTK_files = write_VTK_files;}
bool get_write_VTK_files() const {return _write_VTK_files;}
const std::string& GetHostname() const { return _hostname; };
void SetHostname(std::string hostname) { _hostname = hostname; };
......@@ -352,6 +357,7 @@ private:
//ff router
bool _has_specific_goals;
bool _write_VTK_files;
std::string _hostname;
std::string _trajectoriesFile;
......
......@@ -314,12 +314,14 @@ bool FFRouter::Init(Building* building)
//int transTest = (building->GetRoom(roomTest)->GetAllTransitionsIDs())[0];
//auto test = _CroTrByUID.at(1253);
// for (unsigned int i = 0; i < _locffviafm.size(); ++i) {
// auto iter = _locffviafm.begin();
// std::advance(iter, i);
// int roomNr = iter->first;
// iter->second->writeFF("testFF" + std::to_string(roomNr) + ".vtk", _allDoorUIDs);
// }
if (_config->get_write_VTK_files()) {
for (unsigned int i = 0; i < _locffviafm.size(); ++i) {
auto iter = _locffviafm.begin();
std::advance(iter, i);
int roomNr = iter->first;
iter->second->writeFF("ffrouterOfRoom" + std::to_string(roomNr) + ".vtk", _allDoorUIDs);
}
}
// std::ofstream matrixfile;
// matrixfile.open("Matrix.txt");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment