From cb36a3933319d052724c56d7d204a31daff521ad Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Fri, 29 Jan 2010 10:25:13 +0000
Subject: [PATCH] ENH: sets are now searched for.

Some tools now output sets at the pointsInstance (if relating to geometry),
some at the facesInstance (if relating to topology).
So when loading them we now search for them from current time down
to facesInstance. They cannot be beyond facesInstance.
Adapted Time::findInstance to take optional limiting instance. Adapted
topoSet to use this. Adapted all uses of IOobjectList on sets to do the
same.
---
 .../vtkPV3Foam/vtkPV3FoamUpdateInfo.C         | 31 +++++++++++--------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C b/src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
index 001db69..3608655 100644
--- a/src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
+++ b/src/paraview-plugins/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInfo.C
@@ -400,25 +400,30 @@ void Foam::vtkPV3Foam::updateInfoSets
         Info<< "<beg> Foam::vtkPV3Foam::updateInfoSets" << endl;
     }
 
-    // Add names of sets
-    IOobjectList objects
+    // Add names of sets. Search for last time directory with a sets
+    // subdirectory. Take care not to search beyond the last mesh.
+
+    word facesInstance = dbPtr_().findInstance
     (
-        dbPtr_(),
-        dbPtr_().findInstance(meshDir_, "faces", IOobject::READ_IF_PRESENT),
-        meshDir_/"sets"
+        meshDir_,
+        "faces",
+        IOobject::READ_IF_PRESENT
     );
 
+    word setsInstance = dbPtr_().findInstance
+    (
+        meshDir_/"sets",
+        word::null,
+        IOobject::READ_IF_PRESENT,
+        facesInstance
+    );
+
+    IOobjectList objects(dbPtr_(), setsInstance, meshDir_/"sets");
+
     if (debug)
     {
         Info<< "     Foam::vtkPV3Foam::updateInfoSets read "
-            << objects.names() << " from "
-            <<  dbPtr_().findInstance
-                (
-                    meshDir_,
-                    "faces",
-                    IOobject::READ_IF_PRESENT
-                )
-            << endl;
+            << objects.names() << " from " << setsInstance << endl;
     }
 
 
-- 
GitLab