-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakeall
executable file
·190 lines (176 loc) · 4.31 KB
/
makeall
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/bin/bash
# Written by M. De Graef; 9/19/18
# Project Funding: NSF DMR-1564550
#
# This script is Mac OS X specific... but might work on Linux with minor modifications
#
# This script is the top level script for building all the magnetic point group stills and movies.
# It should be called simply in one of the following ways:
#
# ./makeall
# nohup ./makeall & >makeall_output.txt
# nohup ./makeall & >/dev/null
#
# All rendering options should be set in the RenderParameters file before running this script.
# To edit this file, first copy it from the RenderParameters.template file, and then edit the
# parameters for your site.
# -------------------------------------------------------
# define a couple of functions
function showdate() {
echo "- - - - - - - - - - - - - - - - - - - - - - - - - "
date
echo "- - - - - - - - - - - - - - - - - - - - - - - - - "
}
# -------------------------------------------------------
RENDER_FILE="RenderParameters"
if [ -f $RENDER_FILE ]; then
. $RENDER_FILE
else
echo "$RENDER_FILE not found; exiting"
exit
fi
CURDIR=`pwd`
# test to make sure that the requested number of threads is <= the available number
MAXTHREADS=`sysctl -n hw.ncpu` # need to check for OS... this one will only work on Mac OS X
if [ $NTHREADS -gt $MAXTHREADS ]
then
NTHREADS="$MAXTHREADS"
fi
# do we need to create the BUILD_FOLDER?
if [ -e "$BUILD_FOLDER" ]
then
echo "$BUILD_FOLDER already exists"
else
mkdir $BUILD_FOLDER
fi
# do we need to create the temporary folder?
if [ -e "$TMP_FOLDER" ]
then
echo "$TMP_FOLDER already exists"
else
mkdir $TMP_FOLDER
fi
# do we need to create the frames folder?
if [ -e "$FRAMES_FOLDER" ]
then
echo "$FRAMES_FOLDER already exists"
else
mkdir $FRAMES_FOLDER
fi
# and print out a message
echo "Stills and movies will be built in folder $BUILD_FOLDER using $NTHREADS of $MAXTHREADS available threads."
RENDER_FILE=\.\./$RENDER_FILE
## -------------------------------------------------------
echo "Starting main point group script"
echo " "
echo "Make sure you have a lot of time and diskspace..."
echo " "
if [ $DO_RAW = 1 ]; then
echo "Switching to directory raw to create 32 jpeg images"
cd raw
./doall $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_SCALAR_STILLS = 1 ]; then
showdate
echo " "
echo "Switching to directory scalar to create 32 jpeg images"
cd scalar
./doall_stills $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_SCALAR_MOVIES = 1 ]; then
showdate
echo " "
echo "Switching to directory scalar to create 32 movies "
cd scalar
./doall_movies $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_PSEUDOSCALAR_STILLS = 1 ]; then
showdate
echo " "
echo "Switching to directory pseudoscalar to create 32 jpeg images"
cd pseudoscalar
./doall_stills $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_PSEUDOSCALAR_MOVIES = 1 ]; then
showdate
echo " "
echo "Switching to directory pseudoscalar to create 32 movies "
cd pseudoscalar
./doall_movies $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_ANAGLYPHS = 1 ]; then
showdate
echo " "
echo "Switching to directory anaglyph to create 2*32 jpeg images"
cd anaglyph
./doall_stills $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_SPECIALPOSITIONS = 1 ]; then
showdate
echo " "
echo "Switching to directory special_positions to create 1 movie"
cd special_positions
./doall $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_POLAR_STILLS = 1 ]; then
showdate
echo " "
echo "Switching to directory polar to create 32 jpeg images"
cd polar
./doall_stills $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_POLAR_MOVIES = 1 ]; then
showdate
echo " "
echo "Switching to directory polar to create 32 movies "
cd polar
./doall_movies $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_AXIAL_STILLS = 1 ]; then
showdate
echo " "
echo "Switching to directory axial to create 122 2x2 jpeg images"
cd axial
./doall_stills $RENDER_FILE
cd $CURDIR
fi
#
if [ $DO_AXIAL_MOVIES = 1 ]; then
showdate
echo " "
echo "Switching to directory axial to create 122 movies "
cd axial
./doall_movies $RENDER_FILE
cd $CURDIR
fi
# final cleanup
cd $TMP_FOLDER
rm -f .* * *.* >/dev/null 2>/dev/null
cd $CURDIR
rmdir $TMP_FOLDER
cd $FRAMES_FOLDER
rm -f .* * *.* >/dev/null 2>/dev/null
cd $CURDIR
rmdir $FRAMES_FOLDER
echo "- - - - - - - - - - - - - - - - - - - - - - - - - "
echo "All is well that ends well ..."
showdate
exit