diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index 6f8712a0b3..097330487e 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 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 + meshDictIO = IOobject ( - new IOobject ( - ( - isDir(dictPath) - ? dictPath/dictName - : dictPath - ), - runTime, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ); - } - else - { - meshDictIoPtr.set - ( - 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 be4fffa8df..b159f9c096 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("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 model(extrudeModel::New(dict)); diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index c2e2a06ebb..89beec32ef 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 - ( - "dict", - "createBafflesDict" - ) - ); + const word dictName("createBafflesDict"); + #include "setSystemMeshDictionaryIO.H" Switch internalFacesOnly(false); @@ -152,17 +141,7 @@ int main(int argc, char *argv[]) PtrList 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 7a969e15d1..9e89c8d4df 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("dict", "createPatchDict") - ); + #include "createNamedPolyMesh.H" + + const word oldInstance = mesh.pointsInstance(); + + const word dictName("createPatchDict"); + #include "setSystemMeshDictionaryIO.H" Info<< "Reading " << dictName << nl << endl; - IOdictionary dict - ( - IOobject - ( - dictName, - runTime.system(), - ( - meshRegionName != polyMesh::defaultRegion - ? meshRegionName - : word::null - ), - runTime, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ); - + 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 f8a206e651..098864102d 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 7eede94626..d03f24cd7c 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 e1cc69aa7e..f4f1250cb1 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 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 c124ca3992..6dee4fd0b5 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 actions(topoSetDict.lookup("actions")); diff --git a/applications/utilities/postProcessing/foamCalc/foamCalcApp.C b/applications/utilities/postProcessing/foamCalc/foamCalcApp.C index 39d0a581d5..3e5c99f3e4 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 24854ab6b6..309d7718f6 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("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 userFields(propsDict.lookup("fields")); \ No newline at end of file +List userFields(propsDict.lookup("fields")); diff --git a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracks.C b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracks.C index 4c1bea3c2d..5a6fad75a6 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 b133509318..e5c6735d8c 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 6b09aa19b9..6641508a57 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("dict", "sampleDict")); + const word dictName("sampleDict"); - IOsampledSets sSets - ( - sampledSets::typeName, - mesh, - sampleDict, - IOobject::MUST_READ_IF_MODIFIED, - true - ); + autoPtr sSetsPtr; + autoPtr sSurfsPtr; - IOsampledSurfaces sSurfs - ( - sampledSurfaces::typeName, - mesh, - sampleDict, - IOobject::MUST_READ_IF_MODIFIED, - true - ); + 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 58bdc7c59c..86ba1b4849 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 b3b390af51..03d1ba874d 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("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 48edfba5d4..ea30c2dd55 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 7c9b3be904..f8a5ebf57a 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 3a14ac63c4..87ff39d182 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 92991b1b1d..18b46f29af 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::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::IOOutputFilter {} +template +Foam::IOOutputFilter::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 diff --git a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H index ebddc142cb..c115023a63 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 ff2dd174e0..0dfb6bf957 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"