mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: CleanFunctions refinements
- include constant/faMesh cleanup (cleanFaMesh) as part of standard cleanCase - simplify cleanPolyMesh function to now just warn about old constant/polyMesh/blockMeshDict but not try to remove anything - cleanup cellDist.vtu (decomposePar -dry-run) as well ENH: foamRunTutorials - fallback to Allrun-parallel, Allrun-serial TUT: call m4 with file argument instead of redirected stdin TUT: adjust suffixes on decomposeParDict variants
This commit is contained in:
@ -7,22 +7,10 @@
|
||||
# \\/ M anipulation |
|
||||
#-------------------------------------------------------------------------------
|
||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# Copyright (C) 2022 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM.
|
||||
#
|
||||
# OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
#
|
||||
# Script
|
||||
# foamCleanPolyMesh
|
||||
@ -76,34 +64,33 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
meshDir=polyMesh
|
||||
if [ -n "$regionName" ]
|
||||
then
|
||||
meshDir=$regionName/polyMesh
|
||||
else
|
||||
meshDir=polyMesh
|
||||
meshDir="$regionName/$meshDir"
|
||||
fi
|
||||
|
||||
# If -case was specified: insist upon 'constant/polyMesh'
|
||||
if [ -n "$caseDir" ]
|
||||
then
|
||||
if [ -d constant/$meshDir ]
|
||||
if [ -d constant/"$meshDir" ]
|
||||
then
|
||||
# Use constant/polyMesh
|
||||
meshDir=constant/$meshDir
|
||||
meshDir=constant/"$meshDir"
|
||||
else
|
||||
echo "Error: no 'constant/$meshDir' in $caseDir" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if [ -d constant/$meshDir ]
|
||||
if [ -d constant/"$meshDir" ]
|
||||
then
|
||||
# Use constant/polyMesh
|
||||
meshDir=constant/$meshDir
|
||||
elif [ -d $meshDir ]
|
||||
meshDir=constant/"$meshDir"
|
||||
elif [ -d "$meshDir" ]
|
||||
then
|
||||
# Likely already in constant/ - do not adjust anything
|
||||
:
|
||||
elif [ "${PWD##*/}" = polyMesh -a -z "$regionName" ]
|
||||
elif [ "${PWD##*/}" = polyMesh ] && [ -z "$regionName" ]
|
||||
then
|
||||
# Apparently already within polyMesh/
|
||||
meshDir=.
|
||||
@ -135,7 +122,7 @@ for i in \
|
||||
surfaceIndex \
|
||||
;
|
||||
do
|
||||
rm -rf $meshDir/$i $meshDir/$i.gz
|
||||
rm -rf "$meshDir/$i" "$meshDir/$i.gz"
|
||||
done
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user