From 1bd82369ff01378cb30b2aabd7bb9018674ed918 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 23 Jul 2008 16:49:16 +0100 Subject: [PATCH] Revert "blockMesh:" This reverts commit 3ae1a49119a0633d3f3b1fe4501503dab5e8cf00. --- .../mesh/generation/blockMesh/Make/files | 2 +- .../mesh/generation/blockMesh/blockMeshApp.C | 104 ++++-------------- 2 files changed, 22 insertions(+), 84 deletions(-) diff --git a/applications/utilities/mesh/generation/blockMesh/Make/files b/applications/utilities/mesh/generation/blockMesh/Make/files index 81f5f36749..af92bf759c 100644 --- a/applications/utilities/mesh/generation/blockMesh/Make/files +++ b/applications/utilities/mesh/generation/blockMesh/Make/files @@ -26,6 +26,6 @@ blockPoints.C blockCells.C blockBoundary.C -blockMeshApp.C +genBlockMesh.C EXE = $(FOAM_APPBIN)/blockMesh diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C index fbfbaa289c..c13d906392 100644 --- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C +++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C @@ -22,35 +22,14 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Application - blockMesh - Description A multi-block mesh generator. - The @a constant/blockMeshDict (or @a constant/\/blockMeshDict) - is used. - - For backwards compatibility, @a constant/polyMesh/blockMeshDict - (or @a constant/\/polyMesh/blockMeshDict) can also be used - if the previous search failed. - -Usage - - - blockMesh [OPTION] - - @param -blockTopology \n - Write the topology as a set of edges in OBJ format. - - @param -region \\n - Specify an alternative mesh region - \*---------------------------------------------------------------------------*/ #include "Time.H" #include "IOdictionary.H" #include "IOPtrList.H" -#include "autoPtr.H" #include "blockMesh.H" #include "attachPolyTopoChanger.H" @@ -81,89 +60,47 @@ int main(int argc, char *argv[]) word regionName; fileName polyMeshDir; - fileName constantDir; - autoPtr meshDictPtr; if (args.options().found("region")) { regionName = args.options()["region"]; polyMeshDir = regionName/polyMesh::meshSubDir; - constantDir = runTime.constant()/regionName; Info<< nl << "Generating mesh for region " << regionName << endl; - - // try constant//blockMeshDict - meshDictPtr.reset - ( - new IOobject - ( - "blockMeshDict", - runTime.constant(), - regionName, - runTime, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); } else { regionName = polyMesh::defaultRegion; polyMeshDir = polyMesh::meshSubDir; - constantDir = runTime.constant(); - - // try constant/blockMeshDict - meshDictPtr.reset - ( - new IOobject - ( - "blockMeshDict", - runTime.constant(), - runTime, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ) - ); } - // 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()) + Info<< nl << "Reading block mesh description dictionary" << endl; + + IOobject meshDescriptionIOobject + ( + "blockMeshDict", + runTime.constant(), + polyMeshDir, + runTime, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ); + + if (!meshDescriptionIOobject.headerOk()) { FatalErrorIn(args.executable()) << "Cannot open mesh description file " << nl - << constantDir/"blockMeshDict" << nl - << "or "<< nl - << constantDir/polyMeshDir/polyMesh::meshSubDir/"blockMeshDict" - << nl + << runTime.constant()/polyMeshDir/"blockMeshDict" << nl << exit(FatalError); } - Info<< nl << "Reading mesh description file" << endl; - - IOdictionary blockMeshDict(meshDictPtr()); + IOdictionary meshDescription(meshDescriptionIOobject); Info<< nl << "Creating block mesh" << endl; - blockMesh blocks(blockMeshDict); + blockMesh blocks(meshDescription); if (writeTopo) @@ -208,6 +145,7 @@ int main(int argc, char *argv[]) } + Info<< nl << "Creating mesh from block mesh" << endl; wordList patchNames = blocks.patchNames(); @@ -248,11 +186,11 @@ int main(int argc, char *argv[]) // Read in a list of dictionaries for the merge patch pairs - if (blockMeshDict.found("mergePatchPairs")) + if (meshDescription.found("mergePatchPairs")) { List > mergePatchPairs ( - blockMeshDict.lookup("mergePatchPairs") + meshDescription.lookup("mergePatchPairs") ); if (mergePatchPairs.size()) @@ -358,7 +296,7 @@ int main(int argc, char *argv[]) // Set the precision of the points data to 10 IOstream::defaultPrecision(10); - Info<< nl << "Writing polyMesh" << endl; + Info << nl << "Writing polyMesh" << endl; mesh.removeFiles(mesh.instance()); if (!mesh.write()) {