예제 #1
0
    def test_mpc_03(self):
        model = BDF(debug=False)

        card = [
            'MPC            1    1002       4      1.    1000       4-.129394',
            '                    1000       5-7.152-3    1000       6-.013655',
            '                    1004       2   123.3',
        ]
        msg8 = (
            'MPC            1    1002       4      1.    1000       4-.129394\n'
            '                    1000       5-7.152-3    1000       6-.013655\n'
            '                    1004       2   123.3\n')
        msg16 = (
            'MPC*                   1            1002               4              1.\n'
            '*                   1000               4        -.129394\n'
            '*                                   1000               5        -.007152\n'
            '*                   1000               6        -.013655\n'
            '*                                   1004               2           123.3\n'
            '*\n')

        card = model.add_card(card, 'MPC', is_list=False)
        assert card is not None
        mpc = MPC.add_card(card)
        msg_8_actual = mpc.write_card(size=8)
        msg_16_actual = mpc.write_card(size=16)
        msg_16_double_actual = mpc.write_card(size=16, is_double=True)
        self.check_card(msg8, msg_8_actual)
        self.check_card(msg16, msg_16_actual)
    def test_mpc_03(self):
        model = BDF(debug=False)

        card = [
            'MPC            1    1002       4      1.    1000       4-.129394',
            '                    1000       5-7.152-3    1000       6-.013655',
            '                    1004       2   123.3',]
        msg8 = (
            'MPC            1    1002       4      1.    1000       4-.129394\n'
            '                    1000       5-7.152-3    1000       6-.013655\n'
            '                    1004       2   123.3\n')
        msg16 = (
            'MPC*                   1            1002               4              1.\n'
            '*                   1000               4        -.129394\n'
            '*                                   1000               5        -.007152\n'
            '*                   1000               6        -.013655\n'
            '*                                   1004               2           123.3\n'
            '*\n')


        card = model.add_card(card, 'MPC', is_list=False)
        assert card is not None
        mpc = MPC.add_card(card)
        msg_8_actual = mpc.write_card(size=8)
        msg_16_actual = mpc.write_card(size=16)
        msg_16_double_actual = mpc.write_card(size=16, is_double=True)
        self.check_card(msg8, msg_8_actual)
        self.check_card(msg16, msg_16_actual)
예제 #3
0
 def test_mpc_01(self):
     card = ['MPC', 1, 1002, 1, 1., 1000, 1, -3.861003861]
     card = BDFCard(card)
     mpc = MPC.add_card(card)
     #print ' %r' % str(mpc)
     #print '%r' % mpc.write_card(size=8)
     #msg = mpc.write_card(size=8, double=False)
     self.assertEqual(
         'MPC            1    1002       1      1.    1000       1  -3.861\n',
         mpc.write_card(size=8))
 def test_mpc_01(self):
     card = ['MPC', 1, 1002, 1, 1., 1000, 1, -3.861003861]
     card = BDFCard(card)
     mpc = MPC.add_card(card)
     #print ' %r' % str(mpc)
     #print '%r' % mpc.write_card(size=8)
     #msg = mpc.write_card(size=8, double=False)
     self.assertEqual(
         'MPC            1    1002       1      1.    1000       1  -3.861\n',
         mpc.write_card(size=8))