mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: minor simplifications for handling region meshes
- static version of polyMesh::meshDir(), which takes a region name
polyMesh::meshDir(regionName)
vs
polyMesh::regionName(regionName)/polyMesh::meshSubDir
STYLE: use polyMesh::regionName(..) instead of comparing to defaultRegion
STYLE: use getOrDefault when retrieving various -region options
FIX: polyMesh::dbDir() now checks registry name, not full path (#3033)
This commit is contained in:
@ -129,7 +129,7 @@ int main(int argc, char *argv[])
|
||||
const word& regionName = regionNames[regioni];
|
||||
const fileName meshDir
|
||||
(
|
||||
polyMesh::regionName(regionName)/polyMesh::meshSubDir
|
||||
polyMesh::meshDir(regionName)
|
||||
);
|
||||
|
||||
if (regionNames.size() > 1)
|
||||
|
||||
@ -86,7 +86,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "createNamedPolyMesh.H"
|
||||
|
||||
const fileName setsSubPath(mesh.dbDir()/polyMesh::meshSubDir/"sets");
|
||||
const fileName setsSubPath(mesh.meshDir()/"sets");
|
||||
|
||||
// Search for list of objects for the time of the mesh
|
||||
word setsInstance = runTime.findInstance
|
||||
|
||||
@ -894,7 +894,7 @@ void createAndWriteRegion
|
||||
(
|
||||
"pointRegionAddressing",
|
||||
newMesh().facesInstance(),
|
||||
newMesh().meshSubDir,
|
||||
polyMesh::meshSubDir,
|
||||
newMesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
@ -913,7 +913,7 @@ void createAndWriteRegion
|
||||
(
|
||||
"faceRegionAddressing",
|
||||
newMesh().facesInstance(),
|
||||
newMesh().meshSubDir,
|
||||
polyMesh::meshSubDir,
|
||||
newMesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
@ -951,7 +951,7 @@ void createAndWriteRegion
|
||||
(
|
||||
"cellRegionAddressing",
|
||||
newMesh().facesInstance(),
|
||||
newMesh().meshSubDir,
|
||||
polyMesh::meshSubDir,
|
||||
newMesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
@ -970,7 +970,7 @@ void createAndWriteRegion
|
||||
(
|
||||
"boundaryRegionAddressing",
|
||||
newMesh().facesInstance(),
|
||||
newMesh().meshSubDir,
|
||||
polyMesh::meshSubDir,
|
||||
newMesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2021 OpenCFD Ltd.
|
||||
Copyright (C) 2021-2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
@ -22,12 +22,14 @@ Provided Variables
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
Foam::Info << "Create mesh";
|
||||
if (regionName != Foam::polyMesh::defaultRegion)
|
||||
{
|
||||
Foam::Info << ' ' << regionName;
|
||||
Foam::Info << "Create mesh";
|
||||
if (!Foam::polyMesh::regionName(regionName).empty())
|
||||
{
|
||||
Foam::Info << ' ' << regionName;
|
||||
}
|
||||
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
||||
}
|
||||
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
||||
|
||||
Foam::fvMesh mesh
|
||||
(
|
||||
|
||||
@ -396,7 +396,7 @@ int main(int argc, char *argv[])
|
||||
const word& regionName = regionNames[regioni];
|
||||
const fileName meshDir
|
||||
(
|
||||
polyMesh::regionName(regionName)/polyMesh::meshSubDir
|
||||
polyMesh::meshDir(regionName)
|
||||
);
|
||||
|
||||
if (regionNames.size() > 1)
|
||||
|
||||
Reference in New Issue
Block a user