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