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


Python PBEAM.add_card方法代码示例

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


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

示例1: test_pbeam_03

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
    def test_pbeam_03(self):
        lines = [
            'PBEAM,39,6,2.9,3.5,5.97',
            '     ,  , ,2.0,-4.0',
            '     ,YES,1.0,5.3,56.2,78.6',
            '     ,   ,   ,2.5,-5.0',
            '     ,   ,   ,1.1,    ,2.1,,0.21',
            '     ,   ,   ,   ,    ,0.5,,0.0',
        ]

        card = bdf.process_card(lines)
        cardi = BDFCard(card)
        card2 = PBEAM()
        card2.add_card(cardi)
        fields = card2.raw_fields()

        lines_expected = [
            'PBEAM         39       6     2.9     3.5    5.97      0.      0.      0.',
            '              0.      0.      2.     -4.      0.      0.      0.      0.',
            '             YES      1.     5.3    56.2    78.6      0.      0.      0.',
            '              0.      0.     2.5     -5.      0.      0.      0.      0.',
            '              1.      1.     1.1      0.     2.1     2.1     .21     .21',
            '              0.      0.      0.      0.      .5      .5      0.      0.',
        ]
        self._compare(fields, lines_expected)
开发者ID:watkinrt,项目名称:pyNastran,代码行数:27,代码来源:test_beams.py

示例2: test_pbeam_07

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
 def test_pbeam_07(self):
     lines = [
         'PBEAM   100     100     1.00    10.     1.0                             +Z1',
         '+Z1     NO      1.0                                                     +Z4',
         '+Z4     0.0     0.0',
     ]
     card = bdf.process_card(lines)
     cardi = BDFCard(card)
     card2 = PBEAM()
     card2.add_card(cardi)
开发者ID:watkinrt,项目名称:pyNastran,代码行数:12,代码来源:test_beams.py

示例3: test_pbeam_08

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
    def test_pbeam_08(self):
        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)
        cardi = BDFCard(card)
        card2 = PBEAM()
        card2.add_card(cardi)

        if 1:
            fields = card2.raw_fields()
            msg = print_card_8(fields)
            size = 16
            msg = card2.write_card(size, 'dummy')

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

示例4: test_pbeam_07

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
 def test_pbeam_07(self):
     bdf = BDF(debug=False)
     lines = [
         'PBEAM   100     100     1.00    10.     1.0                             +Z1',
         '+Z1     NO      1.0                                                     +Z4',
         '+Z4     0.0     0.0',
     ]
     card = bdf.process_card(lines)
     cardi = BDFCard(card)
     card2 = PBEAM.add_card(cardi)
开发者ID:saullocastro,项目名称:pyNastran,代码行数:12,代码来源:test_beams.py

示例5: test_pbeam_05

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
    def test_pbeam_05(self):
        lines = [
            'PBEAM,39,6,2.9,3.5,5.97',
            '     ,  , ,2.0,-4.0',
        ]

        card = bdf.process_card(lines)
        #print(print_card_8(card))
        cardi = BDFCard(card)
        card2 = PBEAM()
        card2.add_card(cardi)
        fields = card2.raw_fields()
        msg = print_card_8(fields)

        lines_expected = [
            'PBEAM         39       6     2.9     3.5    5.97      0.      0.      0.',
            '              0.      0.      2.     -4.      0.      0.      0.      0.',
            '              1.      1.      0.      0.      0.      0.      0.      0.',
            '              0.      0.      0.      0.      0.      0.      0.      0.',
        ]
        self._compare(fields, lines_expected)
开发者ID:watkinrt,项目名称:pyNastran,代码行数:23,代码来源:test_beams.py

示例6: test_pbeam_09

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
 def test_pbeam_09(self):
     fields = [
         u'PBEAM', 4570049, 4570010, 0.12, 0.000256, 0.005625, None, 0.0008889, 6.4444e-07,
         -0.04, -0.75, 0.04, -0.75, 0.04, 0.75, -0.04, 0.75,
         'YES', 1.0, 0.12, 0.000256, 0.005625, 0.000256, None, 0.0008889,
         6.4444e-07, -0.04, -0.75, 0.04, -0.75, 0.04, 0.75, -0.04,
         0.853433, 0.849842
     ]
     #fields = [u'PBAR', 1510998, 1520998, 0.0, 4.9000000000000006e-14,
     #4.9000000000000006e-14, 0.0, 0.0, None, 0.0, 0.0, 0.0, 0.0,
     #0.0, 0.0, 0.0, 0.0, None, None, 0.0]
     card = print_card_8(fields)
     #print(card)
     card = print_card_8(fields)
     lines = card.split('\n')
     card = bdf.process_card(lines)
     cardi = BDFCard(card)
     #with self.assertRaises(AssertionError):  # A=0, I12=0, K1=0
     pbeam = PBEAM()
     pbeam.add_card(cardi)
     fields2 = pbeam.repr_fields()
     assert fields == fields
开发者ID:watkinrt,项目名称:pyNastran,代码行数:24,代码来源:test_beams.py

示例7: test_pbeam_06

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
    def test_pbeam_06(self):
        lines = [
            'PBEAM   1       1       1.      60.     1.                              PBEAM1',
            '+BEAM1  5.              -5.                                             PBEAM2',
            '+BEAM2  YES     1.      2.      240.                                    PBEAM3',
            '+BEAM3  10.             -10.                                            PBEAM4',
            '+BEAM4                  -.666667',
        ]

        card = bdf.process_card(lines)
        cardi = BDFCard(card)
        card2 = PBEAM()
        card2.add_card(cardi)
        fields = card2.raw_fields()

        lines_expected = [
            'PBEAM          1       1      1.     60.      1.      0.      0.      0.',
            '              5.      0.     -5.      0.      0.      0.      0.      0.',
            '             YES      1.      2.    240.      1.      0.      0.      0.',
            '             10.      0.    -10.      0.      0.      0.      0.      0.',
            '              1.      1.-.666667      0.      0.      0.      0.      0.',
            '              0.      0.      0.      0.      0.      0.      0.      0.',
        ]
        self._compare(fields, lines_expected)
开发者ID:watkinrt,项目名称:pyNastran,代码行数:26,代码来源:test_beams.py

示例8: test_pbeam_04

# 需要导入模块: from pyNastran.bdf.bdf import PBEAM [as 别名]
# 或者: from pyNastran.bdf.bdf.PBEAM import add_card [as 别名]
    def test_pbeam_04(self):
        bdf = BDF(debug=False)
        lines = [
            'PBEAM,39,6,2.9,3.5,5.97',
            '     ,  , ,2.0,-4.0',
            '     ,   ,   ,1.1,    ,2.1,,0.21',
            '     ,   ,   ,   ,    ,0.5,,0.0',
        ]

        card = bdf.process_card(lines)
        cardi = BDFCard(card)
        card2 = PBEAM.add_card(cardi)
        fields = card2.raw_fields()
        lines_expected = [
            'PBEAM         39       6     2.9     3.5    5.97      0.      0.      0.',
            '              0.      0.      2.     -4.      0.      0.      0.      0.',
            '              1.      1.     1.1      0.     2.1     2.1     .21     .21',
            '              0.      0.      0.      0.      .5      .5      0.      0.',
        ]
        self._compare(fields, lines_expected)
开发者ID:saullocastro,项目名称:pyNastran,代码行数:22,代码来源:test_beams.py


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