diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 9676ece13f..3fabfc7b1e 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -229,7 +229,7 @@ bool Foam::functionObjectList::readFunctionObject word funcName(funcCall); int argLevel = 0; - wordList args; + wordReList args; List> namedArgs; bool namedArg = false; @@ -274,10 +274,7 @@ bool Foam::functionObjectList::readFunctionObject } else { - args.append - ( - string::validate(funcCall(start, i - start)) - ); + args.append(wordRe(funcCall(start, i - start))); } start = i+1; } diff --git a/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.C b/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.C index f0b3c7347e..95078cea52 100644 --- a/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.C +++ b/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.C @@ -114,7 +114,21 @@ Foam::functionObjects::writeObjectsBase::writeObjectNames() const bool Foam::functionObjects::writeObjectsBase::read(const dictionary& dict) { - dict.lookup("objects") >> writeObjectNames_; + regExp_ = dict.lookupOrDefault("regExp", true); + + if (regExp_) + { + dict.lookup("objects") >> writeObjectNames_; + } + else + { + const wordList objectNames(dict.lookup("objects")); + writeObjectNames_.setSize(objectNames.size()); + forAll(objectNames, i) + { + writeObjectNames_[i] = objectNames[i]; + } + } return true; } diff --git a/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.H b/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.H index ed9eb078b6..85ee0f3a5e 100644 --- a/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.H +++ b/src/OpenFOAM/db/functionObjects/writeObjectsBase/writeObjectsBase.H @@ -47,6 +47,7 @@ Usage \table Property | Description | Required | Default value objects | List of objects to be written | yes | + regExp | Switch for regular expression support | no | true \endtable Note: Regular expressions can also be used in \c objects. @@ -66,6 +67,7 @@ SourceFiles #include "wordList.H" #include "wordReList.H" +#include "Switch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -97,6 +99,10 @@ protected: //- Reference to the inheriting function object's log variable const Switch& log_; + //- Optional switch for regular expression support + // Defaults to true + Switch regExp_; + //- Object names requested by the user to be written wordReList writeObjectNames_; diff --git a/src/functionObjects/utilities/writeObjects/writeObjects.H b/src/functionObjects/utilities/writeObjects/writeObjects.H index 2721401b77..a713e33b8b 100644 --- a/src/functionObjects/utilities/writeObjects/writeObjects.H +++ b/src/functionObjects/utilities/writeObjects/writeObjects.H @@ -116,6 +116,7 @@ public: static const NamedEnum writeOptionNames_; + private: // Private Data