remove redundant pack() method

Commit
3684b19939f03c224c6e84d505d607b2432c0bd0
Author
Marius Peter <blendoit@gmail.com>
Author date
Committer
Marius Peter <blendoit@gmail.com>
Committer date
creator.py
index 80fffce3..97d28f56 100644..100644
@@ -110,14 +110,7 @@
110 110 'Was the full path passed to the function?')
111 111 return None
112 112
113 Removed: def pack_info(self):
114 Removed: self.coord.append(self.x_u)
115 Removed: self.coord.append(self.z_u)
116 Removed: self.coord.append(self.x_l)
117 Removed: self.coord.append(self.z_l)
118 Removed: return None
119 113
120 Removed:
121 114 class Airfoil(Coordinates):
122 115 '''This class enables the creation of a single NACA airfoil.'''
123 116
@@ -211,8 +204,6 @@
211 204 self.z_u.append(get_upper_coord(x)[1])
212 205 self.x_l.append(get_lower_coord(x)[0])
213 206 self.z_l.append(get_lower_coord(x)[1])
214 Removed:
215 Removed: super().pack_info()
216 207 return None
217 208
218 209 def add_mass(self, mass):
@@ -246,10 +237,10 @@
246 237 '''
247 238 # Airfoil surface coordinates
248 239 # unpacked from 'coordinates' (list of lists in 'Coordinates').
249 Removed: x_u = airfoil.coord[0]
250 Removed: z_u = airfoil.coord[1]
251 Removed: x_l = airfoil.coord[2]
252 Removed: z_l = airfoil.coord[3]
240 Added: x_u = airfoil.x_u
241 Added: z_u = airfoil.z_u
242 Added: x_l = airfoil.x_l
243 Added: z_l = airfoil.z_l
253 244 # Scaled spar location with regards to chord
254 245 loc = spar_x * self.chord
255 246 # bisect_left: returns index of first value in x_u > loc.
@@ -261,12 +252,11 @@
261 252 self.z_u.append(z_u[spar_x_u])
262 253 self.x_l.append(x_l[spar_x_l])
263 254 self.z_l.append(z_l[spar_x_l])
264 Removed:
265 Removed: super().pack_info()
266 255 return None
267 256
268 257 def add_mass(self, mass):
269 258 self.mass = len(self.x_u) * mass
259 Added: return None
270 260
271 261
272 262 class Stringer(Coordinates):
@@ -296,55 +286,45 @@
296 286 None
297 287 '''
298 288
299 Removed: # Airfoil surface coordinates
300 Removed: # unpacked from 'coordinates' (list of lists in 'Coordinates').
301 Removed: airfoil_x_u = airfoil.coord[0]
302 Removed: airfoil_z_u = airfoil.coord[1]
303 Removed: airfoil_x_l = airfoil.coord[2]
304 Removed: airfoil_z_l = airfoil.coord[3]
305 Removed: # Spar coordinates
306 Removed: # unpacked from 'coordinates' (list of lists in 'Coordinates').
307 Removed: spar_x_u = airfoil.spar.coord[0]
308 Removed: spar_x_l = airfoil.spar.coord[2]
309 Removed:
310 289 # Find distance between leading edge and first upper stringer
311 Removed: interval = spar_x_u[0] / (stringer_u_1 + 1)
290 Added: interval = airfoil.spar.x_u[0] / (stringer_u_1 + 1)
312 291 # initialise first self.stringer_x_u at first interval
313 292 x = interval
314 293 # Add upper stringers from leading edge until first spar.
315 294 for _ in range(0, stringer_u_1):
316 295 # Index of the first value of airfoil_x_u > x
317 Removed: index = bi.bisect_left(airfoil_x_u, x)
318 Removed: self.x_u.append(airfoil_x_u[index])
319 Removed: self.z_u.append(airfoil_z_u[index])
296 Added: index = bi.bisect_left(airfoil.x_u, x)
297 Added: self.x_u.append(airfoil.x_u[index])
298 Added: self.z_u.append(airfoil.z_u[index])
320 299 x += interval
321 300 # Add upper stringers from first spar until last spar
322 Removed: interval = (spar_x_u[-1] - spar_x_u[0]) / (stringer_u_2 + 1)
323 Removed: x = interval + spar_x_u[0]
301 Added: interval = (airfoil.spar.x_u[-1]
302 Added: - airfoil.spar.x_u[0]) / (stringer_u_2 + 1)
303 Added: x = interval + airfoil.spar.x_u[0]
324 304 for _ in range(0, stringer_u_2):
325 Removed: index = bi.bisect_left(airfoil_x_u, x)
326 Removed: self.x_u.append(airfoil_x_u[index])
327 Removed: self.z_u.append(airfoil_z_u[index])
305 Added: index = bi.bisect_left(airfoil.x_u, x)
306 Added: self.x_u.append(airfoil.x_u[index])
307 Added: self.z_u.append(airfoil.z_u[index])
328 308 x += interval
329 309
330 310 # Find distance between leading edge and first lower stringer
331 Removed: interval = spar_x_l[0] / (stringer_l_1 + 1)
311 Added: interval = airfoil.spar.x_l[0] / (stringer_l_1 + 1)
332 312 x = interval
333 313 # Add lower stringers from leading edge until first spar.
334 314 for _ in range(0, stringer_l_1):
335 Removed: index = bi.bisect_left(airfoil_x_l, x)
336 Removed: self.x_l.append(airfoil_x_l[index])
337 Removed: self.z_l.append(airfoil_z_l[index])
315 Added: index = bi.bisect_left(airfoil.x_l, x)
316 Added: self.x_l.append(airfoil.x_l[index])
317 Added: self.z_l.append(airfoil.z_l[index])
338 318 x += interval
339 319 # Add lower stringers from first spar until last spar
340 Removed: interval = (spar_x_l[-1] - spar_x_l[0]) / (stringer_l_2 + 1)
341 Removed: x = interval + spar_x_l[0]
320 Added: interval = (airfoil.spar.x_l[-1]
321 Added: - airfoil.spar.x_l[0]) / (stringer_l_2 + 1)
322 Added: x = interval + airfoil.spar.x_l[0]
342 323 for _ in range(0, stringer_l_2):
343 Removed: index = bi.bisect_left(airfoil_x_l, x)
344 Removed: self.x_l.append(airfoil_x_l[index])
345 Removed: self.z_l.append(airfoil_z_l[index])
324 Added: index = bi.bisect_left(airfoil.x_l, x)
325 Added: self.x_l.append(airfoil.x_l[index])
326 Added: self.z_l.append(airfoil.z_l[index])
346 327 x += interval
347 Removed: super().pack_info()
348 328 return None
349 329
350 330 def add_area(self, area):