diff --git a/applications/utilities/postProcessing/postProcess/postProcess.C b/applications/utilities/postProcessing/postProcess/postProcess.C index 884fe1d398..d95e3c49a7 100644 --- a/applications/utilities/postProcessing/postProcess/postProcess.C +++ b/applications/utilities/postProcessing/postProcess/postProcess.C @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) args, runTime, functionsDict, - fields.selection() + fields ) ); @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) args, runTime, functionsDict, - fields.selection() + fields ); } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C index 288c188904..381c1d244f 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C @@ -54,7 +54,7 @@ bool Foam::functionEntries::includeFuncEntry::execute ) { const word fNameArgs(is); - HashSet selectedFields; + HashSet selectedFields; return functionObjectList::readFunctionObject ( diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 98174a669e..bb1d7c7e9b 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -176,7 +176,7 @@ bool Foam::functionObjectList::readFunctionObject ( const string& funcNameArgs, dictionary& functionsDict, - HashSet& requiredFields, + HashSet& requiredFields, const word& region ) { @@ -190,7 +190,7 @@ bool Foam::functionObjectList::readFunctionObject word funcName(funcNameArgs); int argLevel = 0; - wordList args; + wordReList args; List> namedArgs; bool namedArg = false; @@ -237,9 +237,12 @@ bool Foam::functionObjectList::readFunctionObject { args.append ( - word::validate + wordRe ( - funcNameArgs.substr(start, i - start) + word::validate + ( + funcNameArgs.substr(start, i - start) + ) ) ); } @@ -310,11 +313,11 @@ bool Foam::functionObjectList::readFunctionObject } else if (funcDict.found("field")) { - requiredFields.insert(word(funcDict.lookup("field"))); + requiredFields.insert(wordRe(funcDict.lookup("field"))); } else if (funcDict.found("fields")) { - requiredFields.insert(wordList(funcDict.lookup("fields"))); + requiredFields.insert(wordReList(funcDict.lookup("fields"))); } // Insert named arguments @@ -384,7 +387,7 @@ Foam::autoPtr Foam::functionObjectList::New const argList& args, const Time& runTime, dictionary& controlDict, - HashSet& requiredFields + HashSet& requiredFields ) { autoPtr functionsPtr; diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index e32b01e25b..ad81a3cf60 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -155,7 +155,7 @@ public: const argList& args, const Time& runTime, dictionary& controlDict, - HashSet& requiredFields + HashSet& requiredFields ); @@ -236,7 +236,7 @@ public: ( const string& funcNameArgs0, dictionary& functionsDict, - HashSet& requiredFields, + HashSet& requiredFields, const word& region = word::null ); diff --git a/src/finiteVolume/functionObjects/fieldSelection/fieldSelection.H b/src/finiteVolume/functionObjects/fieldSelection/fieldSelection.H index 9d874f8322..1ff154ec3b 100644 --- a/src/finiteVolume/functionObjects/fieldSelection/fieldSelection.H +++ b/src/finiteVolume/functionObjects/fieldSelection/fieldSelection.H @@ -101,12 +101,6 @@ public: return selection_; } - //- Return the current field selection - wordHashSet& selection() - { - return selection_; - } - //- Read the fieldSelection data from dictionary virtual bool read(const dictionary& dict); diff --git a/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.C b/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.C index 9d55a55393..0456be0dc1 100644 --- a/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.C +++ b/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.C @@ -29,6 +29,43 @@ License #include "fvPatchField.H" #include "surfaceMesh.H" #include "fvsPatchField.H" +#include "pointMesh.H" +#include "pointPatchField.H" +#include "UniformDimensionedField.H" + +void Foam::functionObjects::fileFieldSelection::addInternalFieldTypes +( + wordHashSet& set +) const +{ + const fvMesh& mesh = static_cast(obr_); + + const IOobjectList allObjects(mesh, mesh.time().timeName()); + + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); +} + + +void Foam::functionObjects::fileFieldSelection::addUniformFieldTypes +( + wordHashSet& set +) const +{ + const fvMesh& mesh = static_cast(obr_); + + const IOobjectList allObjects(mesh, mesh.time().timeName()); + + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); + addFromFile>(allObjects, set); +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -54,8 +91,16 @@ bool Foam::functionObjects::fileFieldSelection::updateSelection() wordHashSet oldSet; oldSet.swap(selection_); - addFileGeoFields(selection_); - addFileGeoFields(selection_); + // Geometric fields + addGeoFieldTypes(selection_); + addGeoFieldTypes(selection_); + addGeoFieldTypes(selection_); + + // Internal fields + addInternalFieldTypes(selection_); + + // Uniform fields + addUniformFieldTypes(selection_); return selection_ != oldSet; } diff --git a/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.H b/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.H index d1d3a986c7..8a3f1160a1 100644 --- a/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.H +++ b/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelection.H @@ -69,7 +69,13 @@ protected: //- Add registered GeometricField types to selection template class PatchType, class MeshType> - void addFileGeoFields(wordHashSet& set) const; + void addGeoFieldTypes(wordHashSet& set) const; + + //- Add registered Internal types to selection + void addInternalFieldTypes(wordHashSet& set) const; + + //- Add registered uniform types to selection + void addUniformFieldTypes(wordHashSet& set) const; //- Add objects of a given type template diff --git a/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelectionTemplates.C b/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelectionTemplates.C index f915d04997..ecfa95bdb4 100644 --- a/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelectionTemplates.C +++ b/src/finiteVolume/functionObjects/fieldSelection/fileFieldSelectionTemplates.C @@ -37,7 +37,7 @@ void Foam::functionObjects::fileFieldSelection::addFromFile wordHashSet& set ) const { - DynamicList names; + DynamicList names(this->size()); for (const wordRe& fieldName : *this) { @@ -49,7 +49,7 @@ void Foam::functionObjects::fileFieldSelection::addFromFile template class PatchType, class MeshType> -void Foam::functionObjects::fileFieldSelection::addFileGeoFields +void Foam::functionObjects::fileFieldSelection::addGeoFieldTypes ( wordHashSet& set ) const