コード例 #1
0
ファイル: test_coords.py プロジェクト: zbhfut/pyNastran
    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))
コード例 #2
0
ファイル: test_coords.py プロジェクト: zbhfut/pyNastran
    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))
コード例 #3
0
ファイル: test_coords.py プロジェクト: ratalex/pyNastran
 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))