Skip to content

Commit

Permalink
fixing modal frequency calc (mode-cycle was wrong b/c nastran does it…
Browse files Browse the repository at this point in the history
… wrong)
  • Loading branch information
Steve Doyle committed Dec 1, 2024
1 parent 25aab01 commit c56cf58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions pyNastran/f06/gui_flutter.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@ def on_load_f06(self) -> None:
self._units_out = out_units
self.add_recent_file(f06_filename)
self.update_subcases(subcases)
self.ok_button.setEnabled(True)

def add_recent_file(self, f06_filename: str) -> None:
path = os.path.abspath(f06_filename)
Expand Down
20 changes: 13 additions & 7 deletions pyNastran/op2/tables/oug/oug.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,20 @@ def size(self) -> int:
def factor(self) -> int:
return self.op2.factor

def update_mode_cycle(self, name):
def update_mode_cycle(self, name: str):
op2 = self.op2
value = getattr(op2, name)
if value == 0.0:
#print('table_name=%r mode=%s eigr=%s' % (op2.table_name, op2.mode, op2.eigr))
value = np.sqrt(np.abs(op2.eign)) / (2. * np.pi)
setattr(op2, name, value)
op2.data_code[name] = value
assert name == 'mode_cycle', name
#value = getattr(op2, name)
if op2.eign != 0.0:
#print('table_name=%r mode=%s eign=%g mode_cycle=%g' % (
#op2.table_name, op2.mode, op2.eign, op2.mode_cycle))
omega = np.sqrt(np.abs(op2.eign))

cycles = omega / (2. * np.pi)
setattr(op2, name, cycles)
setattr(op2, 'omega', omega)
op2.data_code['omega'] = omega
op2.data_code[name] = cycles

def _read_oug1_3(self, data: bytes, ndata: int):
"""reads table 3 (the header table)"""
Expand Down

0 comments on commit c56cf58

Please sign in to comment.