1 #---------------------------------*- sh -*-------------------------------------
3 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 #------------------------------------------------------------------------------
9 # This file is part of OpenFOAM.
11 # OpenFOAM is free software: you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
16 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 # You should have received a copy of the GNU General Public License
22 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 # Miscellaneous cleanup functions for tutorial cases
29 #------------------------------------------------------------------------------
31 #cleanTimeDirectories()
33 # echo "Cleaning $PWD case"
34 # for time in $(foamInfoExec -times)
36 # # keep 0 and constant directories
37 # [ "$time" = "0" -o "$time" = constant ] || {
38 # echo "Deleting directory $time"
39 # rm -rf $time > /dev/null 2>&1
42 # rm -rf {log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1
45 cleanTimeDirectories()
47 echo "Cleaning $PWD case"
49 while [ ${#zeros} -lt 8 ]
51 timeDir="0.${zeros}[1-9]*"
52 rm -rf ./${timeDir} ./-${timeDir} > /dev/null 2>&1
55 rm -rf ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM ./.setSet > /dev/null 2>&1
60 # Remove dynamicCode subdirectory if it looks appropriate
64 if [ -d system -a -d dynamicCode ]
66 rm -rf dynamicCode > /dev/null 2>&1
76 rm -rf processor* > /dev/null 2>&1
77 rm -rf probes* > /dev/null 2>&1
78 rm -rf forces* > /dev/null 2>&1
79 rm -rf graphs* > /dev/null 2>&1
80 rm -rf sets > /dev/null 2>&1
81 rm -rf surfaceSampling > /dev/null 2>&1
82 rm -rf cuttingPlane > /dev/null 2>&1
83 rm -rf system/machines > /dev/null 2>&1
85 if [ -d constant/polyMesh ]
87 (cd constant/polyMesh && \
89 allOwner* cell* face* meshModifiers* \
90 owner* neighbour* point* edge* \
91 cellLevel* pointLevel* refinementHistory* surfaceIndex* sets \
97 cellToRegion cellLevel* pointLevel* \
100 rm -rf VTK > /dev/null 2>&1
101 rm -f 0/cellLevel 0/pointLevel
103 if [ -e constant/polyMesh/blockMeshDict.m4 ]
105 rm -f constant/polyMesh/blockMeshDict > /dev/null 2>&1
108 for f in `find . -name "*Dict"`
110 sed -e /arguments/d $f > temp.$$
117 echo "Removing ${1:-unknown} case"
123 rm -rf ./sets ./samples ./sampleSurfaces > /dev/null 2>&1
128 rm -rf 0/Ux 0/Uy 0/Uz > /dev/null 2>&1
133 echo "Cleaning $PWD application"
138 #------------------------------------------------------------------------------