예제 #1
0
    def test_gap_01(self):
        """tests a CGAP/PGAP"""
        log = get_logger(level='warning')
        model = BDF(log=log)
        lines = [
            'CGAP    899     90      21      99      0.      1.      0.      0'
        ]
        card = model._process_card(lines)
        card = BDFCard(card)

        cgap = CGAP.add_card(card, comment='cgap')
        node_ids = cgap.node_ids
        assert node_ids == [21, 99], node_ids
        self.assertEqual(cgap.eid, 899)
        self.assertEqual(cgap.Pid(), 90)
        cgap.write_card(size=8)
        cgap.raw_fields()

        lines = ['PGAP    90                      1.E+5']
        card = model._process_card(lines)
        card = BDFCard(card)

        pgap = PGAP.add_card(card, comment='pgap')
        pgap.write_card(size=8)
        pgap.write_card(size=16)
        self.assertEqual(pgap.Pid(), 90)
        pgap.raw_fields()
예제 #2
0
    def test_cgap_01(self):
        lines = ['CGAP    899     90      21      99      0.      1.      0.      0']
        card = bdf.process_card(lines)
        card = BDFCard(card)

        size = 8
        elem = CGAP.add_card(card)
        node_ids = elem.node_ids
        assert node_ids == [21, 99], node_ids
        self.assertEqual(elem.eid, 899)
        self.assertEqual(elem.Pid(), 90)
        elem.write_card(size, 'dummy')
        elem.raw_fields()
예제 #3
0
    def test_cgap_01(self):
        lines = [
            'CGAP    899     90      21      99      0.      1.      0.      0'
        ]
        card = bdf.process_card(lines)
        card = BDFCard(card)

        size = 8
        card = CGAP(card)
        self.assertEquals(card.Eid(), 899)
        self.assertEquals(card.Pid(), 90)
        card.write_bdf(size, 'dummy')
        card.raw_fields()
예제 #4
0
    def test_gap_01(self):
        """tests a CGAP/PGAP"""
        log = get_logger(level='warning')
        model = BDF(log=log)
        lines = [
            'CGAP    899     90      21      99      0.      1.      0.      0'
        ]
        card = model._process_card(lines)
        card = BDFCard(card)

        cgap = CGAP.add_card(card, comment='cgap')
        node_ids = cgap.node_ids
        assert node_ids == [21, 99], node_ids
        self.assertEqual(cgap.eid, 899)
        self.assertEqual(cgap.Pid(), 90)
        cgap.write_card(size=8)
        cgap.raw_fields()
        model.elements[899] = cgap

        lines = ['PGAP    90                      1.E+5']
        card = model._process_card(lines)
        card = BDFCard(card)

        pgap = PGAP.add_card(card, comment='pgap')
        pgap.write_card(size=8)
        pgap.write_card(size=16)
        self.assertEqual(pgap.Pid(), 90)
        pgap.raw_fields()
        model.properties[90] = pgap

        model.add_grid(3, [-1., 0., 0.])
        model.add_grid(21, [0., 0., 0.])
        model.add_grid(99, [1., 0., 0.])
        eid = 100
        pid = 90
        nids = [21, 99]
        x = None
        g0 = 3
        cid = None
        cgap = model.add_cgap(eid, pid, nids, x, g0, cid, comment='cgap')
        node_ids = cgap.node_ids
        assert node_ids == [21, 99], node_ids
        self.assertEqual(cgap.eid, 100)
        self.assertEqual(cgap.Pid(), 90)
        cgap.write_card(size=8)
        cgap.raw_fields()

        model.cross_reference()
        save_load_deck(model)
예제 #5
0
    def test_cgap_01(self):
        lines = [
            'CGAP    899     90      21      99      0.      1.      0.      0'
        ]
        card = bdf.process_card(lines)
        card = BDFCard(card)

        size = 8
        elem = CGAP.add_card(card)
        node_ids = elem.node_ids
        assert node_ids == [21, 99], node_ids
        self.assertEqual(elem.eid, 899)
        self.assertEqual(elem.Pid(), 90)
        elem.write_card(size, 'dummy')
        elem.raw_fields()