Added vibration modes postprocessor
@@ -78,8 +78,8 @@ class VibrationModesPlot(BaseSolver):
def process_eigenvalues(self):
self.data.beam.freq = np.sqrt(self.data.beam.w)/(2*np.pi)
- pos_def = np.asfortranarray(self.data.beam.pos_ini)
- psi_def = np.asfortranarray(self.data.beam.psi_ini)
+ pos_def = np.copy(self.data.beam.pos_ini, order='F')
+ psi_def = np.copy(self.data.beam.psi_ini, order='F')
beamlib.cbeam3_solv_update_static_python(self.data.beam,
self.data.beam.v[:, 0],
pos_def,
@@ -95,10 +95,10 @@ class VibrationModesPlot(BaseSolver):
# 2nd mode
- pos_def = np.asfortranarray(self.data.beam.pos_ini)
- psi_def = np.asfortranarray(self.data.beam.psi_ini)
+ pos_def = np.copy(self.data.beam.pos_ini, order='F')
+ psi_def = np.copy(self.data.beam.psi_ini, order='F')
beamlib.cbeam3_solv_update_static_python(self.data.beam,
- self.data.beam.v[:, 2],
+ self.data.beam.v[:, 1],
pos_def,
psi_def)
@@ -109,4 +109,20 @@ class VibrationModesPlot(BaseSolver):
plt.title('mode 2')
plt.plot(pos_def[:,0], pos_def[:, 1], pos_def[:, 2])
plt.show()
+
+ # 3rd mode
+ pos_def = np.copy(self.data.beam.pos_ini, order='F')
+ psi_def = np.copy(self.data.beam.psi_ini, order='F')
+ beamlib.cbeam3_solv_update_static_python(self.data.beam,
+ self.data.beam.v[:, 2],
+ pos_def,
+ psi_def)
+
+ import matplotlib.pyplot as plt
+ from mpl_toolkits.mplot3d import Axes3D
+ fig = plt.figure()
+ ax = fig.add_subplot(111, projection='3d')
+ plt.title('mode 3')
+ plt.plot(pos_def[:,0], pos_def[:, 1], pos_def[:, 2])
+ plt.show()
a = 1
