Skip to content
Snippets Groups Projects
Commit 02517e97 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: no implicit loading of controlDict libs for foamListRegions (#1713)

ENH: eliminate duplicate input region types
parent a5a50469
No related merge requests found
......@@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -68,8 +68,14 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
// As per "createTime.H", but quieter.
Time runTime(Time::controlDictName, args);
// Silent version of "createTime.H", without libraries
Time runTime
(
Time::controlDictName,
args,
false, // no enableFunctionObjects
false // no enableLibs
);
regionProperties rp(runTime);
......@@ -78,24 +84,32 @@ int main(int argc, char *argv[])
if (args.size() > 1)
{
regionTypes.setSize(args.size()-1);
regionTypes.resize(args.size()-1);
// No duplicates
wordHashSet uniq;
label nTypes = 0;
for (label argi = 1; argi < args.size(); ++argi)
{
regionTypes[nTypes] = args[argi];
if (rp.found(regionTypes[nTypes]))
{
++nTypes;
}
else
const word& regType = regionTypes[nTypes];
if (uniq.insert(regType))
{
std::cerr<< "No region-type: " << regionTypes[nTypes] << nl;
if (rp.found(regType))
{
++nTypes;
}
else
{
InfoErr<< "No region-type: " << regType << nl;
}
}
}
regionTypes.setSize(nTypes);
regionTypes.resize(nTypes);
}
else
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment