diff --git a/applications/utilities/postProcessing/postProcess/postProcess.C b/applications/utilities/postProcessing/postProcess/postProcess.C index d0c998aeb2..ca6d2e44be 100644 --- a/applications/utilities/postProcessing/postProcess/postProcess.C +++ b/applications/utilities/postProcessing/postProcess/postProcess.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -163,12 +163,18 @@ int main(int argc, char *argv[]) // Externally stored dictionary for functionObjectList // if not constructed from runTime - dictionary functionsDict; + dictionary functionsControlDict("controlDict"); // Construct functionObjectList autoPtr functionsPtr ( - functionObjectList::New(args, runTime, functionsDict, selectedFields) + functionObjectList::New + ( + args, + runTime, + functionsControlDict, + selectedFields + ) ); forAll(timeDirs, timei) @@ -184,7 +190,7 @@ int main(int argc, char *argv[]) ( args, runTime, - functionsDict, + functionsControlDict, selectedFields ); } diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index c2cfdf0f7a..8843e02a33 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -335,9 +335,11 @@ bool Foam::functionObjectList::readFunctionObject } // Merge this functionObject dictionary into functionsDict + const word funcNameArgsWord = string::validate(funcNameArgs); dictionary funcArgsDict; - funcArgsDict.add(string::validate(funcNameArgs), funcDict); + funcArgsDict.add(funcNameArgsWord, funcDict); functionsDict.merge(funcArgsDict); + functionsDict.subDict(funcNameArgsWord).name() = funcDict.name(); return true; } diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H b/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H index 06f7aa3f4e..c57d4a0bab 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/postProcess.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,14 +94,20 @@ if (argList::postProcess(argc, argv)) // Externally stored dictionary for functionObjectList // if not constructed from runTime - dictionary functionsDict; + dictionary functionsControlDict("controlDict"); HashSet selectedFields; // Construct functionObjectList autoPtr functionsPtr ( - functionObjectList::New(args, runTime, functionsDict, selectedFields) + functionObjectList::New + ( + args, + runTime, + functionsControlDict, + selectedFields + ) ); forAll(timeDirs, timei) @@ -117,7 +123,7 @@ if (argList::postProcess(argc, argv)) ( args, runTime, - functionsDict, + functionsControlDict, selectedFields ); } diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.C b/src/sampling/sampledSet/sampledSet/sampledSet.C index c9fb2cbc12..58b472865e 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.C +++ b/src/sampling/sampledSet/sampledSet/sampledSet.C @@ -27,6 +27,10 @@ License #include "polyMesh.H" #include "meshSearch.H" #include "writer.H" +#include "lineCellSet.H" +#include "lineCellFaceSet.H" +#include "lineFaceSet.H" +#include "lineUniformSet.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -138,15 +142,37 @@ Foam::autoPtr Foam::sampledSet::New { const word sampleType(dict.lookup("type")); + const HashTable oldToNewType = + { + Tuple2("midPoint", lineCellSet::typeName), + Tuple2("midPointAndFace", lineCellFaceSet::typeName), + Tuple2("face", lineFaceSet::typeName), + Tuple2("uniform", lineUniformSet::typeName) + }; + + if (oldToNewType.found(sampleType)) + { + const word newSampleType = oldToNewType[sampleType]; + + FatalErrorInFunction + << "Unknown sample set type " + << sampleType << nl << nl + << "The sample set type " << sampleType << " has been renamed " + << newSampleType << nl << nl + << "Replace \"type " << sampleType << ";\" with \"type " + << newSampleType << ";\" for the set " << name << " in " + << dict.name() << exit(FatalError); + } + wordConstructorTable::iterator cstrIter = wordConstructorTablePtr_->find(sampleType); if (cstrIter == wordConstructorTablePtr_->end()) { FatalErrorInFunction - << "Unknown sample type " + << "Unknown sample set type " << sampleType << nl << nl - << "Valid sample types : " << endl + << "Valid sample set types : " << endl << wordConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/sampling/sampledSet/sampledSet/sampledSet.H b/src/sampling/sampledSet/sampledSet/sampledSet.H index 119eb459a4..e1b6e8384f 100644 --- a/src/sampling/sampledSet/sampledSet/sampledSet.H +++ b/src/sampling/sampledSet/sampledSet/sampledSet.H @@ -74,6 +74,8 @@ class sampledSet protected: + // Protected data + //- Segment numbers labelList segments_;