-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcopyCaseInstantZero.sh
executable file
·40 lines (31 loc) · 1.13 KB
/
copyCaseInstantZero.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# ----------------------------------------------------------------------- #
# copyCaseInstantZero.sh
#
# Copy all the files and settings from a different directory, but instead
# of simply copying everything, it only copies the first time step (that
# contains the mesh) and log files. No postProcessing or dynamicCode dirs.
#
# Regis Thedin
# Aug 25, 2020
# ----------------------------------------------------------------------- #
copyCaseInstantZero(){
GREEN='\033[0;32m'
NC='\033[0m'
echo "Copying" $1 "into the current dir,"
echo "including processor*/0 and log files."
cp -r $1/{1_*,2_*,3_*,4_*,setUp*} . 2>/dev/null || :
cp $1/log.1.* .
cp $1/foam1* .
cp -r $1/constant .
cp -r $1/{system,0.original,0} .
nCores=$(find $1 -maxdepth 1 -type d -name 'processor*' | wc -l)
for (( c=0; c<$nCores; c++ )); do
mkdir processor$c
cp -r $1/processor$c/constant processor$c/
echo -ne "Copying processor$c \r"
cp -r $1/processor$c/0 processor$c/
done
echo -e "${GREEN} Done. ${NC}"
}