From 9ccd5809b88beee3771860c503f63489cc04ad03 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Wed, 5 Dec 2012 15:21:00 +0000
Subject: [PATCH] BUG: sampleDict: missing type

---
 .../mesh/generation/blockMesh/blockMeshApp.C  | 58 +++++------
 .../extrudeToRegionMesh/extrudeToRegionMesh.C | 22 ++---
 .../createBaffles/createBaffles.C             | 31 +-----
 .../manipulation/createPatch/createPatch.C    | 40 ++------
 .../mesh/manipulation/refineMesh/refineMesh.C | 24 ++---
 .../manipulation/renumberMesh/renumberMesh.C  | 28 ++----
 .../mesh/manipulation/subsetMesh/subsetMesh.C | 23 +----
 .../mesh/manipulation/topoSet/topoSet.C       | 41 +-------
 .../postProcessing/foamCalc/foamCalcApp.C     |  9 +-
 .../steadyParticleTracks/createFields.H       | 17 +---
 .../steadyParticleTracks.C                    |  4 +-
 .../execFlowFunctionObjects.C                 |  1 -
 .../postProcessing/sampling/sample/sample.C   | 99 ++++++++++++++-----
 .../postProcessing/sampling/sample/sampleDict |  1 +
 .../surfaceFeatureExtract.C                   | 26 +----
 .../surfaceMeshConvert/surfaceMeshConvert.C   |  1 -
 .../surfaceMeshExport/surfaceMeshExport.C     |  7 +-
 .../surfaceMeshImport/surfaceMeshImport.C     |  7 +-
 .../IOOutputFilter/IOOutputFilter.C           | 28 +++++-
 .../IOOutputFilter/IOOutputFilter.H           | 16 ++-
 src/postProcessing/postCalc/postCalc.C        |  9 +-
 21 files changed, 196 insertions(+), 296 deletions(-)

diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
index 6f8712a0b35..097330487e2 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -104,60 +104,50 @@ int main(int argc, char *argv[])
         polyMeshDir = polyMesh::meshSubDir;
     }
 
-    autoPtr<IOobject> meshDictIoPtr;
+    IOobject meshDictIO
+    (
+        dictName,
+        runTime.constant(),
+        polyMeshDir,
+        runTime,
+        IOobject::MUST_READ,
+        IOobject::NO_WRITE,
+        false
+    );
 
     if (args.optionFound("dict"))
     {
         const fileName dictPath = args["dict"];
 
-        meshDictIoPtr.set
-        (
-            new IOobject
-            (
-                (
-                    isDir(dictPath)
-                  ? dictPath/dictName
-                  : dictPath
-                ),
-                runTime,
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE,
-                false
-            )
-        );
-    }
-    else
-    {
-        meshDictIoPtr.set
+        meshDictIO = IOobject
         (
-            new IOobject
             (
-                dictName,
-                runTime.constant(),
-                polyMeshDir,
-                runTime,
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE,
-                false
-            )
+                isDir(dictPath)
+              ? dictPath/dictName
+              : dictPath
+            ),
+            runTime,
+            IOobject::MUST_READ,
+            IOobject::NO_WRITE,
+            false
         );
     }
 
-    if (!meshDictIoPtr->headerOk())
+    if (!meshDictIO.headerOk())
     {
         FatalErrorIn(args.executable())
             << "Cannot open mesh description file\n    "
-            << meshDictIoPtr->objectPath()
+            << meshDictIO.objectPath()
             << nl
             << exit(FatalError);
     }
 
     Info<< "Creating block mesh from\n    "
-        << meshDictIoPtr->objectPath() << endl;
+        << meshDictIO.objectPath() << endl;
 
     blockMesh::verbose(true);
 
-    IOdictionary meshDict(meshDictIoPtr());
+    IOdictionary meshDict(meshDictIO);
     blockMesh blocks(meshDict, regionName);
 
 
diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
index be4fffa8df2..b159f9c096d 100644
--- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
+++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C
@@ -1241,8 +1241,7 @@ int main(int argc, char *argv[])
 
     #include "addRegionOption.H"
     #include "addOverwriteOption.H"
