mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add 'filtered' polyMesh regionName() method
- in various situations with mesh regions it is also useful to
filter out or remove the defaultRegion name (ie, "region0").
Can now do that conveniently from the polyMesh itself or as a static
function. Simply use this
const word& regionDir = polyMesh::regionName(regionName);
OR mesh.regionName()
instead of
const word& regionDir =
(
regionName != polyMesh::defaultRegion
? regionName
: word::null
);
Additionally, since the string '/' join operator filters out empty
strings, the following will work correctly:
(polyMesh::regionName(regionName)/polyMesh::meshSubDir)
(mesh.regionName()/polyMesh::meshSubDir)
This commit is contained in:
@ -220,19 +220,21 @@ int main(int argc, char *argv[])
|
||||
const fileName rootDirSource = casePath.path();
|
||||
const fileName caseDirSource = casePath.name();
|
||||
|
||||
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
|
||||
word sourceRegion = polyMesh::defaultRegion;
|
||||
Info<< "Source: " << rootDirSource << ' ' << caseDirSource;
|
||||
word sourceRegion(polyMesh::defaultRegion);
|
||||
if (args.readIfPresent("sourceRegion", sourceRegion))
|
||||
{
|
||||
Info<< "Source region: " << sourceRegion << endl;
|
||||
Info<< " (region " << sourceRegion << ')';
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
|
||||
word targetRegion = polyMesh::defaultRegion;
|
||||
Info<< "Target: " << rootDirTarget << ' ' << caseDirTarget;
|
||||
word targetRegion(polyMesh::defaultRegion);
|
||||
if (args.readIfPresent("targetRegion", targetRegion))
|
||||
{
|
||||
Info<< "Target region: " << targetRegion << endl;
|
||||
Info<< " (region " << targetRegion << ')';
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
const bool consistent = args.found("consistent");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user