Skip to content

Commit 23d1fab

Browse files
authored
Merge pull request #12 from ParticulateFlow/release
rCFD 22.10 release
2 parents b5d2d17 + b9da7ac commit 23d1fab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+11382
-1375
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# rCFDreloaded
1+
# rCFD
22
Fluent-UDF-based rCFD implementation developed by the Department of Particulate Flow Modelling at Johannes Kepler University in Linz, Austria http://www.jku.at/pfm
33

44
## License

download_all_tutorials.csh

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#!/bin/csh -f
2+
3+
set EXPECTED_ARGS=1
4+
if ( $#argv < ${EXPECTED_ARGS} ) then
5+
echo "Usage: `basename $0 $1` {target directory}"
6+
exit
7+
endif
8+
9+
# name of target directory
10+
set TARGETDIR=$1
11+
12+
# check if target directory exists
13+
if ( ! -d "${TARGETDIR}" ) then
14+
echo "Directory ${TARGETDIR} does not exist, exiting"
15+
exit
16+
endif
17+
18+
set DOWNLOAD_IN_PLACE=false
19+
set FULL_TARGETDIR=`realpath "${TARGETDIR}"`
20+
set FULL_CURRENTDIR=`pwd`
21+
if ( "${FULL_TARGETDIR}" == "${FULL_CURRENTDIR}" ) then
22+
set DOWNLOAD_IN_PLACE=true
23+
endif
24+
25+
if ( ${DOWNLOAD_IN_PLACE} == false ) then
26+
# switch to target dir
27+
echo "Switching to target directory ..."
28+
pushd ${TARGETDIR}/tutorials >/dev/null
29+
else
30+
# switch to tutorials dir
31+
echo "Switching to tutorials directory ..."
32+
pushd tutorials >/dev/null
33+
endif
34+
35+
# remove old log file
36+
set LOGFILE="download.log"
37+
rm ${LOGFILE} >& /dev/null
38+
39+
set NSKIPPED=0
40+
set NOK=0
41+
set NFAILED=0
42+
43+
# download all tutorial files
44+
if ( "${HOST}" =~ node* ) then
45+
echo "Unable to download case files on nodes ..."
46+
else
47+
echo "Downloading case files ..."
48+
foreach d ( */ )
49+
pushd ${d} >/dev/null
50+
if ( -f "prep_batch.scm" ) then
51+
if ( -f "ansys_fluent/README.md" ) then
52+
pushd "ansys_fluent" >/dev/null
53+
54+
set CASFILE=`sed -n 's/^[ \t]*//;/cas.h5$/ p' README.md`
55+
set DATFILE=`sed -n 's/^[ \t]*//;/dat.h5$/ p' README.md`
56+
57+
echo "Downloading Ansys Fluent cas & dat files for case ${d} ..."
58+
wget -nv -N ${CASFILE}
59+
60+
if ( $status != 0 ) then
61+
echo "Download of cas file for case ${d} FAILED" | tee -a ../../${LOGFILE}
62+
@ NFAILED++
63+
else
64+
echo "Download of cas file for case ${d} OK" | tee -a ../../${LOGFILE}
65+
@ NOK++
66+
endif
67+
68+
wget -nv -N ${DATFILE}
69+
if ( $status != 0 ) then
70+
echo "Download of dat file for case ${d} FAILED" | tee -a ../../${LOGFILE}
71+
@ NFAILED++
72+
else
73+
echo "Download of dat file for case ${d} OK" | tee -a ../../${LOGFILE}
74+
@ NOK++
75+
endif
76+
77+
popd >/dev/null
78+
79+
if ( -f "data/csv/README.md" ) then
80+
pushd "data/csv" >/dev/null
81+
82+
set CSVFILE=`sed -n 's/^[ \t]*//;/.zip$/ p' README.md`
83+
84+
echo "Downloading CSV files for case ${d} ..."
85+
wget -nv -N ${CSVFILE}
86+
87+
if ( $status != 0 ) then
88+
echo "Download of csv zip file for case ${d} FAILED" | tee -a ../../${LOGFILE}
89+
@ NFAILED++
90+
else
91+
echo "Download of csv zip file for case ${d} OK" | tee -a ../../${LOGFILE}
92+
unzip -o -q '*.zip'
93+
@ NOK++
94+
endif
95+
96+
popd >/dev/null
97+
98+
endif
99+
else
100+
echo "Download of files for case ${d} SKIPPED" | tee -a ../${LOGFILE}
101+
@ NSKIPPED++
102+
endif
103+
else
104+
echo "Download of files for case ${d} SKIPPED" | tee -a ../${LOGFILE}
105+
@ NSKIPPED++
106+
endif
107+
popd >/dev/null
108+
end
109+
110+
echo "----------------"
111+
echo "DOWNLOAD SUMMARY"
112+
echo "----------------"
113+
114+
set PLURALS="s"
115+
if (${NSKIPPED} == 1) set PLURALS=" "
116+
echo "$NSKIPPED file download$PLURALS SKIPPED"
117+
118+
set PLURALS="s"
119+
if (${NOK} == 1) set PLURALS=" "
120+
echo "$NOK file download$PLURALS OK"
121+
122+
set PLURALS="s"
123+
if (${NFAILED} == 1) set PLURALS=" "
124+
echo "$NFAILED file download$PLURALS FAILED"
125+
126+
endif
127+
128+
popd >/dev/null
129+
130+

download_all_tutorials.sh

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#!/bin/bash
2+
3+
EXPECTED_ARGS=1
4+
if [ $# -lt ${EXPECTED_ARGS} ]; then
5+
echo "Usage: `basename $0 $1` {target directory}"
6+
exit
7+
fi
8+
9+
# name of target directory
10+
TARGETDIR=$1
11+
12+
# check if target directory exists
13+
if [ ! -d "${TARGETDIR}" ]; then
14+
echo "Directory ${TARGETDIR} does not exist, exiting"
15+
exit
16+
fi
17+
18+
DOWNLOAD_IN_PLACE=false
19+
if [[ "${TARGETDIR}" -ef ./ ]]; then
20+
DOWNLOAD_IN_PLACE=true
21+
fi
22+
23+
if [ "${DOWNLOAD_IN_PLACE}" = false ]; then
24+
# switch to target dir
25+
echo "Switching to target directory ..."
26+
pushd ${TARGETDIR}/tutorials >/dev/null
27+
else
28+
# switch to tutorials dir
29+
echo "Switching to tutorials directory ..."
30+
pushd tutorials >/dev/null
31+
fi
32+
33+
# remove old log file
34+
LOGFILE="download.log"
35+
rm ${LOGFILE} 2> /dev/null
36+
37+
BRED='\033[1;31m'
38+
BGREEN='\033[1;32m'
39+
BYELLOW='\033[1;33m'
40+
NC='\033[0m' # No Color
41+
42+
shopt -s expand_aliases
43+
alias decolorize='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"'
44+
45+
NSKIPPED=0
46+
NOK=0
47+
NFAILED=0
48+
49+
# download all tutorial files
50+
if [[ $HOST == node* ]]; then
51+
echo "Unable to download case files on nodes ..."
52+
else
53+
echo "Downloading case files ..."
54+
for d in */ ; do
55+
pushd ${d} >/dev/null
56+
if [ -f "prep_batch.scm" ]; then
57+
if [ -f "ansys_fluent/README.md" ]; then
58+
pushd "ansys_fluent" >/dev/null
59+
60+
CASFILE=`sed -n 's/^[ \t]*//;/cas.h5$/ p' README.md`
61+
DATFILE=`sed -n 's/^[ \t]*//;/dat.h5$/ p' README.md`
62+
63+
echo "Downloading Ansys Fluent cas & dat files for case ${d%/} ..."
64+
wget -nv -N ${CASFILE}
65+
66+
if [ $? -ne 0 ]; then
67+
echo -e "Download of cas file for case ${d%/} ${BRED}FAILED${NC}" | tee >(decolorize >> ../../${LOGFILE})
68+
((NFAILED++))
69+
else
70+
echo -e "Download of cas file for case ${d%/} ${BGREEN}OK${NC}" | tee >(decolorize >> ../../${LOGFILE})
71+
((NOK++))
72+
fi
73+
74+
wget -nv -N ${DATFILE}
75+
if [ $? -ne 0 ]; then
76+
echo -e "Download of dat file for case ${d%/} ${BRED}FAILED${NC}" | tee >(decolorize >> ../../${LOGFILE})
77+
((NFAILED++))
78+
else
79+
echo -e "Download of dat file for case ${d%/} ${BGREEN}OK${NC}" | tee >(decolorize >> ../../${LOGFILE})
80+
((NOK++))
81+
fi
82+
83+
popd >/dev/null
84+
85+
if [ -f "data/csv/README.md" ]; then
86+
pushd "data/csv" >/dev/null
87+
88+
CSVFILE=`sed -n 's/^[ \t]*//;/.zip$/ p' README.md`
89+
90+
echo "Downloading CSV files for case ${d%/} ..."
91+
wget -nv -N ${CSVFILE}
92+
93+
if [ $? -ne 0 ]; then
94+
echo -e "Download of csv zip file for case ${d%/} ${BRED}FAILED${NC}" | tee >(decolorize >> ../../${LOGFILE})
95+
((NFAILED++))
96+
else
97+
echo -e "Download of csv zip file for case ${d%/} ${BGREEN}OK${NC}" | tee >(decolorize >> ../../${LOGFILE})
98+
unzip -o -q '*.zip'
99+
((NOK++))
100+
fi
101+
102+
popd >/dev/null
103+
104+
fi
105+
else
106+
echo -e "Download of files for case ${d%/} ${BYELLOW}SKIPPED${NC}" | tee >(decolorize >> ../${LOGFILE})
107+
((NSKIPPED++))
108+
fi
109+
else
110+
echo -e "Download of files for case ${d%/} ${BYELLOW}SKIPPED${NC}" | tee >(decolorize >> ../${LOGFILE})
111+
((NSKIPPED++))
112+
fi
113+
popd >/dev/null
114+
done
115+
116+
echo "----------------"
117+
echo "DOWNLOAD SUMMARY"
118+
echo "----------------"
119+
120+
PLURALS=$([ $NSKIPPED -eq 1 ] && echo " " || echo "s")
121+
echo -e "$NSKIPPED file download$PLURALS ${BYELLOW}SKIPPED${NC}"
122+
PLURALS=$([ $NOK -eq 1 ] && echo " " || echo "s")
123+
echo -e "$NOK file download$PLURALS ${BGREEN}OK${NC}"
124+
PLURALS=$([ $NFAILED -eq 1 ] && echo " " || echo "s")
125+
echo -e "$NFAILED file download$PLURALS ${BRED}FAILED${NC}"
126+
fi
127+
128+
popd >/dev/null
129+
130+

0 commit comments

Comments
 (0)