diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 7bd1882942b2909aa6111c05ca2eba27e034a963..04cfc5acfb484dacee8af746b250d2f22639f5b6 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -151,7 +151,8 @@ bool Foam::functionObjectList::readFunctionObject ( const string& funcNameArgs, dictionary& functionsDict, - HashSet<word>& requiredFields + HashSet<word>& requiredFields, + const word& region ) { // Parse the optional functionObject arguments: @@ -291,6 +292,12 @@ bool Foam::functionObjectList::readFunctionObject funcDict.set(entry::New(entryStream).ptr()); } + // Insert the region name if specified + if (region != word::null) + { + funcDict.set("region", region); + } + // Merge this functionObject dictionary into functionsDict dictionary funcArgsDict; funcArgsDict.add(string::validate<word>(funcNameArgs), funcDict); @@ -352,6 +359,14 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New dictionary& functionsDict = controlDict.subDict("functions"); + word region = word::null; + + // Set the region name if specified + if (args.optionFound("region")) + { + region = args["region"]; + } + if ( args.optionFound("dict") @@ -377,7 +392,13 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New if (args.optionFound("func")) { - readFunctionObject(args["func"], functionsDict, requiredFields); + readFunctionObject + ( + args["func"], + functionsDict, + requiredFields, + region + ); } if (args.optionFound("funcs")) @@ -386,7 +407,13 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New forAll(funcs, i) { - readFunctionObject(funcs[i], functionsDict, requiredFields); + readFunctionObject + ( + funcs[i], + functionsDict, + requiredFields, + region + ); } } diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index da27e7d7f361f565447bdafc3b42b2406a8ec4ad..405e61336921c0e3dad562b130cf41003e1bb85a 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -218,7 +218,8 @@ public: ( const string& funcNameArgs0, dictionary& functionsDict, - HashSet<word>& requiredFields + HashSet<word>& requiredFields, + const word& region = word::null ); //- Read and set the function objects if their data have changed