mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
revert to previous search order - constant/polyMesh/blockMeshDict
- retain failsafe check (constant/blockMeshDict)
This commit is contained in:
@ -28,12 +28,12 @@ Application
|
|||||||
Description
|
Description
|
||||||
A multi-block mesh generator.
|
A multi-block mesh generator.
|
||||||
|
|
||||||
The @a constant/blockMeshDict (or @a constant/\<region\>/blockMeshDict)
|
A @a constant/polyMesh/blockMeshDict
|
||||||
is used.
|
(or @a constant/\<region\>/polyMesh/blockMeshDict) is used.
|
||||||
|
|
||||||
For backwards compatibility, @a constant/polyMesh/blockMeshDict
|
For people who like to accidentally remove their entire
|
||||||
(or @a constant/\<region\>/polyMesh/blockMeshDict) can also be used
|
@a constant/polyMesh/, the path @a constant/blockMeshDict
|
||||||
if the previous search failed.
|
(or @a constant/\<region\>/blockMeshDict) will also be checked.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
|
|
||||||
@ -91,7 +91,34 @@ int main(int argc, char *argv[])
|
|||||||
constantDir = runTime.constant()/regionName;
|
constantDir = runTime.constant()/regionName;
|
||||||
|
|
||||||
Info<< nl << "Generating mesh for region " << regionName << endl;
|
Info<< nl << "Generating mesh for region " << regionName << endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
regionName = polyMesh::defaultRegion;
|
||||||
|
polyMeshDir = polyMesh::meshSubDir;
|
||||||
|
constantDir = runTime.constant();
|
||||||
|
}
|
||||||
|
|
||||||
|
// check constant/polyMesh or constant/polyMesh/<region>/
|
||||||
|
meshDictPtr.reset
|
||||||
|
(
|
||||||
|
new IOobject
|
||||||
|
(
|
||||||
|
"blockMeshDict",
|
||||||
|
runTime.constant(),
|
||||||
|
polyMeshDir,
|
||||||
|
runTime,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!meshDictPtr->headerOk())
|
||||||
|
{
|
||||||
|
// not found, failsafe checks
|
||||||
|
if (args.options().found("region"))
|
||||||
|
{
|
||||||
// try constant/<region>/blockMeshDict
|
// try constant/<region>/blockMeshDict
|
||||||
meshDictPtr.reset
|
meshDictPtr.reset
|
||||||
(
|
(
|
||||||
@ -109,10 +136,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
regionName = polyMesh::defaultRegion;
|
|
||||||
polyMeshDir = polyMesh::meshSubDir;
|
|
||||||
constantDir = runTime.constant();
|
|
||||||
|
|
||||||
// try constant/blockMeshDict
|
// try constant/blockMeshDict
|
||||||
meshDictPtr.reset
|
meshDictPtr.reset
|
||||||
(
|
(
|
||||||
@ -128,34 +151,17 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// not found, fallback to polyMesh directory
|
|
||||||
if (!meshDictPtr->headerOk())
|
|
||||||
{
|
|
||||||
meshDictPtr.reset
|
|
||||||
(
|
|
||||||
new IOobject
|
|
||||||
(
|
|
||||||
"blockMeshDict",
|
|
||||||
runTime.constant(),
|
|
||||||
polyMeshDir,
|
|
||||||
runTime,
|
|
||||||
IOobject::MUST_READ,
|
|
||||||
IOobject::NO_WRITE,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!meshDictPtr->headerOk())
|
if (!meshDictPtr->headerOk())
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot open mesh description file " << nl
|
<< "Cannot open mesh description file\n "
|
||||||
<< constantDir/"blockMeshDict" << nl
|
<< constantDir/polyMeshDir/"blockMeshDict"
|
||||||
<< "or "<< nl
|
<< "\n (or " << constantDir/"blockMeshDict" << ")" << nl
|
||||||
<< constantDir/polyMeshDir/polyMesh::meshSubDir/"blockMeshDict"
|
|
||||||
<< nl
|
<< nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Info<< nl << "Reading mesh description file" << endl;
|
Info<< nl << "Reading mesh description file" << endl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user