-    argList::addOption("dict", "name", "specify alternative dictionary");
-
+    #include "addDictOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
     #include "createNamedMesh.H"
@@ -1263,19 +1262,14 @@ int main(int argc, char *argv[])
 
     const word oldInstance = mesh.pointsInstance();
     bool overwrite = args.optionFound("overwrite");
-    const word dictName
-        (args.optionLookupOrDefault<word>("dict", "extrudeToRegionMeshDict"));
 
-    IOdictionary dict
-    (
-        IOobject
-        (
-            dictName,
-            runTime.system(),
-            runTime,
-            IOobject::MUST_READ_IF_MODIFIED
-        )
-    );
+
+    const word dictName("extrudeToRegionMeshDict");
+
+    #include "setSystemMeshDictionaryIO.H"
+
+    IOdictionary dict(dictIO);
+
 
     // Point generator
     autoPtr<extrudeModel> model(extrudeModel::New(dict));
diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
index c2e2a06ebb9..89beec32efe 100644
--- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
+++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C
@@ -117,14 +117,9 @@ int main(int argc, char *argv[])
         "Makes internal faces into boundary faces.\n"
         "Does not duplicate points."
     );
-
+    #include "addDictOption.H"
     #include "addOverwriteOption.H"
-    argList::addOption
-    (
-        "dict",
-        "file",
-        "specify alternative dictionary for the createBaffles description"
-    );
+    #include "addDictOption.H"
     #include "addRegionOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
@@ -136,14 +131,8 @@ int main(int argc, char *argv[])
 
     const word oldInstance = mesh.pointsInstance();
 
-    const word dictName
-    (
-        args.optionLookupOrDefault<word>
-        (
-            "dict",
-            "createBafflesDict"
-        )
-    );
+    const word dictName("createBafflesDict");
+    #include "setSystemMeshDictionaryIO.H"
 
     Switch internalFacesOnly(false);
 
