Skip to content

Commit ef152db

Browse files
committed
adding flutter tests
1 parent 4598d80 commit ef152db

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

pyNastran/dev/bdf_vectorized3/cards/test/test_vector_aero.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
from pyNastran.bdf.cards.aero.static_loads import AESTAT, AEROS # , CSSCHD, TRIM, TRIM2, DIVERG
3636
#from pyNastran.bdf.cards.aero.utils import build_trim_load_cases
3737
from pyNastran.bdf.mesh_utils.export_caero_mesh import export_caero_mesh # build_structure_from_caero
38+
from pyNastran.f06.dev.flutter.nastran_utils import (
39+
get_element_table, get_property_table,
40+
get_material_table,
41+
)
42+
3843

3944
IS_MATPLOTLIB = False
4045
if IS_MATPLOTLIB:
@@ -128,6 +133,10 @@ def test_freedlm(self):
128133
def test_bwb(self):
129134
bdf_filename = MODEL_PATH / 'bwb' / 'bwb_saero.bdf'
130135
model = read_bdf(bdf_filename)
136+
get_element_table(model)
137+
get_property_table(model)
138+
get_material_table(model)
139+
131140
methods = SetMethods(model)
132141

133142
check_set_methods(model)

pyNastran/f06/test/test_f06_utils.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
from pyNastran.f06.dev.read_sol_200 import plot_sol_200 # read_sol_200
4545
from pyNastran.op2.op2 import OP2
4646
from pyNastran.utils import print_bad_path
47-
47+
try:
48+
from pyNastran.f06.dev.flutter.utils import load_f06_op2, get_png_filename
49+
IS_DEV = True
50+
except ImportError:
51+
IS_DEV = False
4852

4953
DIRNAME = os.path.dirname(__file__)
5054
PKG_PATH = Path(pyNastran.__path__[0])
@@ -214,6 +218,36 @@ def test_plot_flutter_bah(self):
214218
# subcases=[1, 3],
215219
# log=log)
216220

221+
@unittest.skipIf(not IS_DEV, 'no flutter-dev')
222+
def test_plot_flutter_0012_dev(self):
223+
"""tests load_f06_op2 and get_png_filename"""
224+
log = SimpleLogger(level='warning')
225+
dirname = AERO_PATH / '2_mode_flutter'
226+
f06_filename = dirname / '0012_flutter.f06'
227+
load_f06_op2(f06_filename, log,
228+
in_units='si', out_units='si', use_rhoref=False)
229+
230+
base = 'base'
231+
x_plot_type = 'eas'
232+
plot_type = 'Vg'
233+
export_to_png = True
234+
png_filename0, png_filename = get_png_filename(
235+
base, x_plot_type, plot_type,
236+
export_to_png)
237+
assert png_filename0 == 'base_Vg.png', png_filename0
238+
assert png_filename == 'base_Vg.png', png_filename
239+
png_filename0, png_filename = get_png_filename(
240+
base, 'x-'+x_plot_type, plot_type,
241+
export_to_png)
242+
assert png_filename0 == 'base_Vg.png', png_filename0
243+
assert png_filename == 'base_Vg.png', png_filename
244+
245+
png_filename0, png_filename = get_png_filename(
246+
base, 'x-'+x_plot_type, plot_type,
247+
export_to_png=False)
248+
assert png_filename0 == 'base_Vg.png', png_filename0
249+
assert png_filename is None, png_filename
250+
217251
def test_plot_flutter_0012(self):
218252
"""
219253
tests plot_flutter_f06
@@ -222,6 +256,7 @@ def test_plot_flutter_0012(self):
222256
"""
223257
dirname = AERO_PATH / '2_mode_flutter'
224258
f06_filename = dirname / '0012_flutter.f06'
259+
225260
#log = get_logger(log=None, level=None, encoding='utf-8')
226261
log = get_logger(log=None, level=False, encoding='utf-8')
227262

pyNastran/f06/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def cmd_line_plot_trim(argv=None, plot: bool=True, show: bool=True,
8989
write_panel_xyz=False)
9090

9191
assert os.path.exists(aerobox_caero_filename), print_bad_path(aerobox_caero_filename)
92-
loads_filename = os.path.join(dirname, 'loads.inc')
92+
loads_filename = os.path.join(dirname, 'loads.blk')
9393
base = os.path.splitext(f06_filename)[0]
9494
if f06_filename.lower().endswith(('.bdf', '.op2')):
9595
f06_filename = base + '.f06'

0 commit comments

Comments
 (0)