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


Python assign_type.integer函数代码示例

本文整理汇总了Python中pyNastran.bdf.bdf_interface.assign_type.integer函数的典型用法代码示例。如果您正苦于以下问题:Python integer函数的具体用法?Python integer怎么用?Python integer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: add_card

 def add_card(cls, card, comment=''):
     pid = integer(card, 1, 'pid')
     mid = integer(card, 2, 'mid')
     gamma = double_or_blank(card, 3, 'gamma', 0.5)
     phi = double_or_blank(card, 4, 'gamma', 180.)
     assert len(card) <= 5, 'len(PRAC3D card) = %i' % len(card)
     return PRAC3D(pid, mid, gamma, phi, comment=comment)
开发者ID:marcinch18,项目名称:pyNastran,代码行数:7,代码来源:properties.py

示例2: add_card

    def add_card(self, card, comment=''):
        i = self.i
        self.property_id[i] = integer(card, 1, 'pid')
        self.material_id[i] = integer(card, 2, 'mid')
        self.cordm[i] = integer_or_blank(card, 3, 'cordm', 0)
        self.integ[i] = integer_string_or_blank(card, 4, 'integ', '')
        #validIntegration = ['THREE', 'TWO', 'FULL', 'BUBBLE',
        #                    2, 3, None, 'REDUCED']
        # ISOP
        # ------
        #    1.  FULL
        #    2.
        #    3.
        #    REDUCED

        # IN
        # ------
        #    1.
        #    2.      TWO
        #    3.      THREE
        #    BUBBLE - 2 for CTETRA, 3 for CHEXA/CPENTA

        # STRESS
        # ------
        #    1.  GAUSS (no midside nodes on CPENTA/CHEXA; ok on CTETRA)
        #    2.
        self.stress[i] = integer_string_or_blank(card, 5, 'stress', '')
        self.isop[i] = integer_string_or_blank(card, 6, 'isop', '')
        self.fctn[i] = string_or_blank(card, 7, 'fctn', 'SMECH')
        assert len(card) <= 8, 'len(PSOLID card) = %i\ncard=%s' % (len(card), card)
        self.i += 1
开发者ID:hurlei,项目名称:pyNastran,代码行数:31,代码来源:psolid.py

示例3: __init__

    def __init__(self, card=None, data=None, comment=''):
        ThermalElement.__init__(self, card)
        if comment:
            self._comment = comment
        if card:
            #: Surface element ID
            self.eid = integer(card, 1, 'eid')

            #: PHBDY property entry identification numbers. (Integer > 0)
            self.pid = integer(card, 2, 'pid')
            assert self.pid > 0

            self.Type = string(card, 3, 'Type')
            #print("self.Type = %s" % self.Type)
            # msg = 'CHBDYP Type=%r' % self.Type
            #assert self.Type in ['POINT','LINE','ELCYL','FTUBE','TUBE'], msg

            #: A VIEW entry identification number for the front face.
            self.iViewFront = integer_or_blank(card, 4, 'iViewFront', 0)

            #: A VIEW entry identification number for the back face.
            self.iViewBack = integer_or_blank(card, 5, 'iViewBack', 0)

            #: Grid point identification numbers of grids bounding the surface.
            #: (Integer > 0)
            self.g1 = integer(card, 6, 'g1')
            #: Grid point identification numbers of grids bounding the surface.
            #: (Integer > 0)
            if self.Type != 'POINT':
                self.g2 = integer(card, 7, 'g2')
            else:
                self.g2 = blank(card, 7, 'g2')

            #: Orientation grid point. (Integer > 0; Default = 0)
            self.g0 = integer_or_blank(card, 8, 'g0', 0)

            #: RADM identification number for front face of surface element.
            #: (Integer > 0)
            self.radMidFront = integer_or_blank(card, 9, 'radMidFront', 0)

            #: RADM identification number for back face of surface element.
            #: (Integer > 0)
            self.radMidBack = integer_or_blank(card, 10, 'radMidBack', 0)

            #: Grid point identification number of a midside node if it is used
            #: with the line type surface element.
            self.gmid = integer_or_blank(card, 11, 'gmid')
            #: Coordinate system for defining orientation vector.
            #: (Integer > 0; Default = 0
            self.ce = integer_or_blank(card, 12, 'ce', 0)

            #: Components of the orientation vector in coordinate system CE.
            #: The origin of the orientation vector is grid point G1.
            #: (Real or blank)
            self.e1 = double_or_blank(card, 13, 'e3')
            self.e2 = double_or_blank(card, 14, 'e3')
            self.e3 = double_or_blank(card, 15, 'e3')
            assert len(card) <= 16, 'len(CHBDYP card) = %i' % len(card)
        else:
            raise NotImplementedError(data)
