blockMesh: Delete the polyMesh directory before meshing
unless the blockMeshDict is in the polyMesh directory or the "-noClean" option is specified. This avoids problems running snappyHexMesh without first clearing files from polyMesh which interfere with the operation of snappyHexMesh.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,6 +76,11 @@ int main(int argc, char *argv[])
|
||||
"blockTopology",
|
||||
"write block edges and centres as .obj files"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"noClean",
|
||||
"keep the existing files in the polyMesh"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"dict",
|
||||
@ -156,6 +161,30 @@ int main(int argc, char *argv[])
|
||||
dictPath = runTime.system()/regionPath/dictName;
|
||||
}
|
||||
|
||||
if (!args.optionFound("noClean"))
|
||||
{
|
||||
fileName polyMeshPath
|
||||
(
|
||||
runTime.path()/runTime.constant()/regionPath/polyMesh::meshSubDir
|
||||
);
|
||||
|
||||
if (exists(polyMeshPath))
|
||||
{
|
||||
if (exists(polyMeshPath/dictName))
|
||||
{
|
||||
Info<< "Not deleting polyMesh directory " << nl
|
||||
<< " " << polyMeshPath << nl
|
||||
<< " because it contains " << dictName << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Deleting polyMesh directory" << nl
|
||||
<< " " << polyMeshPath << endl;
|
||||
rmDir(polyMeshPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IOobject meshDictIO
|
||||
(
|
||||
dictPath,
|
||||
|
||||
Reference in New Issue
Block a user