@@ -152,17 +141,7 @@ int main(int argc, char *argv[])
     PtrList<faceSelection> selectors;
     {
         Info<< "Reading baffle criteria from " << dictName << nl << endl;
-        IOdictionary dict
-        (
-            IOobject
-            (
-                dictName,
-                mesh.time().system(),
-                mesh,
-                IOobject::MUST_READ,
-                IOobject::NO_WRITE
-            )
-        );
+        IOdictionary dict(dictIO);
 
         dict.lookup("internalFacesOnly") >> internalFacesOnly;
         noFields = dict.lookupOrDefault("noFields", false);
diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C
index 7a969e15d16..9e89c8d4dfc 100644
--- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C
+++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C
@@ -505,13 +505,7 @@ int main(int argc, char *argv[])
 {
     #include "addOverwriteOption.H"
     #include "addRegionOption.H"
-    argList::addOption
-    (
-        "dict",
-        "word",
-        "name of dictionary to provide patch information"
-    );
-
+    #include "addDictOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
     runTime.functionObjects().off();
@@ -521,38 +515,20 @@ int main(int argc, char *argv[])
 
     const bool overwrite = args.optionFound("overwrite");
 
-    word dictName
-    (
-        args.optionLookupOrDefault<word>("dict", "createPatchDict")
-    );
+    #include "createNamedPolyMesh.H"
 
-    Info<< "Reading " << dictName << nl << endl;
+    const word oldInstance = mesh.pointsInstance();
 
-    IOdictionary dict
-    (
-        IOobject
-        (
-            dictName,
-            runTime.system(),
-            (
-                meshRegionName != polyMesh::defaultRegion
-              ? meshRegionName
-              : word::null
-            ),
-            runTime,
-            IOobject::MUST_READ_IF_MODIFIED,
-            IOobject::NO_WRITE,
-            false
-        )
-    );
+    const word dictName("createPatchDict");
+    #include "setSystemMeshDictionaryIO.H"
 
+    Info<< "Reading " << dictName << nl << endl;
+
+    IOdictionary dict(dictIO);
 
     // Whether to synchronise points
     const Switch pointSync(dict.lookup("pointSync"));
 
-    #include "createNamedPolyMesh.H"
-
-    const word oldInstance = mesh.pointsInstance();
 
     const polyBoundaryMesh& patches = mesh.boundaryMesh();
 
diff --git a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C
index f8a206e651c..098864102d6 100644
--- a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C
+++ b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C
@@ -298,12 +298,7 @@ int main(int argc, char *argv[])
 
     #include "addOverwriteOption.H"
     #include "addRegionOption.H"
-    argList::addBoolOption
-    (
-        "dict",
-        "refine according to system/refineMeshDict"
-    );
-
+    #include "addDictOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
     runTime.functionObjects().off();
@@ -327,19 +322,12 @@ int main(int argc, char *argv[])
 
     if (readDict)
     {
-        Info<< "Refining according to refineMeshDict" << nl << endl;
+        const word dictName("refineMeshDict");
+        #include "setSystemMeshDictionaryIO.H"
 
-        refineDict = IOdictionary
-        (
-            IOobject
-            (
-                "refineMeshDict",
-                runTime.system(),
-                mesh,
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE
-            )
-        );
+        Info<< "Refining according to " << dictName << nl << endl;
+
+        refineDict = IOdictionary(dictIO);
 
         const word setName(refineDict.lookup("set"));
 
diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
index 7eede94626c..d03f24cd7c2 100644
--- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
+++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
@@ -614,11 +614,7 @@ int main(int argc, char *argv[])
 #   include "addRegionOption.H"
 #   include "addOverwriteOption.H"
 #   include "addTimeOptions.H"
-    argList::addBoolOption
-    (
-        "dict",
-        "renumber according to system/renumberMeshDict"
-    );
+#   include "addDictOption.H"
     argList::addBoolOption
     (
         "frontWidth",
@@ -700,23 +696,13 @@ int main(int argc, char *argv[])
 
     if (readDict)
     {
-        Info<< "Renumber according to renumberMeshDict." << nl << endl;
+        const word dictName("renumberMeshDict");
+        #include "setSystemMeshDictionaryIO.H"
 
-        renumberDictPtr.reset
-        (
-            new IOdictionary
-            (
-                IOobject
-                (
-                    "renumberMeshDict",
-                    runTime.system(),
-                    mesh,
-                    IOobject::MUST_READ_IF_MODIFIED,
-                    IOobject::NO_WRITE
-                )
-            )
-        );
-        const IOdictionary renumberDict = renumberDictPtr();
+        Info<< "Renumber according to " << dictName << nl << endl;
+
+        renumberDictPtr.reset(new IOdictionary(dictIO));
+        const IOdictionary& renumberDict = renumberDictPtr();
 
         renumberPtr = renumberMethod::New(renumberDict);
 
diff --git a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C
index e1cc69aa7e2..f4f1250cb1a 100644
--- a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C
+++ b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C
@@ -155,12 +155,7 @@ int main(int argc, char *argv[])
         "select a mesh subset based on a provided cellSet and/or"
         " selection criteria"
     );
-    argList::addBoolOption
-    (
-        "dict",
-        "read mesh subset selection criteria"
-        " from system/subsetMeshDict"
-    );
+    #include "addDictOption.H"
     argList::addOption
     (
         "cellSet",
@@ -210,18 +205,10 @@ int main(int argc, char *argv[])
     PtrList<cellSelection> selectors;
     if (useDict)
     {
-        Info<< "Reading selection criteria from subsetMeshDict" << nl << endl;
-        IOdictionary dict
-        (
-            IOobject
-            (
-                "subsetMeshDict",
-                mesh.time().system(),
-                mesh,
-                IOobject::MUST_READ,
-                IOobject::NO_WRITE
-            )
-        );
+        const word dictName("subsetMeshDict");
+        #include "setSystemMeshDictionaryIO.H"
+        Info<< "Reading selection criteria from " << dictName << nl << endl;
+        IOdictionary dict(dictIO);
 
         const dictionary& selectionsDict = dict.subDict("selections");
 
diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSet.C b/applications/utilities/mesh/manipulation/topoSet/topoSet.C
index c124ca39923..6dee4fd0b50 100644
--- a/applications/utilities/mesh/manipulation/topoSet/topoSet.C
+++ b/applications/utilities/mesh/manipulation/topoSet/topoSet.C
@@ -193,12 +193,7 @@ polyMesh::readUpdateState meshReadUpdate(polyMesh& mesh)
 int main(int argc, char *argv[])
 {
     timeSelector::addOptions(true, false);
-    argList::addOption
-    (
-        "dict",
-        "file",
-        "specify an alternative dictionary for the topoSet dictionary"
-    );
+    #include "addDictOption.H"
     #include "addRegionOption.H"
     argList::addBoolOption
     (
@@ -216,41 +211,11 @@ int main(int argc, char *argv[])
     const bool noSync = args.optionFound("noSync");
 
     const word dictName("topoSetDict");
-
-    fileName dictPath = dictName;
-    if (args.optionFound("dict"))
-    {
-        dictPath = args["dict"];
-        if (isDir(dictPath))
-        {
-            dictPath = dictPath / dictName;
-        }
-    }
+    #include "setSystemMeshDictionaryIO.H"
 
     Info<< "Reading " << dictName << "\n" << endl;
 
-    IOdictionary topoSetDict
-    (
-        (
-            args.optionFound("dict")
-          ? IOobject
-            (
-                dictPath,
-                mesh,
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE
-            )
-          : IOobject
-            (
-                dictName,
-                runTime.system(),
-                mesh,
-                IOobject::MUST_READ_IF_MODIFIED,
-                IOobject::NO_WRITE
-            )
-        )
-    );
-
+    IOdictionary topoSetDict(dictIO);
 
     // Read set construct info from dictionary
     PtrList<dictionary> actions(topoSetDict.lookup("actions"));
diff --git a/applications/utilities/postProcessing/foamCalc/foamCalcApp.C b/applications/utilities/postProcessing/foamCalc/foamCalcApp.C
index 39d0a581d50..3e5c99f3e43 100644
--- a/applications/utilities/postProcessing/foamCalc/foamCalcApp.C
+++ b/applications/utilities/postProcessing/foamCalc/foamCalcApp.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -49,12 +49,7 @@ int main(int argc, char *argv[])
         "noWrite",
         "suppress writing results"
     );
-    Foam::argList::addOption
-    (
-        "dict",
-        "name",
-        "dictionary to use"
-    );
+#   include "addDictOption.H"
 
     if (argc < 2)
     {
diff --git a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/createFields.H b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/createFields.H
index 24854ab6b60..309d7718f66 100644
--- a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/createFields.H
+++ b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/createFields.H
@@ -1,16 +1,9 @@
-word dictName(args.optionLookupOrDefault<word>("dict", "particleTrackDict"));
+const word dictName("particleTrackDict");
 
-IOdictionary propsDict
-(
-    IOobject
-    (
-        dictName,
-        runTime.constant(),
-        mesh,
-        IOobject::MUST_READ_IF_MODIFIED
-    )
-);
+#include "setConstantMeshDictionaryIO.H"
+
+IOdictionary propsDict(dictIO);
 
 word cloudName(propsDict.lookup("cloudName"));
 
-List<word> userFields(propsDict.lookup("fields"));
\ No newline at end of file
+List<word> userFields(propsDict.lookup("fields"));
diff --git a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracks.C b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracks.C
index 4c1bea3c2d0..5a6fad75a69 100644
--- a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracks.C
+++ b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracks.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
     argList::noParallel();
     timeSelector::addOptions();
     #include "addRegionOption.H"
-    argList::validOptions.insert("dict", "");
+    #include "addDictOption.H"
 
     #include "setRootCase.H"
 
diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
index b133509318a..e5c6735d8c8 100644
--- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
+++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C
@@ -65,7 +65,6 @@ namespace Foam
                 IOobject
                 (
                     args["dict"],
-                    runTime.system(),
                     runTime,
                     IOobject::MUST_READ_IF_MODIFIED
                 )
diff --git a/applications/utilities/postProcessing/sampling/sample/sample.C b/applications/utilities/postProcessing/sampling/sample/sample.C
index 6b09aa19b9b..6641508a573 100644
--- a/applications/utilities/postProcessing/sampling/sample/sample.C
+++ b/applications/utilities/postProcessing/sampling/sample/sample.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -97,37 +97,82 @@ int main(int argc, char *argv[])
 {
     timeSelector::addOptions();
     #include "addRegionOption.H"
-    argList::addOption
-    (
-        "dict",
-        "word",
-        "name of dictionary to provide sample information"
-    );
-
+    #include "addDictOption.H"
     #include "setRootCase.H"
     #include "createTime.H"
     instantList timeDirs = timeSelector::select0(runTime, args);
     #include "createNamedMesh.H"
 
-    word sampleDict(args.optionLookupOrDefault<word>("dict", "sampleDict"));
-
-    IOsampledSets sSets
-    (
-        sampledSets::typeName,
-        mesh,
-        sampleDict,
-        IOobject::MUST_READ_IF_MODIFIED,
-        true
-    );
-
-    IOsampledSurfaces sSurfs
-    (
-        sampledSurfaces::typeName,
-        mesh,
-        sampleDict,
-        IOobject::MUST_READ_IF_MODIFIED,
-        true
-    );
+    const word dictName("sampleDict");
+
+    autoPtr<IOsampledSets> sSetsPtr;
+    autoPtr<IOsampledSurfaces> sSurfsPtr;
+
+    if (args.optionFound("dict"))
+    {
+        // Construct from fileName
+
+        fileName dictPath = args["dict"];
+        if (isDir(dictPath))
+        {
+            dictPath = dictPath / dictName;
+        }
+
+        sSetsPtr.reset
+        (
+            new IOsampledSets
+            (
+                sampledSets::typeName,
+                mesh,
+                dictPath,
+                IOobject::MUST_READ_IF_MODIFIED,
+                true
+            )
+        );
+
+        sSurfsPtr.reset
+        (
+            new IOsampledSurfaces
+            (
+                sampledSurfaces::typeName,
+                mesh,
+                dictPath,
+                IOobject::MUST_READ_IF_MODIFIED,
+                true
+            )
+        );
+    }
+    else
+    {
+        // Construct from name in system() directory
+
+        sSetsPtr.reset
+        (
+            new IOsampledSets
+            (
+                sampledSets::typeName,
+                mesh,
+                dictName,
+                IOobject::MUST_READ_IF_MODIFIED,
+                true
+            )
+        );
+
+        sSurfsPtr.reset
+        (
+            new IOsampledSurfaces
+            (
+                sampledSurfaces::typeName,
+                mesh,
+                dictName,
+                IOobject::MUST_READ_IF_MODIFIED,
+                true
+            )
+        );
+    }
+
+    IOsampledSets& sSets = sSetsPtr();
+    IOsampledSurfaces& sSurfs = sSurfsPtr();
 
     forAll(timeDirs, timeI)
     {
diff --git a/applications/utilities/postProcessing/sampling/sample/sampleDict b/applications/utilities/postProcessing/sampling/sample/sampleDict
index 58bdc7c59ce..86ba1b4849f 100644
--- a/applications/utilities/postProcessing/sampling/sample/sampleDict
+++ b/applications/utilities/postProcessing/sampling/sample/sampleDict
@@ -140,6 +140,7 @@ sets
 
     patchSeed
     {
+        type        patchSeed;
         patches     (".*Wall.*");
         // Number of points to seed. Divided amongst all processors according
         // to fraction of patches they hold.
diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
index b3b390af515..03d1ba874d1 100644
--- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
+++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C
@@ -680,35 +680,17 @@ int main(int argc, char *argv[])
     );
     argList::noParallel();
 
-    argList::addOption
-    (
-        "dict",
-        "word",
-        "specify alternative dictionary for the feature extraction information"
-    );
+#   include "addDictOption.H"
 
 #   include "setRootCase.H"
 #   include "createTime.H"
 
-    word dictName
-    (
-        args.optionLookupOrDefault<word>("dict", "surfaceFeatureExtractDict")
-    );
+    const word dictName("surfaceFeatureExtractDict");
+#   include "setSystemRunTimeDictionaryIO.H"
 
     Info<< "Reading " << dictName << nl << endl;
 
-    IOdictionary dict
-    (
-        IOobject
-        (
-            dictName,
-            runTime.system(),
-            runTime,
-            IOobject::MUST_READ,
-            IOobject::NO_WRITE,
-            false
-        )
-    );
+    const IOdictionary dict(dictIO);
 
     forAllConstIter(dictionary, dict, iter)
     {
diff --git a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
index 48edfba5d4c..ea30c2dd55d 100644
--- a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
+++ b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C
@@ -97,7 +97,6 @@ int main(int argc, char *argv[])
         "geometry scaling factor on output"
     );
     #include "addDictOption.H"
-
     argList::addOption
     (
         "from",
diff --git a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
index 7c9b3be904d..f8a5ebf57a2 100644
--- a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
+++ b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C
@@ -103,12 +103,7 @@ int main(int argc, char *argv[])
         "factor",
         "geometry scaling factor on output - default is 1"
     );
-    argList::addOption
-    (
-        "dict",
-        "file",
-        "specify an alternative dictionary for constant/coordinateSystems"
-    );
+    #include "addDictOption.H"
     argList::addOption
     (
         "from",
diff --git a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C
index 3a14ac63c42..87ff39d182e 100644
--- a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C
+++ b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C
@@ -103,12 +103,7 @@ int main(int argc, char *argv[])
         "factor",
         "geometry scaling factor on output - default is 1"
     );
-    argList::addOption
-    (
-        "dict",
-        "file",
-        "specify an alternative dictionary for constant/coordinateSystems"
-    );
+    #include "addDictOption.H"
     argList::addOption
     (
         "from",
diff --git a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C
index 92991b1b1d0..18b46f29af8 100644
--- a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C
+++ b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -46,7 +46,7 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
 (
     const word& outputFilterName,
     const objectRegistry& obr,
-    const fileName& dictName,
+    const word& dictName,
     const IOobject::readOption rOpt,
     const bool readFromFiles
 )
@@ -66,6 +66,30 @@ Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
 {}
 
 
+template<class OutputFilter>
+Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
+(
+    const word& outputFilterName,
+    const objectRegistry& obr,
+    const fileName& dictName,
+    const IOobject::readOption rOpt,
+    const bool readFromFiles
+)
+:
+    IOdictionary
+    (
+        IOobject
+        (
+            dictName,
+            obr,
+            rOpt,
+            IOobject::NO_WRITE
+        )
+    ),
+    OutputFilter(outputFilterName, obr, *this, readFromFiles)
+{}
+
+
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 template<class OutputFilter>
diff --git a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H
index ebddc142cb2..c115023a635 100644
--- a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H
+++ b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -89,7 +89,19 @@ public:
         (
             const word& outputFilterName,
             const objectRegistry&,
-            const fileName& dictName = OutputFilter::typeName() + "Dict",
+            const word& dictName = OutputFilter::typeName() + "Dict",
+            const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED,
+            const bool loadFromFile = false
+        );
+
+        //- Construct for given objectRegistry and dictionary
+        //  Dictionary read from full path.
+        //  Allow the possibility to load fields from files
+        IOOutputFilter
+        (
+            const word& outputFilterName,
+            const objectRegistry&,
+            const fileName& dictName,
             const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED,
             const bool loadFromFile = false
         );
diff --git a/src/postProcessing/postCalc/postCalc.C b/src/postProcessing/postCalc/postCalc.C
index ff2dd174e07..0dfb6bf9570 100644
--- a/src/postProcessing/postCalc/postCalc.C
+++ b/src/postProcessing/postCalc/postCalc.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2012 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -68,12 +68,7 @@ int main(int argc, char *argv[])
         "noFlow",
         "suppress creating flow models (execFlowFunctionObjects only)"
     );
-    Foam::argList::addOption
-    (
-        "dict",
-        "name",
-        "dictionary to use"
-    );
+    #include "addDictOption.H"
 
     #include "setRootCase.H"
     #include "createTime.H"
-- 
GitLab