当前位置: 首页>>代码示例>>Python>>正文


Python PBEAM.write_bdf方法代码示例

本文整理汇总了Python中pyNastran.bdf.bdf.PBEAM.write_bdf方法的典型用法代码示例。如果您正苦于以下问题:Python PBEAM.write_bdf方法的具体用法?Python PBEAM.write_bdf怎么用?Python PBEAM.write_bdf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyNastran.bdf.bdf.PBEAM的用法示例。


在下文中一共展示了PBEAM.write_bdf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_pbeam_08

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import write_bdf [as 别名]
    def test_pbeam_08(self):  # should fail...
        lines = [
        'PBEAM*   4570049         4570010        .12             2.56-4          *    HRY',
        '*    HRY.005625                         8.889-4         6.4444-7        *    HRZ',
        '*    HRZ-.04            -.75            .04             -.75            *    HSA',
        '*    HSA.04             .75             -.04            .75             *    HSB',
        '*    HSB YES            1.              .12             2.56-4          *    HSC',
        '*    HSC.005625                         8.889-4         6.4444-7        *    HSD',
        '*    HSD-.04            -.75            .04             -.75            *    HSE',
        '*    HSE.04             .75             -.04            .75             *    HSF',
        '*    HSF.853433         .849842                                         *    HSG',
        '*    HSG',
        ]
        lines_expected = [
        'PBEAM*           4570049         4570010             .12         .000256',
        '*                .005625                        .0008889    .00000064444',
        '*                   -.04            -.75             .04            -.75',
        '*                    .04             .75            -.04             .75',
        '*                    YES              1.             .12         .000256',
        '*                .005625                        .0008889    .00000064444',
        '*                   -.04            -.75             .04            -.75',
        '*                    .04             .75            -.04             .75',
        '*                .853433         .849842',
        '*',
        ]

        card = bdf.process_card(lines)
        card = BDFCard(card)
        #with self.assertRaises(RuntimeError):  # temporary RuntimeError
        card2 = PBEAM(card)

        if 1:
            fields = card2.rawFields()
            msg = print_card(fields)
            size = 16
            msg = card2.write_bdf(size, 'dummy')

            lines_actual = msg.rstrip().split('\n')
            msgA = '\n%s\n\n%s' % ('\n'.join(lines_expected), msg)
            msgA += '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):
                actual = str(actual)
                expected = str(expected)
                msg =  msgA + '\nactual   = %r\n' % actual
                msg += 'expected = %r' % expected
                self.assertEqual(actual, expected, msg)
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:49,代码来源:test_beams.py


注:本文中的pyNastran.bdf.bdf.PBEAM.write_bdf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。