diff --git a/Post/PView.cpp b/Post/PView.cpp
index e595c21407e0e802a67ccac9e3a8c6662b139f51..da83000e24df98a0d3f613e482bdb000eb6021f9 100644
--- a/Post/PView.cpp
+++ b/Post/PView.cpp
@@ -278,7 +278,7 @@ PView *PView::getViewByName(std::string name, int timeStep, int partition)
   for(unsigned int i = 0; i < list.size(); i++){
     if(list[i]->getData()->getName() == name &&
        ((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) ||
-        (partition < 0 || !list[i]->getData()->hasPartition(partition))))
+        (partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition))))
       return list[i];
   }
   return 0;
@@ -289,7 +289,7 @@ PView *PView::getViewByNum(int num, int timeStep, int partition)
   for(unsigned int i = 0; i < list.size(); i++){
     if(list[i]->getNum() == num &&
        ((timeStep < 0 || !list[i]->getData()->hasTimeStep(timeStep)) ||
-        (partition < 0 || !list[i]->getData()->hasPartition(partition))))
+        (partition < 0 || !list[i]->getData()->hasPartition(timeStep, partition))))
       return list[i];
   }
   return 0;
diff --git a/Post/PViewData.h b/Post/PViewData.h
index ab542330d5becb253f16eb9536746ace1498f6cb..e97dc2bb0454976049adf0c136c95cf97f6e9a96 100644
--- a/Post/PViewData.h
+++ b/Post/PViewData.h
@@ -164,7 +164,7 @@ class PViewData {
 
   // check if the data has the given step/partition/etc.
   virtual bool hasTimeStep(int step){ return step >= 0 && step < getNumTimeSteps(); }
-  virtual bool hasPartition(int part){ return false; }
+  virtual bool hasPartition(int step, int part){ return false; }
   virtual bool hasMultipleMeshes(){ return false; }
   virtual bool hasModel(GModel *model, int step=-1){ return false; }
 
diff --git a/Post/PViewDataGModel.cpp b/Post/PViewDataGModel.cpp
index bb8b3103051c09bdc830cd2f99ac53e6db26eebd..926a081002b63e3b9416e3c85542b95ca591f305 100644
--- a/Post/PViewDataGModel.cpp
+++ b/Post/PViewDataGModel.cpp
@@ -500,9 +500,11 @@ bool PViewDataGModel::hasTimeStep(int step)
   return false;
 }
 
-bool PViewDataGModel::hasPartition(int part)
+bool PViewDataGModel::hasPartition(int step, int part)
 {
-  return _partitions.find(part) != _partitions.end();
+  if(step < 0 || step >= getNumTimeSteps())
+    return false;
+  return _steps[step]->getPartitions().find(part) != _steps[step]->getPartitions().end();
 }
 
 bool PViewDataGModel::hasMultipleMeshes()
diff --git a/Post/PViewDataGModel.h b/Post/PViewDataGModel.h
index 293c79b344f20a465d456881dbec081cefe192fb..49118a32d186e0e28d404e0be068cfcebdbc6fe9 100644
--- a/Post/PViewDataGModel.h
+++ b/Post/PViewDataGModel.h
@@ -38,6 +38,8 @@ class stepData{
   // a vector, indexed by MSH element type, of Gauss point locations
   // in parametric space
   std::vector<std::vector<double> > _gaussPoints;
+  // a set of all "partitions" encountered in the data
+  std::set<int> _partitions;
  public:
   stepData(GModel *model, int numComp, std::string fileName="", int fileIndex=-1, 
            double time=0., double min=VAL_INF, double max=-VAL_INF)
@@ -101,6 +103,7 @@ class stepData{
     if((int)_gaussPoints.size() <= msh) _gaussPoints.resize(msh + 1);
     return _gaussPoints[msh];
   }
+  std::set<int> &getPartitions(){ return _partitions; }
 };
 
 // The data container using elements from one or more GModel(s).
@@ -117,8 +120,6 @@ class PViewDataGModel : public PViewData {
   std::vector<stepData<double>*> _steps;
   // the global min/max of the view
   double _min, _max;
-  // a set of all "partitions" encountered in the input data
-  std::set<int> _partitions;
   // the type of the dataset
   DataType _type;
   // cache last element to speed up loops
@@ -168,7 +169,7 @@ class PViewDataGModel : public PViewData {
   bool skipEntity(int step, int ent);
   bool skipElement(int step, int ent, int ele, bool checkVisibility=false);
   bool hasTimeStep(int step);
-  bool hasPartition(int part);
+  bool hasPartition(int step, int part);
   bool hasMultipleMeshes();
   bool hasModel(GModel *model, int step=-1);
   bool useGaussPoints(){ return _type == GaussPointData; }
diff --git a/Post/PViewDataGModelIO.cpp b/Post/PViewDataGModelIO.cpp
index 5315c00013f50e5d5cd375eaa5f203f2bb88cb82..69ed6c2ca85c19b647106ee0b72b6174deebcd9d 100644
--- a/Post/PViewDataGModelIO.cpp
+++ b/Post/PViewDataGModelIO.cpp
@@ -39,7 +39,7 @@ bool PViewDataGModel::addData(GModel *model, std::map<int, std::vector<double> >
     for(int j = 0; j < numComp; j++)
       d[j] = it->second[j];
   }
-  _partitions.insert(partition);
+  _steps[step]->getPartitions().insert(partition);
   finalize();
   return true;
 }
@@ -49,7 +49,7 @@ bool PViewDataGModel::readMSH(std::string fileName, int fileIndex, FILE *fp,
                               int partition, int numComp, int numEnt)
 {
   Msg::Info("Reading step %d (time %g) partition %d: %d records", 
-      step, time, partition, numEnt);
+            step, time, partition, numEnt);
 
   while(step >= (int)_steps.size())
     _steps.push_back(new stepData<double>(GModel::current(), numComp));
@@ -100,7 +100,7 @@ bool PViewDataGModel::readMSH(std::string fileName, int fileIndex, FILE *fp,
       Msg::ProgressMeter(i + 1, numEnt, "Reading data");
   }
 
-  _partitions.insert(partition);
+  _steps[step]->getPartitions().insert(partition);
 
   finalize();
   return true;