def test_rbe2_02(self): lines = [ 'RBE2 100045 166007 123456 117752 101899 117766 101898 117748', '+ 117765 117764 117763 109821 117743 117744 117750 117751', '+ 117745 117746 101902 ', ] card = bdf._process_card(lines) card = BDFCard(card) rbe = RBE2.add_card(card) fields = rbe.raw_fields() msg = print_card_8(fields).rstrip() lines_expected = [ 'RBE2 100045 166007 123456 117752 101899 117766 101898 117748', ' 117765 117764 117763 109821 117743 117744 117750 117751', ' 117745 117746 101902 0.' ] lines_actual = msg.rstrip().split('\n') msg = '\n%s\n\n%s\n' % ('\n'.join(lines_expected), msg) msg += 'nlines_actual=%i nlines_expected=%i' % (len(lines_actual), len(lines_expected)) self.assertEqual(len(lines_actual), len(lines_expected), msg) for actual, expected in zip(lines_actual, lines_expected): self.assertEqual(actual, expected, msg) dependent_nid_to_components = check_rbe(rbe) expected = { 117763: '123456', 117764: '123456', 117765: '123456', 117766: '123456', 101898: '123456', 101899: '123456', 101902: '123456', 117743: '123456', 117744: '123456', 117745: '123456', 117746: '123456', 117748: '123456', 117750: '123456', 117751: '123456', 117752: '123456', 109821: '123456' } assert dependent_nid_to_components == expected, dependent_nid_to_components model = BDF(debug=None, log=None, mode='msc') eid = rbe.eid gn = rbe.gn cm = rbe.cm Gmi = rbe.Gmi alpha = rbe.alpha model.add_rbe2(eid, gn, cm, Gmi, alpha=alpha, comment='rbe2') nids = [ 117752, 101899, 117766, 101898, 117748, 117765, 117764, 117763, 109821, 117743, 117744, 117750, 117751, 117745, 117746, 101902, 166007 ] for nid in nids: model.add_grid(nid, [0., 0., 0.]) save_load_deck(model)
def test_rbe2_01(self): lines = [ 'RBE2 100045 166007 123456 117752 101899 117766 101898 117748', '+ 117765 117764 117763 109821 117743 117744 117750 117751', '+ 117745 117746 101902 1.-6', ] card = bdf._process_card(lines) card = BDFCard(card) rbe = RBE2.add_card(card) fields = rbe.raw_fields() msg = print_card_8(fields).rstrip() #print(msg) lines_expected = [ 'RBE2 100045 166007 123456 117752 101899 117766 101898 117748', ' 117765 117764 117763 109821 117743 117744 117750 117751', ' 117745 117746 101902 .000001' ] lines_actual = msg.rstrip().split('\n') msg = '\n%s\n\n%s\n' % ('\n'.join(lines_expected), msg) msg += 'nlines_actual=%i nlines_expected=%i' % (len(lines_actual), len(lines_expected)) self.assertEqual(len(lines_actual), len(lines_expected), msg) for actual, expected in zip(lines_actual, lines_expected): self.assertEqual(actual, expected, msg) dependent_nid_to_components = check_rbe(rbe) expected = {117763: '123456', 117764: '123456', 117765: '123456', 117766: '123456', 101898: '123456', 101899: '123456', 101902: '123456', 117743: '123456', 117744: '123456', 117745: '123456', 117746: '123456', 117748: '123456', 117750: '123456', 117751: '123456', 117752: '123456', 109821: '123456'} assert dependent_nid_to_components == expected, dependent_nid_to_components
def test_rbe2_02(self): lines = [ 'RBE2 100045 166007 123456 117752 101899 117766 101898 117748', '+ 117765 117764 117763 109821 117743 117744 117750 117751', '+ 117745 117746 101902 ', ] card = bdf.process_card(lines) card = BDFCard(card) rbe = RBE2.add_card(card) fields = rbe.raw_fields() msg = print_card_8(fields).rstrip() lines_expected = [ 'RBE2 100045 166007 123456 117752 101899 117766 101898 117748', ' 117765 117764 117763 109821 117743 117744 117750 117751', ' 117745 117746 101902 0.' ] lines_actual = msg.rstrip().split('\n') msg = '\n%s\n\n%s\n' % ('\n'.join(lines_expected), msg) msg += 'nlines_actual=%i nlines_expected=%i' % (len(lines_actual), len(lines_expected)) self.assertEqual(len(lines_actual), len(lines_expected), msg) for actual, expected in zip(lines_actual, lines_expected): self.assertEqual(actual, expected, msg)