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


Python BDF.add_cards_lines方法代码示例

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


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

示例1: test_cord2_rcs_02

# 需要导入模块: from pyNastran.bdf.dev_vectorized.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.dev_vectorized.bdf.BDF import add_cards_lines [as 别名]
 def test_cord2_rcs_02(self):
     """
     all points are located at <30,40,50>
     """
     model = BDF(debug=False)
     #card_count = {
         #'GRID' : 3,
         #'CORD2R' : 1,
         #'CORD2C' : 2,
         #'CORD2S' : 1,
     #}
     #model.allocate(card_count)
     card_lines = [
         [
             'CORD2C*                1               0              0.              0.',
             '*                     0.              0.              0.              1.*       ',
             '*                     1.              0.              1.',],
         [
             #'$ Femap with NX Nastran Coordinate System 20 : rectangular defined in cylindrical',
             'CORD2R*               20               1              7.             20.',
             '*                    -6.   7.07106781187   28.1301023542             -6.*       ',
             '*          7.70710678119             20.  -5.29289321881',],
         [
             #'$ Femap with NX Nastran Coordinate System 21 : cylindrical defined in cylindrical',
             'CORD2C*               21               1             15.            -30.',
             '*                    12.   14.6565766735  -30.3177805524   12.9355733712*       ',
             '*          14.6234241583  -26.4257323272   11.9304419665',],
         [
             #'$ Femap with NX Nastran Coordinate System 22 : spherical defined in cylindrical',
             'CORD2S*               22               1              5.            -75.',
             '*                    20.   5.66032384035  -82.9319986389   19.8502545865*       ',
             '*          4.88876051026  -73.8006653677   19.0116094889',],
         [
             'GRID*                 20              20   64.2559135157  -14.9400459772',
             '*          27.3271005317               0',],
         [
             'GRID*                 21              21   52.8328862418  -28.8729017195',
             '*           34.615939507               0',],
         [
             'GRID*                 22              22   61.1042111232   158.773483595',
             '*           -167.4951724               0',],
     ]
     cards, card_count = model.add_cards_lines(card_lines)
     model.allocate(card_count, cards)
     #for lines in cards:
         #card = model.add(lines)
         #model.add_card(card, card[0])
     model.build()
     for nid in model.nodes:
         a = array([30., 40., 50.])
         b = model.Node(nid).get_position()
         self.assertTrue(allclose(array([30., 40., 50.]), model.Node(nid).get_position()), str(a - b))
开发者ID:hurlei,项目名称:pyNastran,代码行数:54,代码来源:test_coords.py

示例2: test_cord2_rcs_03

# 需要导入模块: from pyNastran.bdf.dev_vectorized.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.dev_vectorized.bdf.BDF import add_cards_lines [as 别名]
    def test_cord2_rcs_03(self):
        """
        all points are located at <30,40,50>
        """
        model = BDF(debug=False)
        #card_count = {
            #'GRID' : 3,
            #'CORD2R' : 1,
            #'CORD2C' : 1,
            #'CORD2S' : 2,
        #}

        card_lines = [
            [
                'CORD2S*                2               0              0.              0.',
                '*                     0.              0.              0.              1.*       ',
                '*                     1.              0.              1.',],
            [
                #'$ Femap with NX Nastran Coordinate System 30 : rectangular in spherical',
                'CORD2R*               30               2             14.             30.',
                '*                    70.    13.431863852   32.1458443949   75.2107442927*       ',
                '*          14.4583462334   33.4569982885   68.2297989286',],
            [
                #'$ Femap with NX Nastran Coordinate System 31 : cylindrical in spherical',
                'CORD2C*               31               2              3.             42.',
                '*                  -173.   2.86526881213   45.5425615252   159.180363517*       ',
                '*          3.65222385965   29.2536614627  -178.631312271',],
            [
                #'$ Femap with NX Nastran Coordinate System 32 : spherical in spherical',
                'CORD2S*               32               2             22.             14.',
                '*                    85.   22.1243073983   11.9537753718   77.9978191005*       ',
                '*          21.0997242967   13.1806120497   88.4824763008',],
            [
                'GRID*                 30              30   40.7437952957  -23.6254877994',
                '*           -33.09784854               0',],
            [
                'GRID*                 31              31   62.9378078196   15.9774797923',
                '*          31.0484428362               0',],
            [
                'GRID*                 32              32   53.8270847449   95.8215692632',
                '*          159.097767463               0',],
        ]
        cards, card_count = model.add_cards_lines(card_lines)
        model.allocate(card_count, cards)
        model.build()

        for nid in model.nodes:
            a = array([30., 40., 50.])
            b = model.Node(nid).get_position()
            self.assertTrue(allclose(array([30., 40., 50.]), model.Node(nid).get_position()), str(a - b))
