Skip to content

Commit

Permalink
ENH: partialWrite: support regions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattijs committed Jul 4, 2011
1 parent c06a0fb commit 170e0bc
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/postProcessing/functionObjects/IO/partialWrite/partialWrite.C
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ License
#include "dictionary.H"
#include "Time.H"
#include "IOobjectList.H"
#include "polyMesh.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

Expand Down Expand Up @@ -123,14 +124,26 @@ void Foam::partialWrite::write()
else
{
// Delete all but marked objects
fileName dbDir;
if (isA<polyMesh>(obr_))
{
dbDir = dynamic_cast<const polyMesh&>(obr_).dbDir();
}

IOobjectList objects(obr_, obr_.time().timeName());

forAllConstIter(HashPtrTable<IOobject>, objects, iter)
{
if (!objectNames_.found(iter()->name()))
{
const fileName f = obr_.time().timePath()/iter()->name();
//Pout<< " rm " << f << endl;
const fileName f =
obr_.time().timePath()
/dbDir
/iter()->name();
if (debug)
{
Pout<< " rm " << f << endl;
}
rm(f);
}
}
Expand Down

0 comments on commit 170e0bc

Please sign in to comment.