Added output of structural node id
@@ -48,6 +48,7 @@ class AeroGridPlot(BaseSolver):
panel_id = np.zeros((dims[0]*dims[1],), dtype=int)
panel_surf_id = np.zeros((dims[0]*dims[1],), dtype=int)
normal = np.zeros((dims[0]*dims[1], 3))
+ point_struct_id = np.zeros(((dims[0]+1)*(dims[1]+1), ), dtype=int)
counter = -1
for i_n in range(dims[1]+1):
for i_m in range(dims[0]+1):
@@ -59,6 +60,7 @@ class AeroGridPlot(BaseSolver):
for i_n in range(dims[1] + 1):
for i_m in range(dims[0] + 1):
node_counter += 1
+ point_struct_id[node_counter] = self.data.grid.aero2struct_mapping[i_surf][i_n]
if i_n < dims[1] and i_m < dims[0]:
counter += 1
else:
@@ -70,20 +72,20 @@ class AeroGridPlot(BaseSolver):
node_counter + dims[0]+1])
normal[counter, :] = self.data.grid.timestep_info[self.ts].normals[i_surf][:, i_m, i_n]
panel_id[counter] = counter
-
- # TODO not sure this is correct
- # panel_surf_id[counter] = self.data.grid.aero_dict['surface_distribution'][node_counter]
+ panel_surf_id[counter] = i_surf
ug = tvtk.UnstructuredGrid(points=coords)
ug.set_cells(tvtk.Quad().cell_type, conn)
ug.cell_data.scalars = panel_id
- ug.cell_data.scalars.name = 'panel_id'
- # ug.cell_data.add_array(panel_surf_id)
- # ug.cell_data.get_array(1).name = 'surface_id'
+ ug.cell_data.scalars.name = 'panel_n_id'
+ ug.cell_data.add_array(panel_surf_id)
+ ug.cell_data.get_array(1).name = 'panel_surface_id'
ug.cell_data.vectors = normal
- ug.cell_data.vectors.name = 'normal'
+ ug.cell_data.vectors.name = 'panel_normal'
ug.point_data.scalars = np.arange(0, coords.shape[0])
- ug.point_data.scalars.name = 'point_id'
+ ug.point_data.scalars.name = 'n_id'
+ ug.point_data.add_array(point_struct_id)
+ ug.point_data.get_array(1).name = 'point_struct_id'
write_data(ug, filename)
pass