开发者ID:hurlei,项目名称:pyNastran,代码行数:52,代码来源:test_coords.py

示例3: test_cord2_rcs_01

# 需要导入模块: from pyNastran.bdf.dev_vectorized.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.dev_vectorized.bdf.BDF import add_cards_lines [as 别名]
    def test_cord2_rcs_01(self):
        """
        all points are located at <30,40,50>
        """
        model = BDF(debug=False)
        card_count = {
            'GRID' : 3,
            'CORD2R' : 1,
            'CORD2C' : 1,
            'CORD2S' : 1,
        }
        cards = []
        card_lines = [
            [
                #'$ Femap with NX Nastran Coordinate System 10 : rectangular defined in a rectangular',
                'CORD2R*               10               0             10.              5.',
                '*                     3.   10.3420201433   4.53015368961   3.81379768136*       ',
                '*          10.7198463104   5.68767171433   3.09449287122',],
            [
                #'$ Femap with NX Nastran Coordinate System 11 : cylindrical defined in rectangular',
                'CORD2C*               11               0              7.              3.',
                '*                     9.   7.64278760969   2.73799736977   9.71984631039*       ',
                '*          7.75440650673   3.37968226211   8.46454486422',],
            [
                #'$ Femap with NX Nastran Coordinate System 12 : spherical defined in rectangular',
                'CORD2S*               12               0             12.              8.',
                '*                     5.   12.6427876097   7.86697777844   5.75440650673*       ',
                '*          12.6634139482   8.58906867688   4.53861076379',],

            [
                'GRID*                 10              10   42.9066011565   34.2422137135',
                '*          28.6442730262               0',],
            [
                'GRID*                 11              11   48.8014631871   78.8394787869',
                '*          34.6037164304               0',],
            [
                'GRID*                 12              12   58.0775343829   44.7276544324',
                '*          75.7955331161               0',],
        ]
        cards, card_count = model.add_cards_lines(card_lines)
        model.allocate(card_count, cards)
        model.build()

        for nid in model.nodes:
            a = array([30., 40., 50.])
            b = model.Node(nid).get_position()
            self.assertTrue(allclose(array([30., 40., 50.]), model.Node(nid).get_position()), str(a - b))
开发者ID:hurlei,项目名称:pyNastran,代码行数:49,代码来源:test_coords.py

示例4: test_grid_01

# 需要导入模块: from pyNastran.bdf.dev_vectorized.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.dev_vectorized.bdf.BDF import add_cards_lines [as 别名]
 def test_grid_01(self):
     model = BDF(debug=False)
     card_lines = [
         #['CORD1R', 1, 1, 2, 3],  # fails on self.k
         ['GRID', 1, 0, 0., 0., 0.],
         ['GRID', 2, 0, 1., 0., 0.],
         ['GRID', 4, 0, 1., 2., 3.],
     ]
     #card_count = {
         #'GRID': 3,
     #}
     cards, card_count = model.add_cards_lines(card_lines)
     model.allocate(card_count, cards)
     for card in cards:
         model.add_card(card, card[0], comment='comment', is_list=True)
     model.build()
     #+------+-----+----+----+----+----+----+----+------+
     #|   0  |  1  | 2  | 3  | 4  | 5  |  6 | 7  |  8   |
     #+======+=====+====+====+====+====+====+====+======+
     #| GRID | NID | CP | X1 | X2 | X3 | CD | PS | SEID |
     #+------+-----+----+----+----+----+----+----+------+
     node = model.grid.slice_by_node_id(4)
开发者ID:hurlei,项目名称:pyNastran,代码行数:24,代码来源:test_coords.py


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