def test_param_01(self): card = PARAM('NOCOMP', [-1]) #print('%r' % card) assert str(card) == 'PARAM NOCOMP -1\n', '%r' % str(card) cardi = BDFCard(['PARAM', 'NOCOMP', -1]) card = PARAM.add_card(cardi) assert str(card) == 'PARAM NOCOMP -1\n', '%r' % str(card)
class TestOther(unittest.TestCase): card = PARAM('NOCOMP', [-1]) #print('%r' % card) assert str(card) == 'PARAM NOCOMP -1\n', '%r' % str(card) cardi = BDFCard(['PARAM', 'NOCOMP', -1]) card = PARAM.add_card(cardi) assert str(card) == 'PARAM NOCOMP -1\n', '%r' % str(card)
def test_convert_sine(self): """converts a sine model""" model_path = os.path.join(pkg_path, '..', 'models', 'freq_sine') bdf_filename = os.path.join(model_path, 'good_sine.dat') bdf_filename_out = os.path.join(model_path, 'sine_modes.bdf') bdf_filename_out2 = os.path.join(model_path, 'sine_converted.bdf') model = read_bdf(bdf_filename, log=log, validate=False) model.sol = 103 lines = [ 'ECHO = NONE', 'SUBCASE 1', ' DISPLACEMENT(PLOT) = ALL', #'$ SPC = 100', ' METHOD = 42', ] card_lines = ['EIGRL', 42, None, None, 20] model.add_card(card_lines, 'EIGRL') model.case_control_deck = CaseControlDeck(lines, log=log) model.params['GRDPNT'] = PARAM('GRDPNT', 0) #del model.params['WTMASS'] model.write_bdf(bdf_filename_out) #units_from = ['in', 'lbm', 's'] units_from = ['mm', 'Mg', 's'] units_to = ['m', 'kg', 's'] convert(model, units_to, units=units_from) model.write_bdf(bdf_filename_out2) os.remove(bdf_filename_out) os.remove(bdf_filename_out2)