开发者ID:watkinrt,项目名称:pyNastran,代码行数:60,代码来源:thermal.py

示例4: add_card

    def add_card(cls, card, comment=''):
        m = np.zeros((6, 6))
        eid = integer(card, 1, 'eid')
        nid = integer(card, 2, 'nid')
        cid = integer_or_blank(card, 3, 'cid', 0)

        m[0, 0] = double_or_blank(card, 4, 'M11', 0.)
        m[1, 0] = double_or_blank(card, 5, 'M21', 0.)
        m[1, 1] = double_or_blank(card, 6, 'M22', 0.)
        m[2, 0] = double_or_blank(card, 7, 'M31', 0.)
        m[2, 1] = double_or_blank(card, 8, 'M32', 0.)
        m[2, 2] = double_or_blank(card, 9, 'M33', 0.)
        m[3, 0] = double_or_blank(card, 10, 'M41', 0.)
        m[3, 1] = double_or_blank(card, 11, 'M42', 0.)
        m[3, 2] = double_or_blank(card, 12, 'M43', 0.)
        m[3, 3] = double_or_blank(card, 13, 'M44', 0.)
        m[4, 0] = double_or_blank(card, 14, 'M51', 0.)
        m[4, 1] = double_or_blank(card, 15, 'M52', 0.)
        m[4, 2] = double_or_blank(card, 16, 'M53', 0.)
        m[4, 3] = double_or_blank(card, 17, 'M54', 0.)
        m[4, 4] = double_or_blank(card, 18, 'M55', 0.)
        m[5, 0] = double_or_blank(card, 19, 'M61', 0.)
        m[5, 1] = double_or_blank(card, 20, 'M62', 0.)
        m[5, 2] = double_or_blank(card, 21, 'M63', 0.)
        m[5, 3] = double_or_blank(card, 22, 'M64', 0.)
        m[5, 4] = double_or_blank(card, 23, 'M65', 0.)
        m[5, 5] = double_or_blank(card, 24, 'M66', 0.)
        assert len(card) <= 25, 'len(CONM1 card) = %i' % len(card)
        return CONM1(eid, nid, cid, m, comment=comment)
开发者ID:marcinch18,项目名称:pyNastran,代码行数:29,代码来源:mass.py

示例5: add_card

 def add_card(cls, card, comment=''):
     eid = integer(card, 1, 'eid')
     pid = integer(card, 2, 'pid')
     nids = [integer_or_blank(card, 3, 'n1', 0),
             integer_or_blank(card, 4, 'n2', 0)]
     assert len(card) <= 5, 'len(CDAMP5 card) = %i\ncard=%s' % (len(card), card)
     return CDAMP5(eid, pid, nids, comment=comment)
开发者ID:saullocastro,项目名称:pyNastran,代码行数:7,代码来源:damper.py

