Skip to content
Snippets Groups Projects

add multi-region handling for checkMesh etc, centralized the region handling #2072

Merged Mark OLESEN requested to merge feature-allRegions into develop
31 files
+ 1346
1023
Compare changes
  • Side-by-side
  • Inline
Files
31
@@ -55,12 +55,8 @@ int main(int argc, char *argv[])
@@ -55,12 +55,8 @@ int main(int argc, char *argv[])
argList::noParallel();
argList::noParallel();
argList::noBanner();
argList::noBanner();
#include "addRegionOption.H"
#include "addAllRegionOptions.H"
argList::addBoolOption
(
"allRegions",
"operate on all regions in regionProperties"
);
argList::addBoolOption
argList::addBoolOption
(
(
"verbose",
"verbose",
@@ -76,11 +72,11 @@ int main(int argc, char *argv[])
@@ -76,11 +72,11 @@ int main(int argc, char *argv[])
const auto decompFile = args.get<fileName>(1);
const auto decompFile = args.get<fileName>(1);
const bool region = args.found("region");
const bool region = args.found("region");
const bool allRegions = args.found("allRegions");
const bool verbose = args.found("verbose");
const bool verbose = args.found("verbose");
// Set time from database
// Set time from database
#include "createTime.H"
#include "createTime.H"
 
// Allow override of time
// Allow override of time
instantList times = timeSelector::selectIfPresent(runTime, args);
instantList times = timeSelector::selectIfPresent(runTime, args);
@@ -88,31 +84,18 @@ int main(int argc, char *argv[])
@@ -88,31 +84,18 @@ int main(int argc, char *argv[])
const fileName decompDictFile =
const fileName decompDictFile =
args.getOrDefault<fileName>("decomposeParDict", "");
args.getOrDefault<fileName>("decomposeParDict", "");
wordList regionNames;
// Get region names
wordList regionDirs;
#include "getAllRegionOptions.H"
if (allRegions)
 
wordList regionDirs(regionNames);
 
if (regionDirs.size() == 1 && regionDirs[0] == polyMesh::defaultRegion)
{
{
Info<< "Decomposing all regions in regionProperties" << nl << endl;
regionDirs[0].clear();
regionProperties rp(runTime);
forAllConstIters(rp, iter)
{
const wordList& regions = iter();
forAll(regions, i)
{
regionNames.appendUniq(regions[i]);
}
}
regionDirs = regionNames;
}
}
else
else
{
{
regionNames.resize(1, fvMesh::defaultRegion);
Info<< "Decomposing regions: "
regionDirs.resize(1, word::null);
<< flatOutput(regionNames) << nl << endl;
if (args.readIfPresent("region", regionNames.first()))
{
regionDirs.first() = regionNames.first();
}
}
}
labelList cellToProc;
labelList cellToProc;
Loading