BUGFIX: 552fd5fd requires calculation of deflated geometry
[foam-extend-3.2.git] / bin / tools / CleanFunctions
blobc2ff6d4c62242d7a37e4733111df0e2ad4b79c1c
1 #---------------------------------*- sh -*-------------------------------------
2 # =========                 |
3 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4 #  \\    /   O peration     |
5 #   \\  /    A nd           | Copyright held by original author
6 #    \\/     M anipulation  |
7 #------------------------------------------------------------------------------
8 # License
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 the
13 #     Free Software Foundation; either version 2 of the License, or (at your
14 #     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
19 #     for more details.
21 #     You should have received a copy of the GNU General Public License
22 #     along with OpenFOAM; if not, write to the Free Software Foundation,
23 #     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 # Script
26 #     CleanFunctions
28 # Description
30 #------------------------------------------------------------------------------
32 #cleanTimeDirectories ()
34 #    echo "Cleaning $case case of $application application"
35 #    TIME_DIRS=`foamInfoExec . $1 -times | sed '1,/constant/d'`
36 #    for T in $TIME_DIRS
37 #    do
38 #        if [ $T != "0" ] ; then
39 #            echo "Deleting directory $T"
40 #            rm -rf ${T} > /dev/null 2>&1
41 #        fi
42 #    done
43 #    rm -rf {log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1
46 cleanTimeDirectories ()
48     echo "Cleaning $PWD case"
49     nZeros=0
50     zeros=""
51     while [ $nZeros -lt 8 ] ; do
52         timeDir="0.${zeros}[1-9]*"
53         rm -rf ${timeDir} > /dev/null 2>&1
54         rm -rf ./-${timeDir} > /dev/null 2>&1
55         zeros=`printf %0${nZeros}d 0`
56         nZeros=$(($nZeros + 1))
57     done
58     rm -rf ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM > /dev/null 2>&1
61 cleanCase ()
63     cleanTimeDirectories
64     rm -rf processor* > /dev/null 2>&1
65     rm -rf probes* > /dev/null 2>&1
66     rm -rf forces* > /dev/null 2>&1
68     rm -rf system/machines \
69            constant/polyMesh/allOwner* \
70            constant/polyMesh/cell* \
71            constant/polyMesh/face* \
72            constant/polyMesh/meshModifiers* \
73            constant/polyMesh/owner* \
74            constant/polyMesh/neighbour* \
75            constant/polyMesh/point* \
76            constant/polyMesh/edge* \
77            constant/polyMesh/zoneToPatchName \
78            constant/polyMesh/cellLevel* \
79            constant/polyMesh/pointLevel* \
80            constant/polyMesh/refinementHistory*, \
81            constant/polyMesh/surfaceIndex* \
82            constant/cellToRegion \
83            constant/polyMesh/sets/ \
84            VTK \
85            > /dev/null 2>&1
87     for f in `find . -name "*Dict"`
88     do
89         sed -e /arguments/d $f > temp.$$
90         mv temp.$$ $f
91     done
94 removeCase ()
96     echo "Removing $case case"
97     rm -rf $1
100 cleanSamples ()
102     rm -rf {sets,samples,sampleSurfaces} > /dev/null 2>&1
105 cleanUcomponents ()
107     rm -rf 0/{Ux,Uy,Uz} > /dev/null 2>&1
110 cleanFaMesh ()
112     rm -rf ./constant/faMesh/{faceLabels*,faBoundary*} \
113            > /dev/null 2>&1
116 cleanApplication ()
118     echo "Cleaning $PWD application"
119     wclean
123 #------------------------------------------------------------------------------