reverting blockMesh changes

This commit is contained in:
andy
2008-07-23 16:49:01 +01:00
parent eb604fdb88
commit 6281e94a37

View File

@ -28,12 +28,12 @@ Application
Description Description
A multi-block mesh generator. A multi-block mesh generator.
A @a constant/polyMesh/blockMeshDict The @a constant/blockMeshDict (or @a constant/\<region\>/blockMeshDict)
(or @a constant/\<region\>/polyMesh/blockMeshDict) is used. is used.
For people who like to accidentally remove their entire For backwards compatibility, @a constant/polyMesh/blockMeshDict
@a constant/polyMesh/, the path @a constant/blockMeshDict (or @a constant/\<region\>/polyMesh/blockMeshDict) can also be used
(or @a constant/\<region\>/blockMeshDict) will also be checked. if the previous search failed.
Usage Usage
@ -91,34 +91,7 @@ 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
( (
@ -136,6 +109,10 @@ 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
( (
@ -151,17 +128,34 @@ 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\n " << "Cannot open mesh description file " << nl
<< constantDir/polyMeshDir/"blockMeshDict" << constantDir/"blockMeshDict" << nl
<< "\n (or " << constantDir/"blockMeshDict" << ")" << nl << "or "<< 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;