示例6: add_card

    def add_card(self, card, comment=''):
        assert self.n > 0, self.n
        i = self.i
        load_id = integer(card, 1, 'load_id')
        tbar = double(card, 3, 'Tbar')
        tprime = double(card, 4, 'Tprime')
        t1 = double_or_blank(card, 5, 'T1')
        t2 = double_or_blank(card, 6, 'T2')

        self.load_id[i] = load_id
        self.element_id[i] = integer(card, 2, 'element_id')
        self.tbar[i] = tbar
        self.tprime[i] = tprime
        self.temp[i, 0] = t1
        self.temp[i, 1] = t2
        self.i += 1

        if len(card) >= 7:
            # i must be < self.n
            eids = expand_thru(card[9:])
            for eid in eids:
                self.load_id[i] = load_id
                assert isinstance(eid, int), eid
                self.element_id[i] = eid
                self.tbar[i] = tbar
                self.tprime[i] = tprime
                self.temp[i, 0] = t1
                self.temp[i, 1] = t2
                self.i += 1
                assert self.i <= self.n

        assert len(card) <= 7, '%s; n=%s' % (card, len(card))
        #assert len(card) <= 7, len(card)
        self.eids = None
开发者ID:hurlei,项目名称:pyNastran,代码行数:34,代码来源:temp.py

示例7: add_card

    def add_card(cls, card, comment=''):
        sid = integer(card, 1, 'sid')
        method = string_or_blank(card, 2, 'method', 'LAN')

        f1 = double_or_blank(card, 3, 'f1')
        f2 = double_or_blank(card, 4, 'f2')
        ne = integer_or_blank(card, 5, 'ne')

        if method not in cls.allowed_methods:
            msg = 'method=%s; allowed_methods=[%s]' % (
                method, ', '.join(cls.allowed_methods))
            raise ValueError(msg)

        if method == 'SINV':
            nd = integer_or_blank(card, 6, 'nd', 600)
        if method == 'INV':
            nd = integer_or_blank(card, 6, 'nd', 3 * ne)
        elif method in ['GIV', 'MGIV', 'HOU', 'MHOU']:
            nd = integer_or_blank(card, 6, 'nd', 0)
        else:
            nd = integer(card, 6, 'nd')
        norm = string_or_blank(card, 9, 'norm', 'MASS')

        if method == 'POINT':
            G = integer(card, 10, 'G')
            C = components(card, 11, 'C')
        else:
            G = blank(card, 10, 'G')
            C = blank(card, 11, 'C')
        assert len(card) <= 12, 'len(EIGR card) = %i\ncard=%s' % (len(card), card)
        return EIGR(sid, method, f1, f2, ne, nd, norm, G, C, comment=comment)
开发者ID:EmanueleCannizzaro,项目名称:pyNastran,代码行数:31,代码来源:methods.py

示例8: add_card

 def add_card(cls, card, icard=0, comment=''):
     noffset = 2 * icard
     sid = integer(card, 1, 'sid')
     Type = string(card, 2, 'Type')
     id = integer(card, 3 + noffset, 'id')
     value = double(card, 4 + noffset, 'value')
     return NSM(sid, Type, id, value, comment=comment)
开发者ID:saullocastro,项目名称:pyNastran,代码行数:7,代码来源:mass.py

示例9: add_card

    def add_card(self, card, comment=''):
        i = self.i
        sid = integer(card, 1, 'sid')
        excite_id = integer(card, 2, 'excite_id')
        delay = integer_double_or_blank(card, 3, 'delay', 0.)
        dphase = integer_double_or_blank(card, 4, 'dphase', 0.)
        tc = integer_double_or_blank(card, 5, 'tc', 0)
        td = integer_double_or_blank(card, 6, 'td', 0)
        Type = integer_string_or_blank(card, 7, 'Type', 'LOAD')

        if Type in [0, 'L', 'LO', 'LOA', 'LOAD']:
            Type = 'LOAD'
        elif Type in [1, 'D', 'DI', 'DIS', 'DISP']:
            Type = 'DISP'
        elif Type in [2, 'V', 'VE', 'VEL', 'VELO']:
            Type = 'VELO'
        elif Type in [3, 'A', 'AC', 'ACC', 'ACCE']:
            Type = 'ACCE'
        elif Type in [5, 6, 7, 12, 13]:
            pass
        else:
            msg = 'invalid TLOAD2 type  Type=%r' % Type
            raise RuntimeError(msg)
        assert len(card) <= 13, 'len(TLOAD2 card) = %i\ncard=%s' % (len(card), card)

        self.sid[i] = sid
        self.excite_id[i] = excite_id
        if isinstance(delay, int):
            self.delay_id[i] = delay
            self.is_delay_table[i] = 1
        elif isinstance(delay, float):
            self.delay_tau[i] = delay
            self.is_delay_table[i] = 0
        else:
            raise NotImplementedError(delay)

        if isinstance(dphase, int):
            self.dphase_id[i] = dphase
            self.is_dphase_table[i] = 1
        elif isinstance(dphase, float):
            self.dphase_lead[i] = dphase
            self.is_dphase_table[i] = 0
        else:
            raise NotImplementedError(dphase)

        self.Type[i] = Type
        if isinstance(tc, int):
            self.table_c[i] = tc
        elif isinstance(tc, float):
            self.constant_c[i] = tc
        else:
            raise NotImplementedError('tc=%r' % tc)

        if isinstance(td, int):
            self.table_d[i] = td
        elif isinstance(td, float):
            self.constant_d[i] = td
        else:
            raise NotImplementedError('tc=%r' % tc)
        self.i += 1
