Skip to content

Commit

Permalink
doesnt crash if you have an aero model, but it's only CAERO2s
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDoyle2 committed Jul 22, 2016
1 parent b4d6339 commit 7118278
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pyNastran/converters/nastran/nastranIOv.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,22 @@ def load_nastran_geometry(self, bdf_filename, dirname, name='main', plot=True):

box_id_to_caero_element_map = {}
num_prev = 0
ncaeros_sub = 0
if model.caeros:
caero_points = []
for eid, caero in sorted(iteritems(model.caeros)):
print('caero\n%s' % caero)
if caero.type == 'CAERO1':
ncaeros_sub += 1
pointsi, elementsi = caero.panel_points_elements()
caero_points.append(pointsi)
for i, box_id in enumerate(caero.box_ids.flat):
box_id_to_caero_element_map[box_id] = elementsi[i, :] + num_prev
num_prev += pointsi.shape[0]
caero_points = np.vstack(caero_points)
if ncaeros_sub:
caero_points = np.vstack(caero_points)
self.has_caero = True
else:
if ncaeros_sub == 0:
caero_points = np.empty((0, 3))

# check for any control surfcaes
Expand Down Expand Up @@ -728,8 +732,10 @@ def set_caero_grid(self, ncaeros_points, model, j=0):
#print('xyz:\n', xyz[n1], xyz[n2], xyz[n3], xyz[n4])
else:
self.log_info("skipping %s" % element.type)
self.log_info('CAERO.max = %s' % np.vstack(max_cpoints).max(axis=0))
self.log_info('CAERO.min = %s' % np.vstack(min_cpoints).min(axis=0))

if ncaeros_points:
self.log_info('CAERO.max = %s' % np.vstack(max_cpoints).max(axis=0))
self.log_info('CAERO.min = %s' % np.vstack(min_cpoints).min(axis=0))
self.alt_grids['caero'].SetPoints(points)
return j

Expand Down

0 comments on commit 7118278

Please sign in to comment.