foamCleanPolyMesh: No need to warn about missing 'polyMesh' directories

This commit is contained in:
Henry Weller 2016-07-12 09:07:15 +01:00
parent 1c38fbcef0
commit ff49c1b882

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
@ -50,7 +50,7 @@ USAGE
unset caseDir regionName
# parse a single option
# Parse a single option
while [ "$#" -gt 0 ]
do
case "$1" in
@ -81,12 +81,12 @@ else
meshDir=polyMesh
fi
# if -case was specified: insist upon 'constant/polyMesh'
# If -case was specified: insist upon 'constant/polyMesh'
if [ -n "$caseDir" ]
then
if [ -d constant/$meshDir ]
then
# use constant/polyMesh
# Use constant/polyMesh
meshDir=constant/$meshDir
else
echo "Error: no 'constant/$meshDir' in $caseDir" 1>&2
@ -95,27 +95,22 @@ then
else
if [ -d constant/$meshDir ]
then
# use constant/polyMesh
# Use constant/polyMesh
meshDir=constant/$meshDir
elif [ -d $meshDir ]
then
# likely already in constant/ - do not adjust anything
# Likely already in constant/ - do not adjust anything
:
elif [ "${PWD##*/}" = polyMesh -a -z "$regionName" ]
then
# apparently already within polyMesh/
# Apparently already within polyMesh/
meshDir=.
else
echo "Error: no appropriate 'polyMesh/' directory found" 1>&2
exit 1
fi
fi
#
# remove files (mesh itself, modifiers, snappyHexMesh ones) and subdirectories
# Remove files (mesh itself, modifiers, snappyHexMesh ones) and subdirectories
# also remove .gz versions of the same files
#
echo "Cleaning ${caseDir:-.}/$meshDir" 1>&2
for i in \