开发者ID:hurlei,项目名称:pyNastran,代码行数:60,代码来源:rload1.py

示例10: add_card

 def add_card(cls, card, comment=''):
     conid = integer(card, 1, 'conid')
     rid = integer(card, 2, 'rid')
     hid = integer(card, 3, 'hid')
     c = components(card, 4, 'c')
     d = double(card, 5, 'd')
     return SPCAX(conid, rid, hid, c, d, comment=comment)
开发者ID:hurlei,项目名称:pyNastran,代码行数:7,代码来源:constraints.py

示例11: add_card

    def add_card(self, card, comment=''):
        #self.model.log.debug('chexa8-add')
        i = self.i
        #comment = self._comments[i]
        eid = integer(card, 1, 'element_id')

        if comment:
            self.set_comment(eid, comment)

        #: Element ID
        self.element_id[i] = eid
        #: Property ID
        self.property_id[i] = integer(card, 2, 'property_id')
        #: Node IDs
        nids = array([
            integer(card, 3, 'node_id_1'),
            integer(card, 4, 'node_id_2'),
            integer(card, 5, 'node_id_3'),
            integer(card, 6, 'node_id_4'),
            integer(card, 7, 'node_id_5'),
            integer(card, 8, 'node_id_6'),
            integer(card, 9, 'node_id_7'),
            integer(card, 10, 'node_id_8')
        ], dtype='int32')
        assert 0 not in nids, '%s\n%s' % (nids, card)
        self.node_ids[i, :] = nids
        assert len(card) == 11, 'len(CHEXA8 card) = %i\ncard=%s' % (len(card), card)
        self.i += 1
开发者ID:saullocastro,项目名称:pyNastran,代码行数:28,代码来源:chexa8.py

示例12: add_card

    def add_card(cls, card, comment=''):
        eid = integer(card, 1, 'eid')
        pid = integer_or_blank(card, 2, 'pid', eid)
        ga = integer(card, 3, 'ga')
        gb = integer(card, 4, 'gb')
        x1_g0 = integer_double_or_blank(card, 5, 'x1_g0', 0.0)
        if isinstance(x1_g0, integer_types):
            g0 = x1_g0
            x = None
        elif isinstance(x1_g0, float):
            g0 = None
            x = np.array([double_or_blank(card, 5, 'x1', 0.0),
                          double_or_blank(card, 6, 'x2', 0.0),
                          double_or_blank(card, 7, 'x3', 0.0)], dtype='float64')
            if norm(x) == 0.0:
                msg = 'G0 vector defining plane 1 is not defined.\n'
                msg += 'G0 = %s\n' % g0
                msg += 'X  = %s\n' % x
                raise RuntimeError(msg)
        else:
            raise ValueError('invalid x1Go=%r on CBEND' % x1_g0)
        geom = integer(card, 8, 'geom')

        assert len(card) == 9, 'len(CBEND card) = %i\ncard=%s' % (len(card), card)
        return CBEND(eid, pid, ga, gb, g0, x, geom, comment=comment)
开发者ID:hurlei,项目名称:pyNastran,代码行数:25,代码来源:bars.py

