Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENH: partialWrite: support lagrangian

  • Loading branch information...
commit eae0ee7fc2e1de9f190fec58b9889c27bb1fbd5e 1 parent bc2018f
mattijs authored
View
20 src/postProcessing/functionObjects/IO/controlDict
@@ -15,6 +15,10 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// So we get a decent warning if we have multiple functionObject entries
+// with the same name.
+#inputMode error;
+
application icoFoam;
startFrom startTime;
@@ -57,11 +61,16 @@ functions
// Where to load it from
functionObjectLibs ("libIOFunctionObjects.so");
+ // Optional mesh region to operate on. Only one partialWrite per
+ // region allowed.
+ region wallFilmRegion;
+
// Execute upon outputTime
outputControl outputTime;
-
- // Objects to write every outputTime
- objectNames (p);
+
+ // Objects (fields or lagrangian fields in any of the clouds)
+ // to write every outputTime
+ objectNames (p positions nParticle);
// Write as normal every writeInterval'th outputTime.
writeInterval 3;
}
@@ -69,7 +78,7 @@ functions
dumpObjects
{
// Forcibly write registered objects. E.g. fields that have been
- // created with NO_READ.
+ // created with NO_WRITE.
type writeRegisteredObject;
@@ -78,11 +87,10 @@ functions
// Execute upon outputTime
outputControl outputTime;
-
+
// Objects to write
objectNames ();
}
}
-
// ************************************************************************* //
View
49 src/postProcessing/functionObjects/IO/partialWrite/partialWrite.C
@@ -28,6 +28,7 @@ License
#include "Time.H"
#include "IOobjectList.H"
#include "polyMesh.H"
+#include "cloud.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@@ -132,7 +133,12 @@ void Foam::partialWrite::write()
IOobjectList objects(obr_, obr_.time().timeName());
- forAllConstIter(HashPtrTable<IOobject>, objects, iter)
+ if (debug)
+ {
+ Pout<< "For region:" << obr_.name() << endl;
+ }
+
+ forAllConstIter(IOobjectList, objects, iter)
{
if (!objectNames_.found(iter()->name()))
{
@@ -147,6 +153,47 @@ void Foam::partialWrite::write()
rm(f);
}
}
+
+ // Do the lagrangian files as well.
+ fileNameList cloudDirs
+ (
+ readDir
+ (
+ obr_.time().timePath()/dbDir/cloud::prefix,
+ fileName::DIRECTORY
+ )
+ );
+ forAll(cloudDirs, i)
+ {
+ if (debug)
+ {
+ Pout<< "For cloud:" << cloudDirs[i] << endl;
+ }
+
+ IOobjectList sprayObjs
+ (
+ obr_,
+ obr_.time().timeName(),
+ cloud::prefix/cloudDirs[i]
+ );
+ forAllConstIter(IOobjectList, sprayObjs, iter)
+ {
+ if (!objectNames_.found(iter()->name()))
+ {
+ const fileName f =
+ obr_.time().timePath()
+ /dbDir
+ /cloud::prefix
+ /cloudDirs[i]
+ /iter()->name();
+ if (debug)
+ {
+ Pout<< " rm " << f << endl;
+ }
+ rm(f);
+ }
+ }
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.