Commit fd6701dd authored by Henry Weller's avatar Henry Weller
Browse files

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

parent 7df235f7
......@@ -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 \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment