Skip to content

Commit 177496c

Browse files
committed
Fixed issue where aerogridplot alters case data through array views. Small fix to beamplot where some beam elements were ordered incorrectly.
1 parent e76797f commit 177496c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

sharpy/postproc/aerogridplot.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ def plot_body(self):
170170
for i_surf in range(aero_tstep.n_surf):
171171
filename = f"{self.body_filename}_{i_surf:02d}_{self.ts:06d}.vtu"
172172

173-
zeta = np.moveaxis(aero_tstep.zeta[i_surf], 0, -1) # [m+1, n+1, 3]
174-
zeta_dot = np.moveaxis(aero_tstep.zeta_dot[i_surf][:3, ...], 0, -1) # [3, m+1, n+1]
175-
gamma = aero_tstep.gamma[i_surf] # [m, n]
176-
gamma_dot = aero_tstep.gamma_dot[i_surf] # [m, n]
177-
normals = np.moveaxis(aero_tstep.normals[i_surf], 0, -1) # [m, n, 3]
173+
zeta = np.moveaxis(aero_tstep.zeta[i_surf], 0, -1).copy() # [m+1, n+1, 3]
174+
zeta_dot = np.moveaxis(aero_tstep.zeta_dot[i_surf][:3, ...], 0, -1).copy() # [3, m+1, n+1]
175+
gamma = aero_tstep.gamma[i_surf].copy() # [m, n]
176+
gamma_dot = aero_tstep.gamma_dot[i_surf].copy() # [m, n]
177+
normals = np.moveaxis(aero_tstep.normals[i_surf], 0, -1).copy() # [m, n, 3]
178178
surf_id = np.ones(gamma.shape, dtype=int) * i_surf
179179

180180
if self.settings['include_rbm']:
@@ -226,8 +226,8 @@ def plot_wake(self):
226226
for i_surf in range(self.data.aero.timestep_info[self.ts].n_surf):
227227
filename = f"{self.wake_filename}_{i_surf:02d}_{self.ts:06d}.vtu"
228228

229-
zeta_star = np.moveaxis(self.data.aero.timestep_info[self.ts].zeta_star[i_surf], 0, -1) # [m*+1, n+1, 3]
230-
gamma = self.data.aero.timestep_info[self.ts].gamma_star[i_surf] # [m*, n]
229+
zeta_star = np.moveaxis(self.data.aero.timestep_info[self.ts].zeta_star[i_surf], 0, -1).copy() # [m*+1, n+1, 3]
230+
gamma = self.data.aero.timestep_info[self.ts].gamma_star[i_surf].copy() # [m*, n]
231231

232232
surf_id = np.ones(gamma.shape, dtype=int) * i_surf
233233

sharpy/postproc/beamplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ def write_beam(self, it):
262262
line = vtk.vtkPolyLine()
263263
line.GetPointIds().SetNumberOfIds(3)
264264
line.GetPointIds().SetId(0, _conn[0])
265-
line.GetPointIds().SetId(1, _conn[2])
266-
line.GetPointIds().SetId(2, _conn[1])
265+
line.GetPointIds().SetId(1, _conn[1])
266+
line.GetPointIds().SetId(2, _conn[2])
267267
cells.InsertNextCell(line)
268268
ug.SetLines(cells)
269269

0 commit comments

Comments
 (0)