STYLE: more consistency in handling of -region vs -allRegions

This commit is contained in:
Mark Olesen
2018-07-19 09:15:33 +02:00
parent 8042647610
commit 7cb5b638ad
4 changed files with 20 additions and 29 deletions

View File

@ -108,16 +108,12 @@ int main(int argc, char *argv[])
}
else
{
word regionName;
if (args.readIfPresent("region", regionName))
regionNames.resize(1, fvMesh::defaultRegion);
regionDirs.resize(1, word::null);
if (args.readIfPresent("region", regionNames.first()))
{
regionNames = wordList(1, regionName);
regionDirs = regionNames;
}
else
{
regionNames = wordList(1, fvMesh::defaultRegion);
regionDirs = wordList(1, word::null);
regionDirs.first() = regionNames.first();
}
}

View File

@ -146,16 +146,12 @@ int main(int argc, char *argv[])
}
else
{
word regionName;
if (args.readIfPresent("region", regionName))
regionNames.resize(1, fvMesh::defaultRegion);
regionDirs.resize(1, word::null);
if (args.readIfPresent("region", regionNames.first()))
{
regionNames = wordList(1, regionName);
regionDirs = regionNames;
}
else
{
regionNames = wordList(1, fvMesh::defaultRegion);
regionDirs = wordList(1, word::null);
regionDirs.first() = regionNames.first();
}
}

View File

@ -247,7 +247,7 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"copyZero",
"Copy \a 0 directory to processor* rather than decompose the fields"
"Copy a 0 directory to processor* rather than decompose the fields"
);
argList::addBoolOption
(
@ -318,15 +318,16 @@ int main(int argc, char *argv[])
}
else
{
regionNames = {fvMesh::defaultRegion};
args.readIfPresent("region", regionNames[0]);
regionNames.resize(1);
regionNames.first() =
args.lookupOrDefault<word>("region", fvMesh::defaultRegion);
}
forAll(regionNames, regioni)
{
const word& regionName = regionNames[regioni];
const word& regionDir =
regionName == fvMesh::defaultRegion ? word::null : regionName;
(regionName == fvMesh::defaultRegion ? word::null : regionName);
Info<< "\n\nDecomposing mesh " << regionName << nl << endl;

View File

@ -194,14 +194,12 @@ int main(int argc, char *argv[])
}
else
{
regionNames = {fvMesh::defaultRegion};
if (args.readIfPresent("region", regionNames[0]))
regionNames.resize(1, fvMesh::defaultRegion);
regionDirs.resize(1, word::null);
if (args.readIfPresent("region", regionNames.first()))
{
regionDirs = regionNames;
}
else
{
regionDirs = {word::null};
regionDirs.first() = regionNames.first();
}
}