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.
This commit is contained in:
mattijs
2010-01-29 10:25:13 +00:00
parent e931525a0f
commit 8b7f6666ca
14 changed files with 182 additions and 54 deletions

View File

@ -304,7 +304,13 @@ void printAllSets(const polyMesh& mesh, Ostream& os)
IOobjectList objects
(
mesh,
mesh.pointsInstance(),
mesh.time().findInstance
(
polyMesh::meshSubDir/"sets",
word::null,
IOobject::READ_IF_PRESENT,
mesh.facesInstance()
),
polyMesh::meshSubDir/"sets"
);
IOobjectList cellSets(objects.lookupClass(cellSet::typeName));
@ -417,7 +423,13 @@ void removeSet
IOobjectList objects
(
mesh,
mesh.pointsInstance(),
mesh.time().findInstance
(
polyMesh::meshSubDir/"sets",
word::null,
IOobject::READ_IF_PRESENT,
mesh.facesInstance()
),
polyMesh::meshSubDir/"sets"
);

View File

@ -81,14 +81,17 @@ int main(int argc, char *argv[])
# include "createNamedPolyMesh.H"
// Search for list of objects for the time of the mesh
IOobjectList objects
word setsInstance = runTime.findInstance
(
mesh,
mesh.pointsInstance(),
polyMesh::meshSubDir/"sets"
polyMesh::meshSubDir/"sets",
word::null,
IOobject::MUST_READ,
mesh.facesInstance()
);
Info<< "Searched : " << mesh.pointsInstance()/polyMesh::meshSubDir/"sets"
IOobjectList objects(mesh, setsInstance, polyMesh::meshSubDir/"sets");
Info<< "Searched : " << setsInstance/polyMesh::meshSubDir/"sets"
<< nl
<< "Found : " << objects.names() << nl
<< endl;