mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: change wordRes to be a List of wordRe instead of a wrapper (issue #259)
- this permits direct storage of a list with additional matcher capabilities - provide wordRes::matcher class for similar behaviour as previously
This commit is contained in:
@ -55,7 +55,7 @@ Description
|
||||
items:
|
||||
\code
|
||||
{
|
||||
wordReList matchProcs
|
||||
wordRes matchProcs
|
||||
{
|
||||
wordRe("processors"),
|
||||
wordRe("processor\\d+", wordRe::REGEX)
|
||||
@ -64,7 +64,7 @@ Description
|
||||
for
|
||||
(
|
||||
const word& item
|
||||
: DirLister::dirs(".").where(wordRes(matchProcs))
|
||||
: DirLister::dirs(".").where(matchProcs)
|
||||
)
|
||||
{
|
||||
Info<< "processor dir: " << item << nl;
|
||||
@ -75,7 +75,7 @@ Description
|
||||
methods:
|
||||
\code
|
||||
{
|
||||
wordReList matchProcs
|
||||
wordRes matchProcs
|
||||
{
|
||||
wordRe("processor[0-9][0-9]*", wordRe::REGEX),
|
||||
wordRe("processors")
|
||||
@ -83,7 +83,7 @@ Description
|
||||
|
||||
fileNameList procDirs
|
||||
(
|
||||
DirLister::dirs(".").sorted<fileName>(wordRes(matchProcs))
|
||||
DirLister::dirs(".").sorted<fileName>(matchProcs)
|
||||
);
|
||||
}
|
||||
\endcode
|
||||
|
||||
@ -144,16 +144,15 @@ int main(int argc, char *argv[])
|
||||
<< "List files - filtered" << nl
|
||||
<< "~~~~~~~~~~" << nl;
|
||||
|
||||
wordReList relist
|
||||
{
|
||||
wordRes relist
|
||||
({
|
||||
wordRe("processors"),
|
||||
wordRe("processor[0-9][0-9]*", wordRe::REGEX)
|
||||
};
|
||||
wordRes matcher(relist);
|
||||
});
|
||||
|
||||
Info<<"matcher: " << flatOutput(matcher) << endl;
|
||||
Info<<"matcher: " << flatOutput(relist) << endl;
|
||||
|
||||
for (const word& item : DirLister::dirs(".").where(wordRes(relist)))
|
||||
for (const word& item : DirLister::dirs(".").where(relist))
|
||||
{
|
||||
Info<< "=> " << item << nl;
|
||||
}
|
||||
@ -161,7 +160,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "dirList: "
|
||||
<< flatOutput
|
||||
(
|
||||
DirLister::dirs(".").sorted<fileName>(wordRes(relist))
|
||||
DirLister::dirs(".").sorted<fileName>(relist)
|
||||
) << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ using namespace Foam;
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::addOption("re", "wordReList");
|
||||
argList::addOption("re", "wordRes");
|
||||
|
||||
// timeSelector::addOptions();
|
||||
timeSelector::addOptions(true, true);
|
||||
@ -48,12 +48,10 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
wordReList matcher;
|
||||
if (args.found("re"))
|
||||
wordRes matcher;
|
||||
if (args.readListIfPresent<wordRe>("re", matcher))
|
||||
{
|
||||
matcher = args.readList<wordRe>("re");
|
||||
Info<<"limit names: " << matcher << nl;
|
||||
|
||||
}
|
||||
|
||||
const hashedWordList subsetTypes
|
||||
|
||||
@ -34,7 +34,7 @@ See also
|
||||
|
||||
#include "OSspecific.H"
|
||||
#include "argList.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
#include "IOstreams.H"
|
||||
#include "StringStream.H"
|
||||
@ -446,20 +446,11 @@ int main(int argc, char *argv[])
|
||||
Info<<"read float " << xxx << endl;
|
||||
}
|
||||
|
||||
if (args.found("reList"))
|
||||
{
|
||||
reLst = args.readList<wordRe>("reList");
|
||||
}
|
||||
args.readListIfPresent<wordRe>("reList", reLst);
|
||||
args.readListIfPresent<word>("wordList", wLst);
|
||||
|
||||
if (args.found("wordList"))
|
||||
if (args.readListIfPresent<string>("stringList", sLst))
|
||||
{
|
||||
wLst = args.readList<word>("wordList");
|
||||
}
|
||||
|
||||
if (args.found("stringList"))
|
||||
{
|
||||
sLst = args.readList<string>("stringList");
|
||||
|
||||
printMyString(sLst);
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
labelList patchIDs
|
||||
(
|
||||
pbm.patchSet(wordReList(IStringStream(args[1])())).sortedToc()
|
||||
pbm.patchSet(args.readList<wordRe>(1)).sortedToc()
|
||||
);
|
||||
|
||||
Info<< "Starting walk from patches "
|
||||
|
||||
@ -49,7 +49,7 @@ int main(int argc, char *argv[])
|
||||
"okkkey",
|
||||
};
|
||||
|
||||
wordReList reLst(IStringStream("( okey \"[hy]e+.*\" )")());
|
||||
wordRes reLst(IStringStream("( okey \"[hy]e+.*\" )")());
|
||||
|
||||
Info<< "stringList " << strLst << nl;
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@ Description
|
||||
#include "List.H"
|
||||
#include "Tuple2.H"
|
||||
#include "keyType.H"
|
||||
#include "wordRe.H"
|
||||
#include "wordRes.H"
|
||||
#include "predicates.H"
|
||||
|
||||
@ -108,7 +107,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
wordRes wrelist(wordrelist);
|
||||
|
||||
Info<< "re-list:" << wrelist() << endl;
|
||||
Info<< "re-list:" << wrelist << endl;
|
||||
Info<< "match this: " << wrelist("this") << endl;
|
||||
Info<< "match xyz: " << wrelist("xyz") << endl;
|
||||
Info<< "match zyx: " << wrelist("zyx") << endl;
|
||||
|
||||
@ -81,12 +81,11 @@ int main(int argc, char *argv[])
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
// Find set of patches from the list of regular expressions provided
|
||||
const wordReList patches((IStringStream(args[1])()));
|
||||
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
|
||||
|
||||
const wordRes patches(args.readList<wordRe>(1));
|
||||
const scalar weight = args.read<scalar>(2);
|
||||
const bool overwrite = args.found("overwrite");
|
||||
|
||||
const labelHashSet patchSet(mesh.boundaryMesh().patchSet(patches));
|
||||
if (!patchSet.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
|
||||
@ -1666,7 +1666,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
includePatches = bMesh.patchSet
|
||||
(
|
||||
wordReList(args.lookup("patches")())
|
||||
args.readList<wordRe>("patches")
|
||||
);
|
||||
}
|
||||
else
|
||||
|
||||
@ -414,7 +414,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else if (args.found("patches"))
|
||||
{
|
||||
const wordReList patchNames(args.opt<wordReList>("patches"));
|
||||
const wordRes patchNames(args.readList<wordRe>("patches"));
|
||||
|
||||
exposedPatchIDs = mesh.boundaryMesh().patchSet(patchNames).sortedToc();
|
||||
|
||||
|
||||
@ -360,10 +360,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (args.found("scale"))
|
||||
List<scalar> scaling;
|
||||
if (args.readListIfPresent("scale", scaling))
|
||||
{
|
||||
// Use readList to handle single or multiple values
|
||||
const List<scalar> scaling = args.readList<scalar>("scale");
|
||||
// readList handles single or multiple values
|
||||
|
||||
if (scaling.size() == 1)
|
||||
{
|
||||
|
||||
@ -127,20 +127,20 @@ int main(int argc, char *argv[])
|
||||
argList::addOption
|
||||
(
|
||||
"patches",
|
||||
"wordReList",
|
||||
"wordRes",
|
||||
"specify particular patches to write - eg '(outlet \"inlet.*\")'. "
|
||||
"An empty list suppresses writing the internalMesh."
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"faceZones",
|
||||
"wordReList",
|
||||
"wordRes",
|
||||
"specify faceZones to write - eg '( slice \"mfp-.*\" )'."
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"fields",
|
||||
"wordReList",
|
||||
"wordRes",
|
||||
"specify fields to export (all by default) - eg '( \"U.*\" )'."
|
||||
);
|
||||
argList::addOption
|
||||
@ -249,11 +249,8 @@ int main(int argc, char *argv[])
|
||||
//
|
||||
const bool noLagrangian = args.found("noLagrangian");
|
||||
|
||||
wordReList fieldPatterns;
|
||||
if (args.found("fields"))
|
||||
{
|
||||
fieldPatterns = args.readList<wordRe>("fields");
|
||||
}
|
||||
wordRes fieldPatterns;
|
||||
args.readListIfPresent<wordRe>("fields", fieldPatterns);
|
||||
|
||||
word cellZoneName;
|
||||
if (args.readIfPresent("cellZone", cellZoneName))
|
||||
|
||||
@ -79,8 +79,7 @@ Usage
|
||||
#include "tensorIOField.H"
|
||||
#include "passiveParticleCloud.H"
|
||||
#include "faceSet.H"
|
||||
#include "stringOps.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
#include "meshSubsetHelper.H"
|
||||
#include "readFields.H"
|
||||
@ -117,7 +116,7 @@ void print(Ostream& os, const wordList& flds)
|
||||
labelList getSelectedPatches
|
||||
(
|
||||
const polyBoundaryMesh& patches,
|
||||
const List<wordRe>& excludePatches //HashSet<word>& excludePatches
|
||||
const wordRes& excludePatches
|
||||
)
|
||||
{
|
||||
DynamicList<label> patchIDs(patches.size());
|
||||
@ -137,7 +136,7 @@ labelList getSelectedPatches
|
||||
Info<< " discarding empty/processor patch " << patchi
|
||||
<< " " << pp.name() << endl;
|
||||
}
|
||||
else if (stringOps::match(excludePatches, pp.name()))
|
||||
else if (excludePatches.match(pp.name()))
|
||||
{
|
||||
Info<< " excluding patch " << patchi
|
||||
<< " " << pp.name() << endl;
|
||||
@ -227,11 +226,9 @@ int main(int argc, char *argv[])
|
||||
<< "Outputting cell values only" << nl << endl;
|
||||
}
|
||||
|
||||
List<wordRe> excludePatches;
|
||||
if (args.found("excludePatches"))
|
||||
wordRes excludePatches;
|
||||
if (args.readListIfPresent<wordRe>("excludePatches", excludePatches))
|
||||
{
|
||||
args.lookup("excludePatches")() >> excludePatches;
|
||||
|
||||
Info<< "Not including patches " << excludePatches << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ Note
|
||||
#include "faceZoneMesh.H"
|
||||
#include "Cloud.H"
|
||||
#include "passiveParticle.H"
|
||||
#include "stringOps.H"
|
||||
#include "wordRes.H"
|
||||
#include "areaFields.H"
|
||||
#include "meshSubsetHelper.H"
|
||||
#include "readFields.H"
|
||||
@ -412,7 +412,7 @@ int main(int argc, char *argv[])
|
||||
argList::addOption
|
||||
(
|
||||
"excludePatches",
|
||||
"wordReList",
|
||||
"wordRes",
|
||||
"a list of patches to exclude - eg '( inlet \".*Wall\" )' "
|
||||
);
|
||||
argList::addBoolOption
|
||||
@ -474,11 +474,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
const bool allPatches = args.found("allPatches");
|
||||
|
||||
wordReList excludePatches;
|
||||
if (args.found("excludePatches"))
|
||||
wordRes excludePatches;
|
||||
if (args.readListIfPresent<wordRe>("excludePatches", excludePatches))
|
||||
{
|
||||
args.lookup("excludePatches")() >> excludePatches;
|
||||
|
||||
Info<< "Not including patches " << excludePatches << nl << endl;
|
||||
}
|
||||
|
||||
@ -499,7 +497,7 @@ int main(int argc, char *argv[])
|
||||
else if (Pstream::parRun())
|
||||
{
|
||||
// Strip off leading casename, leaving just processor_DDD ending.
|
||||
string::size_type i = vtkName.rfind("processor");
|
||||
const auto i = vtkName.rfind("processor");
|
||||
|
||||
if (i != string::npos)
|
||||
{
|
||||
@ -1284,7 +1282,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (stringOps::match(excludePatches, pp.name()))
|
||||
if (excludePatches.match(pp.name()))
|
||||
{
|
||||
// Skip excluded patch
|
||||
continue;
|
||||
|
||||
@ -446,7 +446,7 @@ int main(int argc, char *argv[])
|
||||
forAll(times, timei)
|
||||
{
|
||||
word instance;
|
||||
if (args.found("instance"))
|
||||
if (args.readIfPresent("instance", instance))
|
||||
{
|
||||
if (times.size() > 1)
|
||||
{
|
||||
@ -454,8 +454,6 @@ int main(int argc, char *argv[])
|
||||
<< "Multiple times selected with 'instance' option"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
args.lookup("instance")() >> instance;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -28,8 +28,6 @@ License
|
||||
#include "IFstream.H"
|
||||
#include "StringStream.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::boundaryTemplates::boundaryTemplates
|
||||
|
||||
@ -27,9 +27,9 @@ Class
|
||||
Description
|
||||
Class to store boundary template specifications
|
||||
|
||||
Templates are typically stored centrally, and constructed in a hierarchical
|
||||
manner. The main use is to convert the (user) specified conditions into
|
||||
a form which can be inserted into each field file as dictionary entries.
|
||||
Templates are typically stored centrally, and constructed hierarchically.
|
||||
The main use is to convert the (user) specified conditions into
|
||||
a form that can be inserted into each field file as dictionary entries.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -37,8 +37,6 @@ Description
|
||||
#define boundaryTemplates_H
|
||||
|
||||
#include "dictionary.H"
|
||||
#include "wordList.H"
|
||||
#include "wordReList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -43,26 +43,26 @@ Foam::label Foam::caseInfo::findPatchConditionID
|
||||
// Assign condition according to last condition applied, wins
|
||||
forAllReverse(conditionNames_, conditionI)
|
||||
{
|
||||
const wordReList& patchNames = patchNames_[conditionI];
|
||||
const wordRes& patchNames = patchNames_[conditionI];
|
||||
|
||||
forAll(patchNames, nameI)
|
||||
for (const wordRe& select : patchNames)
|
||||
{
|
||||
if (patchNames[nameI] == patchName)
|
||||
if (select == patchName)
|
||||
{
|
||||
// Check for explicit match
|
||||
// Literal match
|
||||
return conditionI;
|
||||
}
|
||||
else if (patchNames[nameI].match(patchName))
|
||||
else if (select.match(patchName))
|
||||
{
|
||||
// Check wildcards
|
||||
// Regex match
|
||||
return conditionI;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check for group match
|
||||
forAll(patchGroups, groupI)
|
||||
for (const word& groupName : patchGroups)
|
||||
{
|
||||
if (patchNames[nameI] == patchGroups[groupI])
|
||||
if (select == groupName)
|
||||
{
|
||||
return conditionI;
|
||||
}
|
||||
@ -160,7 +160,7 @@ void Foam::caseInfo::checkPatches
|
||||
}
|
||||
|
||||
|
||||
const Foam::List<Foam::wordReList>& Foam::caseInfo::patchNames() const
|
||||
const Foam::List<Foam::wordRes>& Foam::caseInfo::patchNames() const
|
||||
{
|
||||
return patchNames_;
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ Description
|
||||
#include "labelList.H"
|
||||
#include "wordList.H"
|
||||
#include "HashSet.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
#include "IOdictionary.H"
|
||||
#include "boundaryInfo.H"
|
||||
|
||||
@ -72,7 +72,7 @@ class caseInfo
|
||||
// Per-condition information
|
||||
|
||||
//- List of patch names
|
||||
List<wordReList> patchNames_;
|
||||
List<wordRes> patchNames_;
|
||||
|
||||
//- Patch category
|
||||
wordList patchCategories_;
|
||||
@ -103,7 +103,7 @@ public:
|
||||
) const;
|
||||
|
||||
//- Return the list of patch names
|
||||
const List<wordReList>& patchNames() const;
|
||||
const List<wordRes>& patchNames() const;
|
||||
|
||||
//- Return the condition name for patch with index patchI
|
||||
const word& conditionName(const label patchI) const;
|
||||
|
||||
@ -200,17 +200,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
|
||||
word sourceRegion = fvMesh::defaultRegion;
|
||||
if (args.found("sourceRegion"))
|
||||
if (args.readIfPresent("sourceRegion", sourceRegion))
|
||||
{
|
||||
sourceRegion = args["sourceRegion"];
|
||||
Info<< "Source region: " << sourceRegion << endl;
|
||||
}
|
||||
|
||||
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
|
||||
word targetRegion = fvMesh::defaultRegion;
|
||||
if (args.found("targetRegion"))
|
||||
if (args.readIfPresent("targetRegion", targetRegion))
|
||||
{
|
||||
targetRegion = args["targetRegion"];
|
||||
Info<< "Target region: " << targetRegion << endl;
|
||||
}
|
||||
|
||||
@ -242,10 +240,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Optionally override
|
||||
if (args.found("patchMapMethod"))
|
||||
if (args.readIfPresent("patchMapMethod", patchMapMethod))
|
||||
{
|
||||
patchMapMethod = args["patchMapMethod"];
|
||||
|
||||
Info<< "Patch mapping method: " << patchMapMethod << endl;
|
||||
}
|
||||
|
||||
@ -265,10 +261,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
HashSet<word> selectedFields;
|
||||
if (args.found("fields"))
|
||||
{
|
||||
args.lookup("fields")() >> selectedFields;
|
||||
}
|
||||
args.readIfPresent("fields", selectedFields);
|
||||
|
||||
const bool noLagrangian = args.found("noLagrangian");
|
||||
|
||||
|
||||
@ -175,7 +175,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
includePatches = bMesh.patchSet
|
||||
(
|
||||
wordReList(args.lookup("patches")())
|
||||
args.readList<wordRe>("patches")
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -197,12 +197,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.found("faceZones"))
|
||||
{
|
||||
wordReList zoneNames(args.lookup("faceZones")());
|
||||
wordReList zoneNames(args.readList<wordRe>("faceZones"));
|
||||
const wordList allZoneNames(fzm.names());
|
||||
forAll(zoneNames, i)
|
||||
for (const wordRe& zoneName : zoneNames)
|
||||
{
|
||||
const wordRe& zoneName = zoneNames[i];
|
||||
|
||||
labelList zoneIDs = findStrings(zoneName, allZoneNames);
|
||||
|
||||
forAll(zoneIDs, j)
|
||||
|
||||
@ -277,12 +277,6 @@ Foam::searchableSurfaceModifiers::cut::cut
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::searchableSurfaceModifiers::cut::~cut()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::searchableSurfaceModifiers::cut::modify
|
||||
@ -296,14 +290,12 @@ bool Foam::searchableSurfaceModifiers::cut::modify
|
||||
bool changed = false;
|
||||
|
||||
// Find the surfaces to cut with
|
||||
forAll(cutterNames_, cutNameI)
|
||||
for (const wordRe& cutterName : cutterNames_)
|
||||
{
|
||||
labelList geomIDs =
|
||||
findStrings(cutterNames_[cutNameI], geometry_.names());
|
||||
labelList geomIDs = findStrings(cutterName, geometry_.names());
|
||||
|
||||
forAll(geomIDs, j)
|
||||
for (const label geomI : geomIDs)
|
||||
{
|
||||
label geomI = geomIDs[j];
|
||||
const searchableSurface& cutter = geometry_[geomI];
|
||||
|
||||
// Triangulate
|
||||
|
||||
@ -37,7 +37,7 @@ SourceFiles
|
||||
#define cut_H
|
||||
|
||||
#include "searchableSurfaceModifier.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
#include "faceList.H"
|
||||
#include "pointField.H"
|
||||
|
||||
@ -63,7 +63,7 @@ class cut
|
||||
// Private data
|
||||
|
||||
//- Name of surfaces to cut with
|
||||
const wordReList cutterNames_;
|
||||
const wordRes cutterNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -105,7 +105,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~cut();
|
||||
virtual ~cut() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -235,10 +235,10 @@ int main(int argc, char *argv[])
|
||||
points = transform(quat, points);
|
||||
}
|
||||
|
||||
if (args.found("scale"))
|
||||
List<scalar> scaling;
|
||||
if (args.readListIfPresent("scale", scaling))
|
||||
{
|
||||
// Use readList to handle single or multiple values
|
||||
const List<scalar> scaling = args.readList<scalar>("scale");
|
||||
// readList handles single or multiple values
|
||||
|
||||
if (scaling.size() == 1)
|
||||
{
|
||||
|
||||
@ -29,10 +29,8 @@ License
|
||||
#include "profiling.H"
|
||||
#include "argList.H"
|
||||
#include "timeControlFunctionObject.H"
|
||||
//#include "IFstream.H"
|
||||
#include "dictionaryEntry.H"
|
||||
#include "stringOps.H"
|
||||
#include "wordRes.H"
|
||||
#include "Tuple2.H"
|
||||
#include "etcFiles.H"
|
||||
#include "IOdictionary.H"
|
||||
@ -468,12 +466,6 @@ Foam::autoPtr<Foam::functionObjectList> Foam::functionObjectList::New
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjectList::~functionObjectList()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::functionObjectList::resetState()
|
||||
@ -623,7 +615,7 @@ bool Foam::functionObjectList::execute(const label subIndex)
|
||||
|
||||
bool Foam::functionObjectList::execute
|
||||
(
|
||||
const wordRes& functionNames,
|
||||
const UList<wordRe>& functionNames,
|
||||
const label subIndex
|
||||
)
|
||||
{
|
||||
@ -635,7 +627,7 @@ bool Foam::functionObjectList::execute
|
||||
{
|
||||
functionObject& funcObj = operator[](obji);
|
||||
|
||||
if (functionNames.match(funcObj.name()))
|
||||
if (stringOps::match(functionNames, funcObj.name()))
|
||||
{
|
||||
ok = funcObj.execute(subIndex) && ok;
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ namespace Foam
|
||||
// Forward declarations
|
||||
class argList;
|
||||
class mapPolyMesh;
|
||||
class wordRes;
|
||||
class wordRe;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class functionObjectList Declaration
|
||||
@ -160,7 +160,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~functionObjectList();
|
||||
~functionObjectList() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -270,7 +270,7 @@ public:
|
||||
// execute
|
||||
// \param subIndex an execution sub-index corresponding to a
|
||||
// sub-cycle or something similar
|
||||
bool execute(const wordRes& functionNames, const label subIndex);
|
||||
bool execute(const UList<wordRe>& functionNames, const label subIndex);
|
||||
|
||||
//- Called when Time::run() determines that the time-loop exits
|
||||
bool end();
|
||||
|
||||
@ -148,12 +148,6 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::regionFunctionObject::~regionFunctionObject()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::regionFunctionObject::read(const dictionary& dict)
|
||||
|
||||
@ -170,7 +170,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionFunctionObject();
|
||||
virtual ~regionFunctionObject() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -160,6 +160,11 @@ class argList
|
||||
const string& str
|
||||
);
|
||||
|
||||
//- Read a List of values from ITstream,
|
||||
//- treating a single entry like a list of size 1.
|
||||
template<class T>
|
||||
static inline void readList(ITstream& is, List<T>& list);
|
||||
|
||||
//- Get rootPath_ / globalCase_ from one of the following forms
|
||||
// * [-case dir]
|
||||
// * cwd
|
||||
@ -307,6 +312,11 @@ public:
|
||||
template<class T>
|
||||
inline T read(const label index) const;
|
||||
|
||||
//- Read a value from the argument at index.
|
||||
// Index 1 is the first non-option argument.
|
||||
template<class T>
|
||||
inline List<T> readList(const label index) const;
|
||||
|
||||
//- Return true if the named option is found
|
||||
inline bool found(const word& optName) const;
|
||||
|
||||
@ -354,6 +364,12 @@ public:
|
||||
template<class T>
|
||||
inline List<T> readList(const word& optName) const;
|
||||
|
||||
//- If named option is present, read a List of values
|
||||
//- treating a single entry like a list of size 1.
|
||||
// \return true if the named option was found.
|
||||
template<class T>
|
||||
inline bool readListIfPresent(const word& optName, List<T>& list) const;
|
||||
|
||||
|
||||
// Older style access (including 1712 release)
|
||||
|
||||
|
||||
@ -25,6 +25,25 @@ License
|
||||
|
||||
#include "argList.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class T>
|
||||
inline void Foam::argList::readList(ITstream& is, List<T>& list)
|
||||
{
|
||||
if (is.size() == 1)
|
||||
{
|
||||
// Single token - treat like List with one entry
|
||||
list.setSize(1);
|
||||
is >> list[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
is >> list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::word& Foam::argList::executable() const
|
||||
@ -277,28 +296,48 @@ inline T Foam::argList::lookupOrDefault
|
||||
|
||||
|
||||
template<class T>
|
||||
inline Foam::List<T> Foam::argList::readList(const word& optName) const
|
||||
inline Foam::List<T> Foam::argList::readList(const label index) const
|
||||
{
|
||||
ITstream is(Foam::name(index), args_[index]);
|
||||
|
||||
List<T> list;
|
||||
|
||||
ITstream is(optName, options_[optName]);
|
||||
|
||||
if (is.size() == 1)
|
||||
{
|
||||
// Single token - treated like list with one entry
|
||||
list.setSize(1);
|
||||
|
||||
is >> list[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
is >> list;
|
||||
}
|
||||
readList(is, list);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline Foam::List<T> Foam::argList::readList(const word& optName) const
|
||||
{
|
||||
ITstream is(optName, options_[optName]);
|
||||
|
||||
List<T> list;
|
||||
readList(is, list);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline bool Foam::argList::readListIfPresent
|
||||
(
|
||||
const word& optName,
|
||||
List<T>& list
|
||||
) const
|
||||
{
|
||||
if (found(optName))
|
||||
{
|
||||
ITstream is(optName, options_[optName]);
|
||||
readList(is, list);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::string& Foam::argList::operator[](const label index) const
|
||||
|
||||
@ -21,9 +21,6 @@ License
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Description
|
||||
Istream constructor and IOstream operators for keyType.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "keyType.H"
|
||||
@ -54,10 +51,8 @@ bool Foam::keyType::match(const std::string& text, bool literal) const
|
||||
{
|
||||
return !compare(text); // Compare as literal string
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return regExp(*this).match(text); // Match as regex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -141,7 +141,8 @@ public:
|
||||
|
||||
// Member operators
|
||||
|
||||
//- Perform smart match on text
|
||||
//- Perform smart match on text, as per match()
|
||||
// Allows use as a predicate.
|
||||
inline bool operator()(const std::string& text) const;
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -37,21 +37,12 @@ SourceFiles
|
||||
|
||||
#include "labelList.H"
|
||||
#include "stringList.H"
|
||||
#include "regExp.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
//- Single-string match for one of the regular expressions
|
||||
// \deprecated use stringOps::match instead (deprecated NOV-2017)
|
||||
inline bool findStrings(const wordRes& matcher, const std::string& text)
|
||||
{
|
||||
return matcher(text);
|
||||
}
|
||||
|
||||
|
||||
//- Extract list indices
|
||||
// The unary match predicate has the following signature:
|
||||
// \code
|
||||
@ -92,8 +83,7 @@ namespace Foam
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
const regExp matcher(re);
|
||||
return findMatchingStrings(matcher, lst, invert);
|
||||
return findMatchingStrings(regExp(re), lst, invert);
|
||||
}
|
||||
|
||||
|
||||
@ -107,8 +97,7 @@ namespace Foam
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
const regExp matcher(re);
|
||||
return findMatchingStrings(matcher, lst, invert);
|
||||
return findMatchingStrings(regExp(re), lst, invert);
|
||||
}
|
||||
|
||||
|
||||
@ -139,6 +128,19 @@ namespace Foam
|
||||
return findMatchingStrings(matcher, lst, invert);
|
||||
}
|
||||
|
||||
//- Return list indices for strings matching one of the regular expression
|
||||
// Template partial specialization of findMatchingStrings
|
||||
template<class StringType>
|
||||
labelList findStrings
|
||||
(
|
||||
const UList<wordRe>& patterns,
|
||||
const UList<StringType>& input,
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
return findMatchingStrings(wordRes::matcher(patterns), input, invert);
|
||||
}
|
||||
|
||||
|
||||
// Subsetting multi-string matches (similar to ListOp):
|
||||
|
||||
@ -181,8 +183,7 @@ namespace Foam
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
const regExp matcher(re);
|
||||
return subsetMatchingStrings(matcher, lst, invert);
|
||||
return subsetMatchingStrings(regExp(re), lst, invert);
|
||||
}
|
||||
|
||||
//- Extract elements of StringList when regular expression matches
|
||||
@ -195,8 +196,7 @@ namespace Foam
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
const regExp matcher(re);
|
||||
return subsetMatchingStrings(matcher, lst, invert);
|
||||
return subsetMatchingStrings(regExp(re), lst, invert);
|
||||
}
|
||||
|
||||
//- Extract elements of StringList when regular expression matches
|
||||
@ -226,6 +226,20 @@ namespace Foam
|
||||
}
|
||||
|
||||
|
||||
//- Extract elements of StringList when regular expression matches
|
||||
// Template partial specialization of subsetMatchingStrings
|
||||
template<class StringListType>
|
||||
StringListType subsetStrings
|
||||
(
|
||||
const UList<wordRe>& patterns,
|
||||
const StringListType& input,
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
return subsetMatchingStrings(wordRes::matcher(patterns), input, invert);
|
||||
}
|
||||
|
||||
|
||||
//- Inplace extract elements of StringList when regular expression matches
|
||||
// optionally invert the match
|
||||
// eg, to extract all selected elements:
|
||||
@ -261,8 +275,7 @@ namespace Foam
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
const regExp matcher(re);
|
||||
inplaceSubsetMatchingStrings(matcher, lst, invert);
|
||||
inplaceSubsetMatchingStrings(regExp(re), lst, invert);
|
||||
}
|
||||
|
||||
//- Inplace extract elements of StringList when regular expression matches
|
||||
@ -275,8 +288,7 @@ namespace Foam
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
const regExp matcher(re);
|
||||
inplaceSubsetMatchingStrings(matcher, lst, invert);
|
||||
inplaceSubsetMatchingStrings(regExp(re), lst, invert);
|
||||
}
|
||||
|
||||
//- Inplace extract elements of StringList when regular expression matches
|
||||
@ -305,6 +317,19 @@ namespace Foam
|
||||
inplaceSubsetMatchingStrings(matcher, lst, invert);
|
||||
}
|
||||
|
||||
//- Inplace extract elements of StringList when regular expression matches
|
||||
// Template partial specialization of inplaceSubsetMatchingStrings
|
||||
template<class StringListType>
|
||||
void inplaceSubsetStrings
|
||||
(
|
||||
const UList<wordRe>& regexs,
|
||||
StringListType& input,
|
||||
const bool invert=false
|
||||
)
|
||||
{
|
||||
inplaceSubsetMatchingStrings(wordRes::matcher(regexs), input, invert);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -57,11 +57,8 @@ StringListType Foam::subsetMatchingStrings
|
||||
const bool invert
|
||||
)
|
||||
{
|
||||
// Create as a copy
|
||||
StringListType newLst(lst.size());
|
||||
|
||||
// Ensure consistent addressable size (eg, DynamicList)
|
||||
newLst.setSize(lst.size());
|
||||
newLst.setSize(lst.size()); // Consistent sizing (eg, DynamicList)
|
||||
|
||||
label count = 0;
|
||||
forAll(lst, elemi)
|
||||
|
||||
@ -213,7 +213,8 @@ public:
|
||||
const char quote = '\\'
|
||||
);
|
||||
|
||||
//- True when strings match literally
|
||||
//- Test for equality.
|
||||
// \return True when strings match literally.
|
||||
inline bool match(const std::string& text) const;
|
||||
|
||||
//- Avoid masking the normal std::string replace
|
||||
@ -289,7 +290,7 @@ public:
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Match text
|
||||
//- Test for equality. Allows use as a predicate.
|
||||
// \return True when strings match literally.
|
||||
inline bool operator()(const std::string& text) const;
|
||||
|
||||
|
||||
@ -63,13 +63,11 @@ namespace stringOps
|
||||
std::string::size_type count(const char* str, const char c);
|
||||
|
||||
//- Return true if text matches one of the regular expressions.
|
||||
// Simply forwards a wordReList to a wordRes for the matching.
|
||||
inline bool match(const wordReList& patterns, const std::string& text)
|
||||
inline bool match(const UList<wordRe>& patterns, const std::string& text)
|
||||
{
|
||||
return wordRes(patterns).match(text);
|
||||
return wordRes::matcher(patterns)(text);
|
||||
}
|
||||
|
||||
|
||||
//- Expand occurences of variables according to the mapping
|
||||
// Expansion includes:
|
||||
// -# variables
|
||||
|
||||
@ -202,7 +202,7 @@ public:
|
||||
|
||||
//- Smart match as regular expression or as a string.
|
||||
// Optionally force a literal match only
|
||||
inline bool match(const std::string& text, bool literal = false) const;
|
||||
inline bool match(const std::string& text, bool literal=false) const;
|
||||
|
||||
|
||||
// Miscellaneous
|
||||
@ -217,6 +217,7 @@ public:
|
||||
// Member operators
|
||||
|
||||
//- Perform smart match on text, as per match()
|
||||
// Allows use as a predicate.
|
||||
inline bool operator()(const std::string& text) const;
|
||||
|
||||
|
||||
|
||||
@ -229,10 +229,8 @@ inline bool Foam::wordRe::match(const std::string& text, bool literal) const
|
||||
{
|
||||
return !compare(text); // Compare as literal string
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return re_.match(text); // Match as regex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -6,27 +6,14 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
Typedef
|
||||
Foam::wordReListMatcher
|
||||
|
||||
Description
|
||||
The older name for Foam::wordRes, which is a wrapper for matching
|
||||
a std::string against wordRe list.
|
||||
Compatibility name. Superseded (MAY-2017) by Foam::wordRes
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,48 +28,47 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
Foam::wordReList Foam::wordRes::uniq(const UList<wordRe>& input)
|
||||
Foam::wordRes Foam::wordRes::uniq(const UList<wordRe>& input)
|
||||
{
|
||||
wordReList retain(input.size());
|
||||
wordRes output(input.size());
|
||||
wordHashSet uniqWord;
|
||||
|
||||
label count = 0;
|
||||
forAll(input, i)
|
||||
for (const wordRe& select : input)
|
||||
{
|
||||
const auto& select = input[i];
|
||||
|
||||
if (select.isPattern() || uniqWord.insert(select))
|
||||
{
|
||||
retain[count] = select;
|
||||
output[count] = select;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
retain.setSize(count);
|
||||
return retain;
|
||||
output.resize(count);
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
void Foam::wordRes::inplaceUniq(wordReList& input)
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::wordRes::uniq()
|
||||
{
|
||||
wordHashSet uniqWord;
|
||||
|
||||
label count = 0;
|
||||
forAll(input, i)
|
||||
label i = 0, count = 0;
|
||||
for (wordRe& select : *this)
|
||||
{
|
||||
const auto& select = input[i];
|
||||
|
||||
if (select.isPattern() || uniqWord.insert(select))
|
||||
{
|
||||
if (count != i)
|
||||
{
|
||||
input[count] = input[i];
|
||||
(*this)[count] = std::move(select);
|
||||
}
|
||||
++count;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
||||
input.setSize(count);
|
||||
resize(count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -25,11 +25,7 @@ Class
|
||||
Foam::wordRes
|
||||
|
||||
Description
|
||||
A wrapper for matching a std::string against a wordRe list.
|
||||
|
||||
Note
|
||||
The constructor should remain non-explicit. This allows automatic
|
||||
conversion from UList\<wordRe\> to wordRes in search functions.
|
||||
A List of wordRe with additional matching capabilities.
|
||||
|
||||
SourceFiles
|
||||
wordResI.H
|
||||
@ -52,92 +48,83 @@ namespace Foam
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class wordRes
|
||||
:
|
||||
public List<wordRe>
|
||||
{
|
||||
// Private data
|
||||
// Private Methods
|
||||
|
||||
//- Check for any match of text in list of matchers
|
||||
inline static bool found_match
|
||||
(
|
||||
const UList<wordRe>& patterns,
|
||||
const std::string& text,
|
||||
bool literal=false
|
||||
);
|
||||
|
||||
//- Reference to underlying list
|
||||
const UList<wordRe>& list_;
|
||||
|
||||
public:
|
||||
|
||||
// STL type definitions
|
||||
// Public Classes
|
||||
|
||||
//- Type of values the list contains
|
||||
typedef wordRe value_type;
|
||||
//- Functor wrapper for matching against a List of wordRe
|
||||
struct matcher
|
||||
{
|
||||
const UList<wordRe>& values;
|
||||
|
||||
matcher(const UList<wordRe>& list)
|
||||
:
|
||||
values(list)
|
||||
{}
|
||||
|
||||
//- Return true if string matches ANY of the regular expressions
|
||||
// Allows use as a predicate.
|
||||
bool operator()(const std::string& text) const
|
||||
{
|
||||
return found_match(values, text);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Factory Methods
|
||||
|
||||
//- Return a null wordRes - a reference to the NullObject
|
||||
inline static const wordRes& null();
|
||||
|
||||
//- Return a wordRes with duplicate words filtered out.
|
||||
// No filtering attempted on regular expressions.
|
||||
static wordRes uniq(const UList<wordRe>& input);
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from a list of wordRe
|
||||
inline wordRes(const UList<wordRe>& list);
|
||||
//- Inherit constructors from List of wordRe
|
||||
using List<wordRe>::List;
|
||||
|
||||
|
||||
// Static Constructors, Helpers
|
||||
|
||||
//- Return a wordReList with duplicate words filtered out.
|
||||
// No filtering is done on regular expressions.
|
||||
static wordReList uniq(const UList<wordRe>& input);
|
||||
|
||||
//- Inplace subset of wordReList with duplicate words filtered out.
|
||||
// No filtering is done on regular expressions.
|
||||
static void inplaceUniq(wordReList& input);
|
||||
//- Destructor
|
||||
~wordRes() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
//- Filter out duplicate words (inplace).
|
||||
// No filtering attempted on regular expressions.
|
||||
void uniq();
|
||||
|
||||
//- The number of elements in the list
|
||||
inline label size() const;
|
||||
|
||||
//- True if the list is empty
|
||||
inline bool empty() const;
|
||||
|
||||
|
||||
// Searching
|
||||
|
||||
//- Return true if string matches any of the regular expressions
|
||||
//- Return true if string matches ANY of the regular expressions
|
||||
// Smart match as regular expression or as a string.
|
||||
// Optionally specify a literal match only.
|
||||
inline bool match
|
||||
(
|
||||
const std::string& text,
|
||||
const bool literal = false
|
||||
) const;
|
||||
// Optionally force a literal match only
|
||||
inline bool match(const std::string& text, bool literal=false) const;
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
//- Return underlying list of wordRe
|
||||
inline const UList<wordRe>& operator()() const;
|
||||
|
||||
//- Perform smart match on text, as per match()
|
||||
// Allows use as a predicate.
|
||||
inline bool operator()(const std::string& text) const;
|
||||
|
||||
//- Return element of constant list
|
||||
inline const wordRe& operator[](const label i) const;
|
||||
|
||||
|
||||
// Writing
|
||||
|
||||
//- Write wordReList, with line-breaks in ASCII if the list length
|
||||
//- exceeds shortListLen.
|
||||
// Using '0' suppresses line-breaks entirely.
|
||||
inline Ostream& writeList
|
||||
(
|
||||
Ostream& os,
|
||||
const label shortListLen=0
|
||||
) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Global Functions
|
||||
|
||||
//- Write to Ostream, as per wordRes::writeList() with shortListLen=10
|
||||
inline Ostream& operator<<(Ostream& os, const wordRes& wres);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -23,42 +23,24 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::wordRes::wordRes
|
||||
(
|
||||
const UList<wordRe>& list
|
||||
)
|
||||
:
|
||||
list_(list)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::label Foam::wordRes::size() const
|
||||
inline const Foam::wordRes& Foam::wordRes::null()
|
||||
{
|
||||
return list_.size();
|
||||
return NullObjectRef<wordRes>();
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::wordRes::empty() const
|
||||
{
|
||||
return list_.empty();
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::wordRes::match
|
||||
inline bool Foam::wordRes::found_match
|
||||
(
|
||||
const UList<wordRe>& patterns,
|
||||
const std::string& text,
|
||||
const bool literal
|
||||
) const
|
||||
bool literal
|
||||
)
|
||||
{
|
||||
const label n = list_.size();
|
||||
|
||||
for (label i = 0; i < n; ++i)
|
||||
for (const wordRe& select : patterns)
|
||||
{
|
||||
if (list_[i].match(text, literal))
|
||||
if (select.match(text, literal))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -68,41 +50,19 @@ inline bool Foam::wordRes::match
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline const Foam::UList<Foam::wordRe>& Foam::wordRes::operator()() const
|
||||
inline bool Foam::wordRes::match(const std::string& text, bool literal) const
|
||||
{
|
||||
return list_;
|
||||
return found_match(*this, text, literal);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline bool Foam::wordRes::operator()(const std::string& text) const
|
||||
{
|
||||
return match(text);
|
||||
}
|
||||
|
||||
|
||||
inline const Foam::wordRe& Foam::wordRes::operator[](const label i) const
|
||||
{
|
||||
return list_[i];
|
||||
}
|
||||
|
||||
|
||||
inline Foam::Ostream& Foam::wordRes::writeList
|
||||
(
|
||||
Ostream& os,
|
||||
const label shortListLen
|
||||
) const
|
||||
{
|
||||
return list_.writeList(os, shortListLen);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
inline Foam::Ostream& Foam::operator<<(Ostream& os, const wordRes& wres)
|
||||
{
|
||||
return wres.writeList(os, 10);
|
||||
return found_match(*this, text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,7 +30,7 @@ Description
|
||||
|
||||
#include "SLList.H"
|
||||
#include "Ostream.H"
|
||||
#include "stringOps.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -100,11 +100,11 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//- Return a list of names matching whiteList and not matching blackList
|
||||
//- Return a list of names matching white-list and not in black-list
|
||||
List<word> findNames
|
||||
(
|
||||
const UList<wordRe>& whiteLst,
|
||||
const UList<wordRe>& blackLst = UList<wordRe>()
|
||||
const wordRes& white,
|
||||
const wordRes& black = wordRes()
|
||||
) const
|
||||
{
|
||||
List<word> matched(SLList<T>::size());
|
||||
@ -114,11 +114,7 @@ public:
|
||||
{
|
||||
const word& name = iter().name();
|
||||
|
||||
if
|
||||
(
|
||||
stringOps::match(whiteLst, name)
|
||||
&& !stringOps::match(blackLst, name)
|
||||
)
|
||||
if (white.match(name) && !black.match(name))
|
||||
{
|
||||
matched[matchi++] = name;
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ License
|
||||
#include "boundaryRegion.H"
|
||||
#include "IOMap.H"
|
||||
#include "OFstream.H"
|
||||
#include "stringOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -49,12 +48,6 @@ Foam::boundaryRegion::boundaryRegion
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::boundaryRegion::~boundaryRegion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::boundaryRegion::append(const dictionary& dict)
|
||||
@ -96,20 +89,20 @@ Foam::Map<Foam::word> Foam::boundaryRegion::names() const
|
||||
|
||||
Foam::Map<Foam::word> Foam::boundaryRegion::names
|
||||
(
|
||||
const UList<wordRe>& patterns
|
||||
const wordRes& patterns
|
||||
) const
|
||||
{
|
||||
Map<word> lookup;
|
||||
|
||||
forAllConstIter(Map<dictionary>, *this, iter)
|
||||
{
|
||||
word lookupName = iter().lookupOrDefault<word>
|
||||
const word lookupName = iter().lookupOrDefault<word>
|
||||
(
|
||||
"Label",
|
||||
"boundaryRegion_" + Foam::name(iter.key())
|
||||
);
|
||||
|
||||
if (stringOps::match(patterns, lookupName))
|
||||
if (patterns.match(lookupName))
|
||||
{
|
||||
lookup.insert(iter.key(), lookupName);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ SourceFiles
|
||||
#include "dictionary.H"
|
||||
#include "labelList.H"
|
||||
#include "wordList.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -75,7 +75,7 @@ class boundaryRegion
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
boundaryRegion(const boundaryRegion&);
|
||||
boundaryRegion(const boundaryRegion&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
@ -95,7 +95,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~boundaryRegion();
|
||||
~boundaryRegion() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -111,7 +111,7 @@ public:
|
||||
Map<word> names() const;
|
||||
|
||||
//- Return a Map of (id => names) selected by patterns
|
||||
Map<word> names(const UList<wordRe>& patterns) const;
|
||||
Map<word> names(const wordRes& patterns) const;
|
||||
|
||||
//- Return a Map of (id => type)
|
||||
Map<word> boundaryTypes() const;
|
||||
|
||||
@ -26,13 +26,12 @@ License
|
||||
#include "cellTable.H"
|
||||
#include "IOMap.H"
|
||||
#include "OFstream.H"
|
||||
#include "wordList.H"
|
||||
#include "stringOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const char* const Foam::cellTable::defaultMaterial_ = "fluid";
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::Map<Foam::label> Foam::cellTable::zoneMap() const
|
||||
@ -119,12 +118,6 @@ Foam::cellTable::cellTable
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::cellTable::~cellTable()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::cellTable::append(const dictionary& dict)
|
||||
@ -166,20 +159,20 @@ Foam::Map<Foam::word> Foam::cellTable::names() const
|
||||
|
||||
Foam::Map<Foam::word> Foam::cellTable::names
|
||||
(
|
||||
const UList<wordRe>& patterns
|
||||
const wordRes& patterns
|
||||
) const
|
||||
{
|
||||
Map<word> lookup;
|
||||
|
||||
forAllConstIter(Map<dictionary>, *this, iter)
|
||||
{
|
||||
word lookupName = iter().lookupOrDefault<word>
|
||||
const word lookupName = iter().lookupOrDefault<word>
|
||||
(
|
||||
"Label",
|
||||
"cellTable_" + Foam::name(iter.key())
|
||||
);
|
||||
|
||||
if (stringOps::match(patterns, lookupName))
|
||||
if (patterns.match(lookupName))
|
||||
{
|
||||
lookup.insert(iter.key(), lookupName);
|
||||
}
|
||||
@ -517,13 +510,13 @@ void Foam::cellTable::combine(const dictionary& mapDict, labelList& tableIds)
|
||||
bool remap = false;
|
||||
forAllConstIter(dictionary, mapDict, iter)
|
||||
{
|
||||
wordReList patterns(iter().stream());
|
||||
wordRes patterns(iter().stream());
|
||||
|
||||
// find all matches
|
||||
Map<word> matches;
|
||||
forAllConstIter(Map<word>, origNames, namesIter)
|
||||
{
|
||||
if (stringOps::match(patterns, namesIter()))
|
||||
if (patterns.match(namesIter()))
|
||||
{
|
||||
matches.insert(namesIter.key(), namesIter());
|
||||
}
|
||||
|
||||
@ -64,7 +64,8 @@ SourceFiles
|
||||
#include "Map.H"
|
||||
#include "dictionary.H"
|
||||
#include "labelList.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -90,7 +91,7 @@ class cellTable
|
||||
Map<label> zoneMap() const;
|
||||
|
||||
//- A contiguous list of cellTable names
|
||||
List<word> namesList() const;
|
||||
wordList namesList() const;
|
||||
|
||||
//- Add required entries - MaterialType
|
||||
void addDefaults();
|
||||
@ -98,7 +99,7 @@ class cellTable
|
||||
void setEntry(const label id, const word& keyWord, const word& value);
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
cellTable(const cellTable&);
|
||||
cellTable(const cellTable&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
@ -118,7 +119,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~cellTable();
|
||||
~cellTable() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -138,7 +139,7 @@ public:
|
||||
Map<word> names() const;
|
||||
|
||||
//- Return a Map of (id => names) selected by patterns
|
||||
Map<word> names(const UList<wordRe>& patterns) const;
|
||||
Map<word> names(const wordRes& patterns) const;
|
||||
|
||||
//- Return a Map of (id => name) for materialType
|
||||
// (fluid | solid | shell)
|
||||
@ -201,7 +202,7 @@ public:
|
||||
|
||||
//- Combine tableIds together
|
||||
// each dictionary entry is a wordList
|
||||
void combine(const dictionary&, labelList& tableIds);
|
||||
void combine(const dictionary& mapDict, labelList& tableIds);
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -141,7 +141,7 @@ void Foam::ensightMesh::correct()
|
||||
labelList matched;
|
||||
|
||||
bool useAll = true;
|
||||
const wordReList& matcher = option().patchSelection();
|
||||
const wordRes& matcher = option().patchSelection();
|
||||
if (notNull(matcher))
|
||||
{
|
||||
nParts = 0; // no internalMesh
|
||||
@ -151,7 +151,7 @@ void Foam::ensightMesh::correct()
|
||||
useAll = false;
|
||||
matched = findMatchingStrings
|
||||
(
|
||||
wordRes(matcher),
|
||||
matcher,
|
||||
patchNames
|
||||
);
|
||||
}
|
||||
@ -245,12 +245,12 @@ void Foam::ensightMesh::correct()
|
||||
}
|
||||
}
|
||||
|
||||
const wordReList& matcher = option().faceZoneSelection();
|
||||
const wordRes& matcher = option().faceZoneSelection();
|
||||
|
||||
wordList selectZones = mesh_.faceZones().names();
|
||||
inplaceSubsetMatchingStrings
|
||||
(
|
||||
wordRes(matcher),
|
||||
matcher,
|
||||
selectZones
|
||||
);
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -46,7 +46,7 @@ SourceFiles
|
||||
#include "HashTable.H"
|
||||
#include "Map.H"
|
||||
#include "scalarField.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
#include "globalIndex.H"
|
||||
|
||||
|
||||
@ -367,10 +367,10 @@ class ensightMesh::options
|
||||
bool noPatches_;
|
||||
|
||||
//- Output selected patches only
|
||||
autoPtr<wordReList> patchPatterns_;
|
||||
autoPtr<wordRes> patchPatterns_;
|
||||
|
||||
//- Output selected faceZones
|
||||
autoPtr<wordReList> faceZonePatterns_;
|
||||
autoPtr<wordRes> faceZonePatterns_;
|
||||
|
||||
public:
|
||||
|
||||
@ -403,10 +403,10 @@ public:
|
||||
bool usePatchSelection() const;
|
||||
|
||||
//- Selection of patches - null reference if not available
|
||||
const wordReList& patchSelection() const;
|
||||
const wordRes& patchSelection() const;
|
||||
|
||||
//- Selection of faceZones - null reference if not available
|
||||
const wordReList& faceZoneSelection() const;
|
||||
const wordRes& faceZoneSelection() const;
|
||||
|
||||
|
||||
// Edit
|
||||
@ -421,10 +421,10 @@ public:
|
||||
void noPatches(const bool);
|
||||
|
||||
//- Define patch selection matcher
|
||||
void patchSelection(const wordReList&);
|
||||
void patchSelection(const UList<wordRe>& patterns);
|
||||
|
||||
//- Define faceZone selection matcher
|
||||
void faceZoneSelection(const wordReList&);
|
||||
void faceZoneSelection(const UList<wordRe>& patterns);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -107,7 +107,7 @@ void Foam::ensightMesh::options::noPatches(const bool b)
|
||||
|
||||
void Foam::ensightMesh::options::patchSelection
|
||||
(
|
||||
const wordReList& patterns
|
||||
const UList<wordRe>& patterns
|
||||
)
|
||||
{
|
||||
if (noPatches_)
|
||||
@ -118,43 +118,39 @@ void Foam::ensightMesh::options::patchSelection
|
||||
}
|
||||
else
|
||||
{
|
||||
patchPatterns_.reset(new wordReList(patterns));
|
||||
patchPatterns_.reset(new wordRes(patterns));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::ensightMesh::options::faceZoneSelection
|
||||
(
|
||||
const wordReList& patterns
|
||||
const UList<wordRe>& patterns
|
||||
)
|
||||
{
|
||||
faceZonePatterns_.reset(new wordReList(patterns));
|
||||
faceZonePatterns_.reset(new wordRes(patterns));
|
||||
}
|
||||
|
||||
|
||||
const Foam::wordReList& Foam::ensightMesh::options::patchSelection() const
|
||||
const Foam::wordRes& Foam::ensightMesh::options::patchSelection() const
|
||||
{
|
||||
if (usePatchSelection())
|
||||
{
|
||||
return patchPatterns_();
|
||||
}
|
||||
else
|
||||
{
|
||||
return wordReList::null();
|
||||
}
|
||||
|
||||
return wordRes::null();
|
||||
}
|
||||
|
||||
|
||||
const Foam::wordReList& Foam::ensightMesh::options::faceZoneSelection() const
|
||||
const Foam::wordRes& Foam::ensightMesh::options::faceZoneSelection() const
|
||||
{
|
||||
if (faceZonePatterns_.valid())
|
||||
{
|
||||
return faceZonePatterns_();
|
||||
}
|
||||
else
|
||||
{
|
||||
return wordReList::null();
|
||||
}
|
||||
|
||||
return wordRes::null();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -249,7 +249,7 @@ Foam::MRFZone::MRFZone
|
||||
cellZoneID_(),
|
||||
excludedPatchNames_
|
||||
(
|
||||
wordReList(coeffs_.lookupOrDefault("nonRotatingPatches", wordReList()))
|
||||
coeffs_.lookupOrDefault<wordRes>("nonRotatingPatches", wordRes())
|
||||
),
|
||||
origin_(coeffs_.lookup("origin")),
|
||||
axis_(coeffs_.lookup("axis")),
|
||||
|
||||
@ -85,7 +85,7 @@ class MRFZone
|
||||
//- Cell zone ID
|
||||
label cellZoneID_;
|
||||
|
||||
const wordReList excludedPatchNames_;
|
||||
const wordRes excludedPatchNames_;
|
||||
|
||||
labelList excludedPatchLabels_;
|
||||
|
||||
|
||||
@ -25,7 +25,6 @@ License
|
||||
|
||||
#include "loopControl.H"
|
||||
#include "fvSolution.H"
|
||||
#include "wordRes.H"
|
||||
#include "solutionControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -78,7 +78,7 @@ SourceFiles
|
||||
|
||||
#include "subLoopTime.H"
|
||||
#include "dictionary.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -124,14 +124,14 @@ protected:
|
||||
dictionary convergenceDict_;
|
||||
|
||||
//- Function object names to fire during the loop (at executeInterval)
|
||||
List<wordRe> onLoop_;
|
||||
wordRes onLoop_;
|
||||
|
||||
//- Function object names to fire on convergence
|
||||
List<wordRe> onConverged_;
|
||||
wordRes onConverged_;
|
||||
|
||||
//- Function object names to fire when the loop exits without
|
||||
//- convergence
|
||||
List<wordRe> onEnd_;
|
||||
wordRes onEnd_;
|
||||
|
||||
//- Convergence tests passed
|
||||
bool converged_;
|
||||
|
||||
@ -64,10 +64,4 @@ Foam::functionObjects::fvMeshFunctionObject::fvMeshFunctionObject
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::fvMeshFunctionObject::~fvMeshFunctionObject()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -110,7 +110,8 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~fvMeshFunctionObject();
|
||||
virtual ~fvMeshFunctionObject() = default;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -71,10 +71,8 @@ bool Foam::functionObjects::ddt2::checkFormatName(const word& str)
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -116,18 +114,12 @@ Foam::functionObjects::ddt2::ddt2
|
||||
resultName_(word::null),
|
||||
blacklist_(),
|
||||
results_(),
|
||||
mag_(dict.lookupOrDefault<Switch>("mag", false))
|
||||
mag_(dict.lookupOrDefault("mag", false))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::ddt2::~ddt2()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
@ -142,10 +134,9 @@ bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
return false;
|
||||
}
|
||||
|
||||
selectFields_ = wordRes::uniq
|
||||
(
|
||||
wordReList(dict.lookup("fields"))
|
||||
);
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
selectFields_.uniq();
|
||||
|
||||
Info<< type() << " fields: " << selectFields_ << nl;
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>
|
||||
@ -166,11 +157,9 @@ bool Foam::functionObjects::ddt2::read(const dictionary& dict)
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
blacklist_.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -182,10 +171,9 @@ bool Foam::functionObjects::ddt2::execute()
|
||||
DynamicList<word> missing(selectFields_.size());
|
||||
DynamicList<word> ignored(selectFields_.size());
|
||||
|
||||
// check exact matches first
|
||||
forAll(selectFields_, i)
|
||||
// Check exact matches first
|
||||
for (const wordRe& select : selectFields_)
|
||||
{
|
||||
const wordRe& select = selectFields_[i];
|
||||
if (!select.isPattern())
|
||||
{
|
||||
const word& fieldName = static_cast<const word&>(select);
|
||||
@ -201,9 +189,9 @@ bool Foam::functionObjects::ddt2::execute()
|
||||
}
|
||||
}
|
||||
|
||||
forAllConstIter(wordHashSet, candidates, iter)
|
||||
for (const word& fieldName : candidates)
|
||||
{
|
||||
process(iter.key());
|
||||
process(fieldName);
|
||||
}
|
||||
|
||||
if (missing.size())
|
||||
@ -230,10 +218,8 @@ bool Foam::functionObjects::ddt2::write()
|
||||
|
||||
// Consistent output order
|
||||
const wordList outputList = results_.sortedToc();
|
||||
forAll(outputList, i)
|
||||
for (const word& fieldName : outputList)
|
||||
{
|
||||
const word& fieldName = outputList[i];
|
||||
|
||||
if (foundObject<regIOobject>(fieldName))
|
||||
{
|
||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||
|
||||
@ -79,10 +79,9 @@ SourceFiles
|
||||
#include "fvMeshFunctionObject.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "OFstream.H"
|
||||
#include "wordReList.H"
|
||||
#include "regExp.H"
|
||||
#include "HashSet.H"
|
||||
#include "Switch.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -102,7 +101,7 @@ class ddt2
|
||||
// Private data
|
||||
|
||||
//- Name of fields to process
|
||||
wordReList selectFields_;
|
||||
wordRes selectFields_;
|
||||
|
||||
//- Formatting for the result fields.
|
||||
word resultName_;
|
||||
@ -116,13 +115,13 @@ class ddt2
|
||||
//- Use 'mag' instead of 'magSqr'.
|
||||
// Cannot be adjusted during the simulation since it alters the
|
||||
// dimensions of the output field.
|
||||
const Switch mag_;
|
||||
const bool mag_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Check that the word contains the appropriate substitution token(s).
|
||||
static bool checkFormatName(const word&);
|
||||
static bool checkFormatName(const word& str);
|
||||
|
||||
|
||||
//- Accept unless field name appears to have already been processed
|
||||
@ -161,7 +160,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~ddt2();
|
||||
virtual ~ddt2() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -135,8 +135,9 @@ Foam::heatTransferCoeffModel::heatTransferCoeffModel
|
||||
|
||||
bool Foam::heatTransferCoeffModel::read(const dictionary& dict)
|
||||
{
|
||||
const wordReList patchNames(dict.lookup("patches"));
|
||||
patchSet_ = mesh_.boundaryMesh().patchSet(patchNames);
|
||||
patchSet_ =
|
||||
mesh_.boundaryMesh().patchSet(wordReList(dict.lookup("patches")));
|
||||
|
||||
dict.readIfPresent("qr", qrName_);
|
||||
|
||||
return true;
|
||||
|
||||
@ -156,12 +156,6 @@ Foam::functionObjects::mapFields::mapFields
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::mapFields::~mapFields()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::mapFields::read(const dictionary& dict)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -98,7 +98,7 @@ class mapFields
|
||||
autoPtr<meshToMesh> interpPtr_;
|
||||
|
||||
//- List of field names to interpolate
|
||||
wordReList fieldNames_;
|
||||
wordRes fieldNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -142,7 +142,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~mapFields();
|
||||
virtual ~mapFields() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -144,7 +144,7 @@ SourceFiles
|
||||
#include "writer.H"
|
||||
#include "Map.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
#include "coordinateSystem.H"
|
||||
#include "Switch.H"
|
||||
|
||||
@ -174,7 +174,7 @@ class regionSizeDistribution
|
||||
word alphaName_;
|
||||
|
||||
//- Patches to walk from
|
||||
wordReList patchNames_;
|
||||
wordRes patchNames_;
|
||||
|
||||
//- Switch to send output to Info as well as to file
|
||||
Switch log_;
|
||||
@ -192,7 +192,7 @@ class regionSizeDistribution
|
||||
label nBins_;
|
||||
|
||||
//- Names of fields to sample on regions
|
||||
wordReList fields_;
|
||||
wordRes fields_;
|
||||
|
||||
//- Output formatter to write
|
||||
autoPtr<writer<scalar>> formatterPtr_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -70,10 +70,8 @@ bool Foam::functionObjects::zeroGradient::checkFormatName(const word& str)
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -108,22 +106,15 @@ Foam::functionObjects::zeroGradient::zeroGradient
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::zeroGradient::~zeroGradient()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::zeroGradient::read(const dictionary& dict)
|
||||
{
|
||||
fvMeshFunctionObject::read(dict);
|
||||
|
||||
selectFields_ = wordRes::uniq
|
||||
(
|
||||
wordReList(dict.lookup("fields"))
|
||||
);
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
selectFields_.uniq();
|
||||
|
||||
Info<< type() << " fields: " << selectFields_ << nl;
|
||||
|
||||
resultName_ = dict.lookupOrDefault<word>("result", type() + "(@@)");
|
||||
@ -139,10 +130,9 @@ bool Foam::functionObjects::zeroGradient::execute()
|
||||
DynamicList<word> missing(selectFields_.size());
|
||||
DynamicList<word> ignored(selectFields_.size());
|
||||
|
||||
// check exact matches first
|
||||
forAll(selectFields_, i)
|
||||
// Check exact matches first
|
||||
for (const wordRe& select : selectFields_)
|
||||
{
|
||||
const wordRe& select = selectFields_[i];
|
||||
if (!select.isPattern())
|
||||
{
|
||||
const word& fieldName = static_cast<const word&>(select);
|
||||
@ -158,9 +148,9 @@ bool Foam::functionObjects::zeroGradient::execute()
|
||||
}
|
||||
}
|
||||
|
||||
forAllConstIter(wordHashSet, candidates, iter)
|
||||
for (const word& fieldName : candidates)
|
||||
{
|
||||
process(iter.key());
|
||||
process(fieldName);
|
||||
}
|
||||
|
||||
if (missing.size())
|
||||
@ -187,10 +177,8 @@ bool Foam::functionObjects::zeroGradient::write()
|
||||
|
||||
// Consistent output order
|
||||
const wordList outputList = results_.sortedToc();
|
||||
forAll(outputList, i)
|
||||
for (const word& fieldName : outputList)
|
||||
{
|
||||
const word& fieldName = outputList[i];
|
||||
|
||||
if (foundObject<regIOobject>(fieldName))
|
||||
{
|
||||
const regIOobject& io = lookupObject<regIOobject>(fieldName);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ SourceFiles
|
||||
#include "fvMeshFunctionObject.H"
|
||||
#include "volFieldsFwd.H"
|
||||
#include "OFstream.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -96,7 +96,7 @@ class zeroGradient
|
||||
// Private data
|
||||
|
||||
//- Name of fields to process
|
||||
wordReList selectFields_;
|
||||
wordRes selectFields_;
|
||||
|
||||
//- Formatting for the result fields.
|
||||
word resultName_;
|
||||
@ -108,7 +108,7 @@ class zeroGradient
|
||||
// Private Member Functions
|
||||
|
||||
//- Check that the word contains the appropriate substitution token(s).
|
||||
static bool checkFormatName(const word&);
|
||||
static bool checkFormatName(const word& str);
|
||||
|
||||
|
||||
//- Accept unless field only has constraint patches
|
||||
@ -151,7 +151,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~zeroGradient();
|
||||
virtual ~zeroGradient() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,6 @@ License
|
||||
#include "ensightWrite.H"
|
||||
#include "Time.H"
|
||||
#include "polyMesh.H"
|
||||
#include "wordRes.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
@ -109,23 +108,20 @@ bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
|
||||
//
|
||||
// writer options
|
||||
//
|
||||
writeOpts_.noPatches
|
||||
(
|
||||
dict.lookupOrDefault<Switch>("noPatches", false)
|
||||
);
|
||||
writeOpts_.noPatches(dict.lookupOrDefault("noPatches", false));
|
||||
|
||||
if (dict.found("patches"))
|
||||
{
|
||||
wordReList lst(dict.lookup("patches"));
|
||||
wordRes::inplaceUniq(lst);
|
||||
wordRes lst(dict.lookup("patches"));
|
||||
lst.uniq();
|
||||
|
||||
writeOpts_.patchSelection(lst);
|
||||
}
|
||||
|
||||
if (dict.found("faceZones"))
|
||||
{
|
||||
wordReList lst(dict.lookup("faceZones"));
|
||||
wordRes::inplaceUniq(lst);
|
||||
wordRes lst(dict.lookup("faceZones"));
|
||||
lst.uniq();
|
||||
|
||||
writeOpts_.faceZoneSelection(lst);
|
||||
}
|
||||
@ -137,21 +133,21 @@ bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
|
||||
caseOpts_.width(dict.lookupOrDefault<label>("width", 8));
|
||||
|
||||
// remove existing output directory
|
||||
caseOpts_.overwrite(dict.lookupOrDefault<Switch>("overwrite", false));
|
||||
caseOpts_.overwrite(dict.lookupOrDefault("overwrite", false));
|
||||
|
||||
|
||||
//
|
||||
// other options
|
||||
//
|
||||
dict.readIfPresent("directory", dirName_);
|
||||
consecutive_ = dict.lookupOrDefault<Switch>("consecutive", false);
|
||||
consecutive_ = dict.lookupOrDefault("consecutive", false);
|
||||
|
||||
|
||||
//
|
||||
// output fields
|
||||
//
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
wordRes::inplaceUniq(selectFields_);
|
||||
selectFields_.uniq();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -228,9 +224,8 @@ bool Foam::functionObjects::ensightWrite::write()
|
||||
DynamicList<word> ignored(selectFields_.size());
|
||||
|
||||
// check exact matches first
|
||||
forAll(selectFields_, i)
|
||||
for (const wordRe& select : selectFields_)
|
||||
{
|
||||
const wordRe& select = selectFields_[i];
|
||||
if (!select.isPattern())
|
||||
{
|
||||
const word& fieldName = static_cast<const word&>(select);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -90,7 +90,6 @@ SourceFiles
|
||||
#include "ensightCase.H"
|
||||
#include "ensightMesh.H"
|
||||
|
||||
#include "wordReList.H"
|
||||
#include "interpolation.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
@ -121,7 +120,7 @@ class ensightWrite
|
||||
ensightCase::options caseOpts_;
|
||||
|
||||
//- Name of fields to process
|
||||
wordReList selectFields_;
|
||||
wordRes selectFields_;
|
||||
|
||||
//- Output directory name
|
||||
fileName dirName_;
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -106,7 +106,7 @@ bool Foam::functionObjects::vtkWrite::read(const dictionary& dict)
|
||||
// output fields
|
||||
//
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
wordRes::inplaceUniq(selectFields_);
|
||||
selectFields_.uniq();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -137,7 +137,7 @@ bool Foam::functionObjects::vtkWrite::write()
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
// Strip off leading casename, leaving just processor_DDD ending.
|
||||
string::size_type i = vtkName.rfind("processor");
|
||||
const auto i = vtkName.rfind("processor");
|
||||
|
||||
if (i != string::npos)
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -101,7 +101,7 @@ class vtkWrite
|
||||
vtk::outputOptions writeOpts_;
|
||||
|
||||
//- Name of fields to process
|
||||
wordReList selectFields_;
|
||||
wordRes selectFields_;
|
||||
|
||||
//- Output directory name
|
||||
fileName dirName_;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -81,12 +81,6 @@ Foam::functionObjects::writeObjects::writeObjects
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::writeObjects::~writeObjects()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::writeObjects::read(const dictionary& dict)
|
||||
@ -134,29 +128,26 @@ bool Foam::functionObjects::writeObjects::write()
|
||||
}
|
||||
|
||||
DynamicList<word> allNames(obr_.toc().size());
|
||||
forAll(objectNames_, i)
|
||||
for (const wordRe& objName : objectNames_)
|
||||
{
|
||||
wordList names(obr_.names<regIOobject>(objectNames_[i]));
|
||||
wordList names(obr_.names<regIOobject>(objName));
|
||||
|
||||
if (names.size())
|
||||
{
|
||||
allNames.append(names);
|
||||
allNames.append(std::move(names));
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Object " << objectNames_[i] << " not found in "
|
||||
<< "Object " << objName << " not found in "
|
||||
<< "database. Available objects:" << nl << obr_.sortedToc()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
forAll(allNames, i)
|
||||
for (const word& objName : allNames)
|
||||
{
|
||||
regIOobject& obj = const_cast<regIOobject&>
|
||||
(
|
||||
obr_.lookupObject<regIOobject>(allNames[i])
|
||||
);
|
||||
regIOobject& obj = obr_.lookupObjectRef<regIOobject>(objName);
|
||||
|
||||
switch (writeOption_)
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -132,7 +132,7 @@ private:
|
||||
writeOption writeOption_;
|
||||
|
||||
//- Names of objects to control
|
||||
wordReList objectNames_;
|
||||
wordRes objectNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -162,7 +162,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~writeObjects();
|
||||
virtual ~writeObjects() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -62,12 +62,6 @@ Foam::inverseDistanceDiffusivity::inverseDistanceDiffusivity
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::inverseDistanceDiffusivity::~inverseDistanceDiffusivity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::inverseDistanceDiffusivity::correct()
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -36,7 +36,7 @@ SourceFiles
|
||||
#define inverseDistanceDiffusivity_H
|
||||
|
||||
#include "uniformDiffusivity.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -55,7 +55,7 @@ class inverseDistanceDiffusivity
|
||||
|
||||
//- Patches selected to base the distance on
|
||||
// These can contain patch names or regular expressions to search for.
|
||||
wordReList patchNames_;
|
||||
wordRes patchNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -81,7 +81,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~inverseDistanceDiffusivity();
|
||||
virtual ~inverseDistanceDiffusivity() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -59,12 +59,6 @@ Foam::inversePointDistanceDiffusivity::inversePointDistanceDiffusivity
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::inversePointDistanceDiffusivity::~inversePointDistanceDiffusivity()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::inversePointDistanceDiffusivity::correct()
|
||||
|
||||
@ -36,6 +36,7 @@ SourceFiles
|
||||
#define inversePointDistanceDiffusivity_H
|
||||
|
||||
#include "uniformDiffusivity.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -53,7 +54,7 @@ class inversePointDistanceDiffusivity
|
||||
// Private data
|
||||
|
||||
//- Patches selected to base the distance on
|
||||
wordReList patchNames_;
|
||||
wordRes patchNames_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -78,7 +79,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~inversePointDistanceDiffusivity();
|
||||
virtual ~inversePointDistanceDiffusivity() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -69,7 +69,7 @@ Foam::cellDistFuncs::cellDistFuncs(const polyMesh& mesh)
|
||||
|
||||
Foam::labelHashSet Foam::cellDistFuncs::getPatchIDs
|
||||
(
|
||||
const wordReList& patchNames
|
||||
const UList<wordRe>& patchNames
|
||||
) const
|
||||
{
|
||||
return mesh().boundaryMesh().patchSet(patchNames, false);
|
||||
|
||||
@ -38,7 +38,7 @@ SourceFiles
|
||||
|
||||
#include "HashSet.H"
|
||||
#include "Map.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRe.H"
|
||||
#include "scalarField.H"
|
||||
#include "point.H"
|
||||
#include "primitivePatch.H"
|
||||
@ -98,7 +98,7 @@ public:
|
||||
}
|
||||
|
||||
//- Return the set of patch IDs corresponding to the given names
|
||||
labelHashSet getPatchIDs(const wordReList& patchNames) const;
|
||||
labelHashSet getPatchIDs(const UList<wordRe>& patchNames) const;
|
||||
|
||||
//- Get patchIDs of/derived off certain type (e.g. 'processorPolyPatch')
|
||||
// Uses isA, not isType
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -54,7 +54,7 @@ Foam::wordList Foam::subTriSurfaceMesh::patchNames(const triSurface& s)
|
||||
Foam::labelList Foam::subTriSurfaceMesh::selectedRegions
|
||||
(
|
||||
const triSurface& s,
|
||||
const wordReList& regionNames
|
||||
const UList<wordRe>& regionNames
|
||||
)
|
||||
{
|
||||
const wordList names(patchNames(s));
|
||||
@ -92,7 +92,7 @@ Foam::triSurface Foam::subTriSurfaceMesh::subset
|
||||
const triSurfaceMesh& s =
|
||||
io.db().lookupObject<triSurfaceMesh>(subGeomName);
|
||||
|
||||
const wordReList regionNames(dict.lookup("patches"));
|
||||
const wordRes regionNames(dict.lookup("patches"));
|
||||
|
||||
labelList regionMap(selectedRegions(s, regionNames));
|
||||
|
||||
@ -137,10 +137,4 @@ Foam::subTriSurfaceMesh::subTriSurfaceMesh
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::subTriSurfaceMesh::~subTriSurfaceMesh()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ class subTriSurfaceMesh
|
||||
static labelList selectedRegions
|
||||
(
|
||||
const triSurface& s,
|
||||
const wordReList& regionNames
|
||||
const UList<wordRe>& regionNames
|
||||
);
|
||||
|
||||
//- Subset triSurface based on regions
|
||||
@ -100,7 +100,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~subTriSurfaceMesh();
|
||||
virtual ~subTriSurfaceMesh() = default;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -65,12 +65,6 @@ Foam::triSurfaceLoader::triSurfaceLoader(const Time& runTime)
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::triSurfaceLoader::~triSurfaceLoader()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::triSurfaceLoader::readDir()
|
||||
@ -85,9 +79,8 @@ Foam::label Foam::triSurfaceLoader::readDir()
|
||||
// (eg, files with/without .gz)
|
||||
wordHashSet names(2*files.size());
|
||||
|
||||
forAll(files, filei)
|
||||
for (const fileName& f : files)
|
||||
{
|
||||
const fileName& f = files[filei];
|
||||
if (triSurface::canRead(f))
|
||||
{
|
||||
names.insert(f.name());
|
||||
@ -151,7 +144,7 @@ Foam::label Foam::triSurfaceLoader::select(const wordRe& mat)
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::triSurfaceLoader::select(const wordReList& matcher)
|
||||
Foam::label Foam::triSurfaceLoader::select(const UList<wordRe>& matcher)
|
||||
{
|
||||
// Need to be more careful when select.
|
||||
// - preserve same order as the input matcher itself
|
||||
@ -167,18 +160,15 @@ Foam::label Foam::triSurfaceLoader::select(const wordReList& matcher)
|
||||
wordHashSet hashedMissing(2*matcher.size());
|
||||
|
||||
// Exact matches must exist
|
||||
forAll(matcher, i)
|
||||
for (const wordRe& mat : matcher)
|
||||
{
|
||||
const wordRe& mat = matcher[i];
|
||||
|
||||
if (mat.isPattern())
|
||||
{
|
||||
labelList indices = findMatchingStrings(mat, available_);
|
||||
sort(indices);
|
||||
|
||||
forAll(indices, j)
|
||||
for (const label idx : indices)
|
||||
{
|
||||
const label idx = indices[j];
|
||||
if (hashedFound.insert(idx))
|
||||
{
|
||||
foundIds.append(idx);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -28,7 +28,7 @@ Description
|
||||
Convenience class for loading single or multiple surface files
|
||||
from the constant/triSurface (or other) directory.
|
||||
|
||||
Surfaces selection based on word, wordRe, wordReList.
|
||||
Surfaces selection based on word, wordRe, list of wordRe.
|
||||
If multiple surfaces are selected, they are concatenated into a
|
||||
single surface with offset faces,points,regions.
|
||||
|
||||
@ -109,7 +109,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~triSurfaceLoader();
|
||||
~triSurfaceLoader() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
@ -151,7 +151,7 @@ public:
|
||||
label select(const wordRe& mat);
|
||||
|
||||
//- Populates 'selected' with a subset of the available files.
|
||||
label select(const wordReList& matcher);
|
||||
label select(const UList<wordRe>& matcher);
|
||||
|
||||
//- Load a single file, or load and combine multiple selected files
|
||||
// Optionally scale the surface(s) on input, with a zero or negative
|
||||
|
||||
@ -69,7 +69,7 @@ preserveFaceZonesConstraint
|
||||
Foam::decompositionConstraints::preserveFaceZonesConstraint::
|
||||
preserveFaceZonesConstraint
|
||||
(
|
||||
const wordReList& zones
|
||||
const UList<wordRe>& zones
|
||||
)
|
||||
:
|
||||
decompositionConstraint(dictionary(), typeName),
|
||||
|
||||
@ -37,7 +37,7 @@ SourceFiles
|
||||
#define preserveFaceZonesConstraint_H
|
||||
|
||||
#include "decompositionConstraint.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -58,7 +58,7 @@ class preserveFaceZonesConstraint
|
||||
// Private data
|
||||
|
||||
//- List of zones to keep together
|
||||
wordReList zones_;
|
||||
wordRes zones_;
|
||||
|
||||
|
||||
public:
|
||||
@ -77,12 +77,11 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
preserveFaceZonesConstraint(const wordReList& zones);
|
||||
preserveFaceZonesConstraint(const UList<wordRe>& zones);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~preserveFaceZonesConstraint()
|
||||
{}
|
||||
virtual ~preserveFaceZonesConstraint() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -69,7 +69,7 @@ preservePatchesConstraint
|
||||
Foam::decompositionConstraints::preservePatchesConstraint::
|
||||
preservePatchesConstraint
|
||||
(
|
||||
const wordReList& patches
|
||||
const UList<wordRe>& patches
|
||||
)
|
||||
:
|
||||
decompositionConstraint(dictionary(), typeName),
|
||||
|
||||
@ -37,7 +37,7 @@ SourceFiles
|
||||
#define preservePatchesConstraint_H
|
||||
|
||||
#include "decompositionConstraint.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -58,7 +58,7 @@ class preservePatchesConstraint
|
||||
// Private data
|
||||
|
||||
//- List of patches to keep together
|
||||
wordReList patches_;
|
||||
wordRes patches_;
|
||||
|
||||
|
||||
public:
|
||||
@ -77,13 +77,12 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
preservePatchesConstraint(const wordReList& patches);
|
||||
preservePatchesConstraint(const UList<wordRe>& patches);
|
||||
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~preservePatchesConstraint()
|
||||
{}
|
||||
virtual ~preservePatchesConstraint() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
@ -36,6 +36,7 @@ SourceFiles
|
||||
#define structuredDecomp_H
|
||||
|
||||
#include "decompositionMethod.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
@ -52,7 +53,7 @@ class structuredDecomp
|
||||
|
||||
dictionary methodDict_;
|
||||
|
||||
wordReList patches_;
|
||||
wordRes patches_;
|
||||
|
||||
autoPtr<decompositionMethod> method_;
|
||||
|
||||
@ -77,8 +78,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~structuredDecomp()
|
||||
{}
|
||||
virtual ~structuredDecomp() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -46,9 +46,9 @@ defineTypeNameAndDebug(contactAngleForce, 0);
|
||||
|
||||
void contactAngleForce::initialise()
|
||||
{
|
||||
const wordReList zeroForcePatches
|
||||
const wordRes zeroForcePatches
|
||||
(
|
||||
coeffDict_.lookupOrDefault<wordReList>("zeroForcePatches", wordReList())
|
||||
coeffDict_.lookupOrDefault<wordRes>("zeroForcePatches", wordRes())
|
||||
);
|
||||
|
||||
if (zeroForcePatches.size())
|
||||
|
||||
@ -56,8 +56,8 @@ Foam::structuredRenumber::structuredRenumber
|
||||
patches_(methodDict_.lookup("patches")),
|
||||
nLayers_(methodDict_.lookupOrDefault<label>("nLayers", labelMax)),
|
||||
depthFirst_(methodDict_.lookup("depthFirst")),
|
||||
method_(renumberMethod::New(methodDict_)),
|
||||
reverse_(methodDict_.lookup("reverse"))
|
||||
reverse_(methodDict_.lookup("reverse")),
|
||||
method_(renumberMethod::New(methodDict_))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -89,22 +89,22 @@ public:
|
||||
|
||||
const dictionary methodDict_;
|
||||
|
||||
const wordReList patches_;
|
||||
const wordRes patches_;
|
||||
|
||||
const label nLayers_;
|
||||
|
||||
const Switch depthFirst_;
|
||||
|
||||
const autoPtr<renumberMethod> method_;
|
||||
|
||||
const Switch reverse_;
|
||||
|
||||
const autoPtr<renumberMethod> method_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
void operator=(const structuredRenumber&);
|
||||
structuredRenumber(const structuredRenumber&);
|
||||
void operator=(const structuredRenumber&) = delete;
|
||||
structuredRenumber(const structuredRenumber&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
@ -120,8 +120,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~structuredRenumber()
|
||||
{}
|
||||
virtual ~structuredRenumber() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,7 +60,7 @@ Foam::rigidBodyMeshMotion::bodyMesh::bodyMesh
|
||||
:
|
||||
name_(name),
|
||||
bodyID_(bodyID),
|
||||
patches_(wordReList(dict.lookup("patches"))),
|
||||
patches_(dict.lookup("patches")),
|
||||
patchSet_(mesh.boundaryMesh().patchSet(patches_)),
|
||||
di_(readScalar(dict.lookup("innerDistance"))),
|
||||
do_(readScalar(dict.lookup("outerDistance"))),
|
||||
@ -113,7 +113,7 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
|
||||
)
|
||||
: coeffDict()
|
||||
),
|
||||
test_(coeffDict().lookupOrDefault<Switch>("test", false)),
|
||||
test_(coeffDict().lookupOrDefault("test", false)),
|
||||
rhoInf_(1.0),
|
||||
rhoName_(coeffDict().lookupOrDefault<word>("rho", "rho")),
|
||||
ramp_(nullptr),
|
||||
@ -208,12 +208,6 @@ Foam::rigidBodyMeshMotion::rigidBodyMeshMotion
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rigidBodyMeshMotion::~rigidBodyMeshMotion()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::pointField>
|
||||
|
||||
@ -68,7 +68,7 @@ class rigidBodyMeshMotion
|
||||
const label bodyID_;
|
||||
|
||||
//- List of mesh patches associated with this body
|
||||
const wordReList patches_;
|
||||
const wordRes patches_;
|
||||
|
||||
//- Patches to integrate forces
|
||||
const labelHashSet patchSet_;
|
||||
@ -107,9 +107,8 @@ class rigidBodyMeshMotion
|
||||
// weighting for each body
|
||||
PtrList<bodyMesh> bodyMeshes_;
|
||||
|
||||
//- Switch for test-mode in which only the
|
||||
// gravitational body-force is applied
|
||||
Switch test_;
|
||||
//- Test-mode in which only the gravitational body-force is applied
|
||||
bool test_;
|
||||
|
||||
//- Reference density required by the forces object for
|
||||
// incompressible calculations, required if rho == rhoInf
|
||||
@ -130,13 +129,10 @@ class rigidBodyMeshMotion
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
rigidBodyMeshMotion
|
||||
(
|
||||
const rigidBodyMeshMotion&
|
||||
);
|
||||
rigidBodyMeshMotion(const rigidBodyMeshMotion&) = delete;
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const rigidBodyMeshMotion&);
|
||||
void operator=(const rigidBodyMeshMotion&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
@ -156,7 +152,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~rigidBodyMeshMotion();
|
||||
~rigidBodyMeshMotion() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -59,7 +59,7 @@ Foam::rigidBodyMeshMotionSolver::bodyMesh::bodyMesh
|
||||
:
|
||||
name_(name),
|
||||
bodyID_(bodyID),
|
||||
patches_(wordReList(dict.lookup("patches"))),
|
||||
patches_(dict.lookup("patches")),
|
||||
patchSet_(mesh.boundaryMesh().patchSet(patches_))
|
||||
{}
|
||||
|
||||
@ -96,7 +96,7 @@ Foam::rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver
|
||||
)
|
||||
: coeffDict()
|
||||
),
|
||||
test_(coeffDict().lookupOrDefault<Switch>("test", false)),
|
||||
test_(coeffDict().lookupOrDefault("test", false)),
|
||||
rhoInf_(1.0),
|
||||
rhoName_(coeffDict().lookupOrDefault<word>("rho", "rho")),
|
||||
curTimeIndex_(-1),
|
||||
@ -158,12 +158,6 @@ Foam::rigidBodyMeshMotionSolver::rigidBodyMeshMotionSolver
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::rigidBodyMeshMotionSolver::~rigidBodyMeshMotionSolver()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::pointField>
|
||||
|
||||
@ -64,7 +64,7 @@ class rigidBodyMeshMotionSolver
|
||||
const label bodyID_;
|
||||
|
||||
//- List of mesh patches associated with this body
|
||||
const wordReList patches_;
|
||||
const wordRes patches_;
|
||||
|
||||
//- Patches to integrate forces
|
||||
const labelHashSet patchSet_;
|
||||
@ -93,9 +93,8 @@ class rigidBodyMeshMotionSolver
|
||||
// weighting for each body
|
||||
PtrList<bodyMesh> bodyMeshes_;
|
||||
|
||||
//- Switch for test-mode in which only the
|
||||
// gravitational body-force is applied
|
||||
Switch test_;
|
||||
//- Test-mode in which only the gravitational body-force is applied
|
||||
bool test_;
|
||||
|
||||
//- Reference density required by the forces object for
|
||||
// incompressible calculations, required if rho == rhoInf
|
||||
@ -143,7 +142,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~rigidBodyMeshMotionSolver();
|
||||
~rigidBodyMeshMotionSolver() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -238,11 +238,7 @@ Foam::patchProbes::patchProbes
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::patchProbes::~patchProbes()
|
||||
{}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::patchProbes::write()
|
||||
{
|
||||
@ -269,9 +265,10 @@ bool Foam::patchProbes::read(const dictionary& dict)
|
||||
{
|
||||
if (!dict.readIfPresent("patches", patchNames_))
|
||||
{
|
||||
word patchName(dict.lookup("patch"));
|
||||
patchNames_ = wordReList(1, wordRe(patchName));
|
||||
patchNames_.setSize(1);
|
||||
patchNames_[0] = wordRe(word(dict.lookup("patch")));
|
||||
}
|
||||
|
||||
return probes::read(dict);
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -96,7 +96,7 @@ protected:
|
||||
// Protected data
|
||||
|
||||
//- Patches to sample
|
||||
wordReList patchNames_;
|
||||
wordRes patchNames_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
@ -173,7 +173,7 @@ public:
|
||||
);
|
||||
|
||||
//- Destructor
|
||||
virtual ~patchProbes();
|
||||
virtual ~patchProbes() = default;
|
||||
|
||||
|
||||
//- Public members
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -313,11 +313,6 @@ Foam::probes::probes
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::probes::~probes()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -85,7 +85,7 @@ SourceFiles
|
||||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
#include "surfaceMesh.H"
|
||||
#include "wordReList.H"
|
||||
#include "wordRes.H"
|
||||
|
||||
using namespace Foam::functionObjects;
|
||||
|
||||
@ -141,7 +141,7 @@ protected:
|
||||
// Read from dictonary
|
||||
|
||||
//- Names of fields to probe
|
||||
wordReList fieldSelection_;
|
||||
wordRes fieldSelection_;
|
||||
|
||||
//- Fixed locations, default = yes
|
||||
// Note: set to false for moving mesh calculations where locations
|
||||
@ -254,13 +254,13 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~probes();
|
||||
virtual ~probes() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return names of fields to probe
|
||||
virtual const wordReList& fieldNames() const
|
||||
virtual const wordRes& fieldNames() const
|
||||
{
|
||||
return fieldSelection_;
|
||||
}
|
||||
|
||||
@ -314,10 +314,4 @@ Foam::patchCloudSet::patchCloudSet
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::patchCloudSet::~patchCloudSet()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -112,7 +112,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~patchCloudSet();
|
||||
virtual ~patchCloudSet() = default;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -364,10 +364,4 @@ Foam::patchSeedSet::patchSeedSet
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::patchSeedSet::~patchSeedSet()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user