示例13: add_card

 def add_card(cls, card, comment=''):
     eid = integer(card, 1, 'eid')
     pid = integer_or_blank(card, 2, 'pid', eid)
     nids = [integer(card, 3, 'n1'),
             integer(card, 4, 'n2')]
     assert len(card) == 5, 'len(CTUBE card) = %i' % len(card)
     return CTUBE(eid, pid, nids, comment=comment)
开发者ID:marcinch18,项目名称:pyNastran,代码行数:7,代码来源:rods.py

示例14: add

    def add(self, card, comment=''):
        i = self.i
        self.property_id[i] = integer(card, 1, 'property_id')
        self.material_id[i] = integer(card, 2, 'material_id')
        self.area[i] = double_or_blank(card, 3, 'area', 0.0)
        self.I1[i] = double_or_blank(card, 4, 'I1', 0.0)
        self.I2[i] = double_or_blank(card, 5, 'I2', 0.0)

        #: .. todo:: support SOL 600 default
        Jdefault = 0.5 * (self.I1[i] + self.I2[i])
        self.J[i] = double_or_blank(card, 6, 'J', Jdefault)
        self.nsm[i] = double_or_blank(card, 7, 'non-structural_mass', 0.0)

        if 0:
            self.C1 = double_or_blank(card, 9, 'C1', 0.0)
            self.C2 = double_or_blank(card, 10, 'C2', 0.0)
            self.D1 = double_or_blank(card, 11, 'D1', 0.0)
            self.D2 = double_or_blank(card, 12, 'D2', 0.0)
            self.E1 = double_or_blank(card, 13, 'E1', 0.0)
            self.E2 = double_or_blank(card, 14, 'E2', 0.0)
            self.F1 = double_or_blank(card, 15, 'F1', 0.0)
            self.F2 = double_or_blank(card, 16, 'F2', 0.0)

            #: default=infinite; assume 1e8
            self.K1 = double_or_blank(card, 17, 'K1', 1e8)
            #: default=infinite; assume 1e8
            self.K2 = double_or_blank(card, 18, 'K2', 1e8)
            #: I12 -> use I12()
            self.i12 = double_or_blank(card, 19, 'I12', 0.0)
            if self.A == 0.0 and self.i12 == 0.0:
                assert self.K1 is None, 'K1 must be blank if A=0.0 and I12=0.0; A=%r I12=%r K1=%r' % (self.A, self.i12, self.K1)
                assert self.K2 is None, 'K2 must be blank if A=0.0 and I12=0.0; A=%r I12=%r K2=%r' % (self.A, self.i12, self.K2)
            assert len(card) <= 20, 'len(PBAR card) = %i' % len(card)

        self.i += 1
开发者ID:marcinch18,项目名称:pyNastran,代码行数:35,代码来源:pbar.py

示例15: __init__

    def __init__(self, card, nCoord, data, comment):
        Coord.__init__(self, card, data, comment)
        self.is_resolved = False
        if nCoord is not None:
            assert nCoord in (0, 1), 'nCoord=%r' % (nCoord)
            nCoord *= 4  # 0 if the 1st coord, 4 if the 2nd

            #: the coordinate ID
            self.cid = integer(card, 1 + nCoord, 'cid')
            #: a Node at the origin
            self.g1 = integer(card, 2 + nCoord, 'g1')
            #: a Node on the z-axis
            self.g2 = integer(card, 3 + nCoord, 'g2')
            #: a Node on the xz-plane
            self.g3 = integer(card, 4 + nCoord, 'g3')
        else:
            self.cid = data[0]
            self.g1 = data[1]
            self.g2 = data[2]
            self.g3 = data[3]
            assert len(data) == 4, 'data = %s' % (data)

        assert self.g1 != self.g2
        assert self.g1 != self.g3
        assert self.g2 != self.g3

        self.e1 = None
        self.e2 = None
        self.e3 = None
        self.i = None
        self.j = None
        self.k = None
开发者ID:hurlei,项目名称:pyNastran,代码行数:32,代码来源:coordinate_systems.py


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