mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: no implicit loading of controlDict libs for foamListRegions (#1713)
ENH: eliminate duplicate input region types
This commit is contained in:
@ -5,7 +5,7 @@
|
|||||||
\\ / A nd | www.openfoam.com
|
\\ / A nd | www.openfoam.com
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2017 OpenCFD Ltd.
|
Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -68,8 +68,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
|
|
||||||
// As per "createTime.H", but quieter.
|
// Silent version of "createTime.H", without libraries
|
||||||
Time runTime(Time::controlDictName, args);
|
Time runTime
|
||||||
|
(
|
||||||
|
Time::controlDictName,
|
||||||
|
args,
|
||||||
|
false, // no enableFunctionObjects
|
||||||
|
false // no enableLibs
|
||||||
|
);
|
||||||
|
|
||||||
regionProperties rp(runTime);
|
regionProperties rp(runTime);
|
||||||
|
|
||||||
@ -78,24 +84,32 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (args.size() > 1)
|
if (args.size() > 1)
|
||||||
{
|
{
|
||||||
regionTypes.setSize(args.size()-1);
|
regionTypes.resize(args.size()-1);
|
||||||
|
|
||||||
|
// No duplicates
|
||||||
|
wordHashSet uniq;
|
||||||
|
|
||||||
label nTypes = 0;
|
label nTypes = 0;
|
||||||
for (label argi = 1; argi < args.size(); ++argi)
|
for (label argi = 1; argi < args.size(); ++argi)
|
||||||
{
|
{
|
||||||
regionTypes[nTypes] = args[argi];
|
regionTypes[nTypes] = args[argi];
|
||||||
|
|
||||||
if (rp.found(regionTypes[nTypes]))
|
const word& regType = regionTypes[nTypes];
|
||||||
|
|
||||||
|
if (uniq.insert(regType))
|
||||||
{
|
{
|
||||||
++nTypes;
|
if (rp.found(regType))
|
||||||
}
|
{
|
||||||
else
|
++nTypes;
|
||||||
{
|
}
|
||||||
std::cerr<< "No region-type: " << regionTypes[nTypes] << nl;
|
else
|
||||||
|
{
|
||||||
|
InfoErr<< "No region-type: " << regType << nl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
regionTypes.setSize(nTypes);
|
regionTypes.resize(nTypes);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user