diff --git a/etc/caseDicts/postProcessing/README b/etc/caseDicts/postProcessing/README deleted file mode 100644 index 6a33e3bf87cd16c3c4b3818d914acdc400c6a11e..0000000000000000000000000000000000000000 --- a/etc/caseDicts/postProcessing/README +++ /dev/null @@ -1,52 +0,0 @@ -Overview -======== -- This directory contains files to help post-processing of OpenFOAM cases -- It primariy "packages" functionObject functionality in a convenient form for - users to plug into their OpenFOAM cases -- While some tools are quite generic, e.g. minMax, others are more application- - oriented, e.g. flowRate. - -How the tools work -================== -- The configuration of functionObjects includes both required input data and - control parameters for the functionObject -- This creates a lot of input that can be confusing to users -- The tools here are packaged so that the user input is separated from control - parameters -- Control parameters are pre-configured in .cfg files - users can ignore these - files -- For each tool, required user input is all in one file, for the users to copy - into their case and set accordingly - -Example of how to use the tools -=============================== -Task: monitor flow rate at an outlet patch named "outlet" for a case -Solution: -- locate the flowRatePatch tool in the flowRate directory -- copy the flowRatePatch file into the case system directory (not - flowRatePatch.cfg) -- edit system/flowRatePatch to set the patch name - replace "name <patchName>;" - with "name outlet;" -- activate the function object by including the flowRatePatch file in functions - sub-dictionary in the case controlDict file, e.g. - functions - { - #includeFunc flowRatePatch - ... other function objects here ... - } - -Current tools -============= -- fields calculate specific fields, e.g. Q -- flowRate tools to calculate flow rate -- forces forces and forceCoeffs for incompressible/compressible flows -- graphs simple sampling for graph plotting, e.g. singleGraph -- minMax range of minimum and maximum field monitoring, e.g. cellMax -- numerical outputs information relating to numerics, e.g. residuals -- pressure calculates different forms of pressure, pressure drop, etc -- probes options for probing data -- scalarTransport for plugin scalar transport calculations -- visualization post-processing VTK files for cutting planes, streamlines,... - -- surfaceRegion configuration for some of the tools above diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index d54bf8b6252803e32001d126d002dad9545d7182..105e2f6aea4cc6a0daa245c3aa357ab3c12c2580 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -72,6 +72,35 @@ Foam::functionObject* Foam::functionObjectList::remove } +void Foam::functionObjectList::listDir +( + const fileName& dir, + HashSet<word>& foMap +) +{ + // Search specified directory for functionObject configuration files + { + fileNameList foFiles(readDir(dir)); + forAll(foFiles, f) + { + if (foFiles[f].ext().empty()) + { + foMap.insert(foFiles[f]); + } + } + } + + // Recurse into sub-directories + { + fileNameList foDirs(readDir(dir, fileName::DIRECTORY)); + forAll(foDirs, fd) + { + listDir(dir/foDirs[fd], foMap); + } + } +} + + void Foam::functionObjectList::list() { HashSet<word> foMap; @@ -80,20 +109,7 @@ void Foam::functionObjectList::list() forAll(etcDirs, ed) { - fileNameList foDirs(readDir(etcDirs[ed], fileName::DIRECTORY)); - forAll(foDirs, fd) - { - fileNameList foFiles(readDir(etcDirs[ed]/foDirs[fd])); - { - forAll(foFiles, f) - { - if (foFiles[f].ext().empty()) - { - foMap.insert(foFiles[f]); - } - } - } - } + listDir(etcDirs[ed], foMap); } Info<< nl diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index 88e3ac8c9a57ff580e6be95db3ff05c52b5048ee..4bfaa70214f281d7d066263fc5807db4cc504047 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -74,7 +74,7 @@ class functionObjectList //- The parent dictionary containing a "functions" entry // This entry can either be a list or a dictionary of - // functionObject specifications. + // functionObject specifications const dictionary& parentDict_; //- Switch for the execution of the functionObjects @@ -88,9 +88,13 @@ class functionObjectList //- Remove and return the function object pointer by name, // and returns the old index via the parameter. - // Returns a NULL pointer (and index -1) if it didn't exist. + // Returns a NULL pointer (and index -1) if it didn't exist functionObject* remove(const word&, label& oldIndex); + //- Search the specified directory for functionObject + // configuration files, add to the given map and recurse + static void listDir(const fileName& dir, HashSet<word>& foMap); + //- Disallow default bitwise copy construct functionObjectList(const functionObjectList&);