diff --git a/applications/test/checkDecomposePar/Test-checkDecomposePar.C b/applications/test/checkDecomposePar/Test-checkDecomposePar.C index 41e46a9cf6..52ca8f9961 100644 --- a/applications/test/checkDecomposePar/Test-checkDecomposePar.C +++ b/applications/test/checkDecomposePar/Test-checkDecomposePar.C @@ -55,12 +55,8 @@ int main(int argc, char *argv[]) argList::noParallel(); argList::noBanner(); - #include "addRegionOption.H" - argList::addBoolOption - ( - "allRegions", - "operate on all regions in regionProperties" - ); + #include "addAllRegionOptions.H" + argList::addBoolOption ( "verbose", @@ -76,11 +72,11 @@ int main(int argc, char *argv[]) const auto decompFile = args.get(1); const bool region = args.found("region"); - const bool allRegions = args.found("allRegions"); const bool verbose = args.found("verbose"); // Set time from database #include "createTime.H" + // Allow override of time instantList times = timeSelector::selectIfPresent(runTime, args); @@ -88,31 +84,18 @@ int main(int argc, char *argv[]) const fileName decompDictFile = args.getOrDefault("decomposeParDict", ""); - wordList regionNames; - wordList regionDirs; - if (allRegions) + // Get region names + #include "getAllRegionOptions.H" + + wordList regionDirs(regionNames); + if (regionDirs.size() == 1 && regionDirs[0] == polyMesh::defaultRegion) { - Info<< "Decomposing all regions in regionProperties" << nl << endl; - regionProperties rp(runTime); - forAllConstIters(rp, iter) - { - const wordList& regions = iter(); - forAll(regions, i) - { - regionNames.appendUniq(regions[i]); - } - } - regionDirs = regionNames; + regionDirs[0].clear(); } else { - regionNames.resize(1, fvMesh::defaultRegion); - regionDirs.resize(1, word::null); - - if (args.readIfPresent("region", regionNames.first())) - { - regionDirs.first() = regionNames.first(); - } + Info<< "Decomposing regions: " + << flatOutput(regionNames) << nl << endl; } labelList cellToProc; diff --git a/applications/test/decomposePar/Test-decomposePar.C b/applications/test/decomposePar/Test-decomposePar.C index 2192f1007d..d94e29df39 100644 --- a/applications/test/decomposePar/Test-decomposePar.C +++ b/applications/test/decomposePar/Test-decomposePar.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017-2020 OpenCFD Ltd. + Copyright (C) 2017-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -62,12 +62,9 @@ int main(int argc, char *argv[]) "file", "Use specified file for decomposePar dictionary" ); - #include "addRegionOption.H" - argList::addBoolOption - ( - "allRegions", - "Operate on all regions in regionProperties" - ); + + #include "addAllRegionOptions.H" + argList::addBoolOption ( "verbose", @@ -107,7 +104,6 @@ int main(int argc, char *argv[]) #include "setRootCase.H" const bool optRegion = args.found("region"); - const bool allRegions = args.found("allRegions"); const bool verbose = args.found("verbose"); const label numSubdomains = args.getOrDefault