Skip to content
Snippets Groups Projects
Commit e581c4fc authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix logic in getViewByName and getViewByNum to handle the case when no partition number is given

parent 6a3a92e3
No related branches found
No related tags found
No related merge requests found
...@@ -375,7 +375,8 @@ int MergeFile(std::string fileName, bool warnIfMissing) ...@@ -375,7 +375,8 @@ int MergeFile(std::string fileName, bool warnIfMissing)
tmp->readMSH(fileName); tmp->readMSH(fileName);
status = GeomMeshMatcher::instance()->match(tmp2, tmp); status = GeomMeshMatcher::instance()->match(tmp2, tmp);
delete tmp; delete tmp;
} else }
else
status = GModel::current()->readMSH(fileName); status = GModel::current()->readMSH(fileName);
#if defined(HAVE_POST) #if defined(HAVE_POST)
if(status > 1) status = PView::readMSH(fileName); if(status > 1) status = PView::readMSH(fileName);
......
...@@ -279,7 +279,7 @@ PView *PView::getViewByName(std::string name, int timeStep, int partition) ...@@ -279,7 +279,7 @@ PView *PView::getViewByName(std::string name, int timeStep, int partition)
// search views from most recently to least recently added // search views from most recently to least recently added
for(int i = list.size() - 1; i >= 0; i--){ for(int i = list.size() - 1; i >= 0; i--){
if(list[i]->getData()->getName() == name && if(list[i]->getData()->getName() == name &&
((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) || ((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) &&
(partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition)))) (partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition))))
return list[i]; return list[i];
} }
...@@ -290,7 +290,7 @@ PView *PView::getViewByNum(int num, int timeStep, int partition) ...@@ -290,7 +290,7 @@ PView *PView::getViewByNum(int num, int timeStep, int partition)
{ {
for(unsigned int i = 0; i < list.size(); i++){ for(unsigned int i = 0; i < list.size(); i++){
if(list[i]->getNum() == num && if(list[i]->getNum() == num &&
((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) || ((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) &&
(partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition)))) (partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition))))
return list[i]; return list[i];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment