• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python assign_type.double函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: add_card

    def add_card(self, card, comment=''):
        i = self.i

        mid = integer(card, 1, 'mid')
        if comment:
            self.set_comment(mid, comment)

        self.material_id[i] = mid
        self.e11[i] = double(card, 2, 'E11')    #: .. todo:: is this the correct default
        self.e22[i] = double(card, 3, 'E22')    #: .. todo:: is this the correct default
        self.nu12[i] = double_or_blank(card, 4, 'nu12', 0.0)

        self.g12[i] = double_or_blank(card, 5, 'g12', 0.0)
        self.g1z[i] = double_or_blank(card, 6, 'g1z', 1e8)
        self.g2z[i] = double_or_blank(card, 7, 'g2z', 1e8)
        self.rho[i] = double_or_blank(card, 8, 'rho', 0.0)
        self.a1[i] = double_or_blank(card, 9, 'a1', 0.0)
        self.a2[i] = double_or_blank(card, 10, 'a2', 0.0)
        self.TRef[i] = double_or_blank(card, 11, 'TRef', 0.0)
        self.Xt[i] = double_or_blank(card, 12, 'Xt', 0.0)
        self.Xc[i] = double_or_blank(card, 13, 'Xc', self.Xt[i])
        self.Yt[i] = double_or_blank(card, 14, 'Yt', 0.0)
        self.Yc[i] = double_or_blank(card, 15, 'Yc', self.Yt[i])
        self.S[i] = double_or_blank(card, 16, 'S', 0.0)
        self.ge[i] = double_or_blank(card, 17, 'ge', 0.0)
        self.F12[i] = double_or_blank(card, 18, 'F12', 0.0)
        self.strn[i] = double_or_blank(card, 19, 'strn', 0.0)
        assert len(card) <= 20, 'len(MAT8 card) = %i\ncard=%s' % (len(card), card)
        self.i += 1
开发者ID:hurlei,项目名称:pyNastran,代码行数:29,代码来源:mat8.py


示例2: __init__

    def __init__(self, card=None, data=None, comment=''):
        Method.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Set identification number. (Unique Integer > 0)
            self.sid = integer(card, 1, 'sid')

            #: Coordinates of point in complex plane. (Real)
            self.alpha1 = double(card, 2, 'alpha1')
            #: Coordinates of point in complex plane. (Real)
            self.omega1 = double(card, 3, 'omega1')
            #: Multiplicity of complex root at pole defined by point at ALPHAi
            #: and OMEGAi
            self.m1 = integer(card, 4, 'm1')

            #: Coordinates of point in complex plane. (Real)
            self.alpha2 = double(card, 5, 'alpha2')
            #: Coordinates of point in complex plane. (Real)
            self.omega2 = double(card, 6, 'omega2')
            #: Multiplicity of complex root at pole defined by point at ALPHAi
            #: and OMEGAi
            self.m2 = integer(card, 7, 'm2')
            assert len(card) == 8, 'len(EIGP card) = %i' % len(card)
        else:
            raise NotImplementedError('EIGP')
开发者ID:watkinrt,项目名称:pyNastran,代码行数:26,代码来源:methods.py


示例3: __init__

    def __init__(self, card=None, data=None, comment=''):
        Table.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            self.tid = integer(card, 1, 'tid')
            self.x1 = double(card, 2, 'x1')
            self.x2 = double(card, 3, 'x2')
            assert self.x2 != 0.0

            nfields = len(card) - 1
            nterms = (nfields - 9) // 2
            if nterms < 0:
                raise SyntaxError('%r card is too short' % self.type)
            xy = []
            for i in range(nterms):
                n = 9 + i * 2
                if card.field(n) == 'ENDT':
                    break
                x = double_or_string(card, n, 'x' + str(i + 1))
                y = double_or_string(card, n + 1, 'y' + str(i + 1))
                if x == 'SKIP' or y == 'SKIP':
                    continue
                xy += [x, y]
            string(card, nfields, 'ENDT')
            is_data = False
        else:
            self.tid = data[0]
            self.x1 = data[1]
            self.x2 = data[2]
            xy = data[3:]
            is_data = True
        self.parse_fields(xy, nrepeated=2, is_data=is_data)
开发者ID:watkinrt,项目名称:pyNastran,代码行数:33,代码来源:bdf_tables.py


示例4: add_card

 def add_card(cls, card, comment=''):
     sid = integer(card, 1, 'sid')
     f1 = double(card, 2, 'f1')  # default=0.0 ?
     f2 = double(card, 3, 'f2')
     ndf = integer_or_blank(card, 4, 'nf', 1)
     assert len(card) <= 5, 'len(FREQ2 card) = %i\ncard=%s' % (len(card), card)
     return FREQ2(sid, f1, f2, ndf, comment=comment)
开发者ID:hurlei,项目名称:pyNastran,代码行数:7,代码来源:dynamic.py


示例5: add_card

    def add_card(cls, card, comment=''):
        mid = integer(card, 1, 'mid')
        tid = integer_or_blank(card, 2, 'tid')
        Type = string(card, 3, 'Type')

        if Type not in ['NLELAST', 'PLASTIC']:
            raise ValueError('MATS1 Type must be [NLELAST, PLASTIC]; Type=%r' % Type)
        if Type == 'NLELAST':
            # should we even read these?
            h = None
            hr = None
            yf = None
            limit1 = None
            limit2 = None
            #h = blank(card, 4, 'h')
            #hr = blank(card, 6, 'hr')
            #yf = blank(card, 5, 'yf')
            #limit1 = blank(card, 7, 'yf')
            #limit2 = blank(card, 8, 'yf')
        else:
            h = double_or_blank(card, 4, 'H')
            yf = integer_or_blank(card, 5, 'yf', 1)
            hr = integer_or_blank(card, 6, 'hr', 1)
            limit1 = double(card, 7, 'limit1')

            if yf in [3, 4]:
                limit2 = double(card, 8, 'limit2')
            else:
                #limit2 = blank(card, 8, 'limit2')
                limit2 = None
        assert len(card) <= 9, 'len(MATS1 card) = %i\ncard=%s' % (len(card), card)
        return MATS1(mid, tid, Type, h, hr, yf, limit1, limit2, comment=comment)
开发者ID:EmanueleCannizzaro,项目名称:pyNastran,代码行数:32,代码来源:material_deps.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')
        excite_id = integer(card, 2, 'excite_id') # DAREA, FBALOAD, SLOAD
        delay = integer_double_or_blank(card, 3, 'delay', 0) # DELAY, FBADLAY
        dphase = integer_double_or_blank(card, 4, 'dphase', 0) # DPHASE, FBAPHAS
        power = integer_double_or_blank(card, 5, 'power/tp/rp', 0) # TABLEDi/power
        rho = double(card, 6, 'rho')
        b = double(card, 7, 'bulk modulus')

        assert len(card) <= 8, 'len(ACSRCE card) = %i\n%s' % (len(card), card)
        return ACSRCE(sid, excite_id, delay, dphase, power, rho, b, comment=comment)
开发者ID:EmanueleCannizzaro,项目名称:pyNastran,代码行数:11,代码来源:dloads.py


示例8: add

    def add(self, card=None, comment=''):
        if comment:
            self._comment = comment
        i = self.i
        #: Identification number of a MAT1, MAT2, or MAT9 entry.
        self.material_id[i] = integer(card, 1, 'mid')
        #: Identification number of a TABLES1 or TABLEST entry. If H is
        #: given, then this field must be blank.
        self.table_id[i] = integer_or_blank(card, 2, 'tid', 0)
        #: Type of material nonlinearity. ('NLELAST' for nonlinear elastic
        #: or 'PLASTIC' for elastoplastic.)
        self.Type[i] = string(card, 3, 'Type')

        if self.Type[i] == 'NLELAST':
            self.h[i] = blank(card, 4, 'h')
            self.hr[i] = blank(card, 6, 'hr')
            self.yf[i] = blank(card, 5, 'yf')
            self.limit1[i] = blank(card, 7, 'yf')
            self.limit2[i] = blank(card, 8, 'yf')
        else:
            #: Work hardening slope (slope of stress versus plastic strain) in
            #: units of stress. For elastic-perfectly plastic cases, H=0.0.
            #: For more than a single slope in the plastic range, the
            #: stress-strain data must be supplied on a TABLES1 entry
            #: referenced by TID, and this field must be blank
            h = double_or_blank(card, 4, 'H')
            self.h[i] = h
            if h is None:
                self.hflag[i] = False
            else:
                self.hflag[i] = True

            #: Yield function criterion, selected by one of the following
            #: values (1) Von Mises (2) Tresca (3) Mohr-Coulomb
            #: (4) Drucker-Prager
            self.yf[i] = integer_or_blank(card, 5, 'yf', 1)

            #: Hardening Rule, selected by one of the following values
            #: (Integer): (1) Isotropic (Default) (2) Kinematic
            #: (3) Combined isotropic and kinematic hardening
            self.hr[i] = integer_or_blank(card, 6, 'hr', 1)
            #: Initial yield point
            self.limit1[i] = double(card, 7, 'limit1')

            if self.yf[i] == 3 or self.yf[i] == 4:
                #: Internal friction angle, measured in degrees, for the
                #: Mohr-Coulomb and Drucker-Prager yield criteria
                self.limit2[i] = double(card, 8, 'limit2')
            else:
                #self.limit2[i] = blank(card, 8, 'limit2')
                #self.limit2[i] = None
                pass
        assert len(card) <= 9, 'len(MATS1 card) = %i\ncard=%s' % (len(card), card)
        self.i += 1
开发者ID:EmanueleCannizzaro,项目名称:pyNastran,代码行数:54,代码来源:mats1.py


示例9: add_card

    def add_card(cls, card, comment=''):
        sid = integer(card, 1, 'sid')

        alpha1 = double(card, 2, 'alpha1')
        omega1 = double(card, 3, 'omega1')
        m1 = integer(card, 4, 'm1')

        alpha2 = double(card, 5, 'alpha2')
        omega2 = double(card, 6, 'omega2')
        m2 = integer(card, 7, 'm2')
        assert len(card) == 8, 'len(EIGP card) = %i\ncard=%s' % (len(card), card)
        return EIGP(sid, alpha1, omega1, m1, alpha2, omega2, m2, comment=comment)
开发者ID:EmanueleCannizzaro,项目名称:pyNastran,代码行数:12,代码来源:methods.py


示例10: __init__

    def __init__(self, card=None, data=None, comment=''):
        if comment:
            self._comment = comment
        self.sid = integer(card, 1, 'sid')
        f1 = double(card, 2, 'f1')  # default=0.0 ?
        f2 = double(card, 3, 'f2')
        nf = integer_or_blank(card, 4, 'nf', 1)
        assert len(card) <= 5, 'len(FREQ2 card) = %i' % len(card)

        d = 1. / nf * log(f2 / f1)
        self.freqs = []
        for i in range(nf):
            self.freqs.append(f1 * exp(i * d))  # 0 based index
        self.clean_freqs()
开发者ID:watkinrt,项目名称:pyNastran,代码行数:14,代码来源:dynamic.py


示例11: add_card

    def add_card(cls, card, comment=''):
        sid = integer(card, 1, 'sid')
        scale = double(card, 2, 'scale')

        scale_factors = []
        load_ids = []

        # alternating of scale factor & load set ID
        nloads = len(card) - 3
        assert nloads % 2 == 0
        for i in range(nloads // 2):
            n = 2 * i + 3
            scale_factors.append(double(card, n, 'scale_factor'))
            load_ids.append(integer(card, n + 1, 'load_id'))
        return cls(sid, scale, scale_factors, load_ids, comment=comment)
开发者ID:saullocastro,项目名称:pyNastran,代码行数:15,代码来源:loads.py


示例12: __init__

    def __init__(self, card, comment=''):
        self.pid = integer(card, 1, 'property_id')
        self.sets = []
        self.Types = []
        self.gammas = []
        self._cps = []
        #self.set = integer(card, 2, 'set_id')
        #self.Type = string(card, 3, 'Type')
        #if self.Type not in ['NEWTON','PRANDTL-MEYER', 'CP']:
        #    raise RuntimeError('Type=%r' % Type)
        #self.gamma = double_or_blank(card, 4, 'gamma', 1.4)

        i = 2
        while i < len(card):
            self.sets.append(integer(card, i, 'set_id'))
            Type = string(card, i+1, 'Type')
            self.Types.append(Type)
            #if self.Type not in ['NEWTON','PRANDTL-MEYER', 'CP']:
                #raise RuntimeError('Type=%r' % Type)
            self.gammas.append(double_or_blank(card, i+2, 'gamma', 1.4))

            _cp = None
            if Type == 'CP':
                _cp = double(card, i+3, 'Cp')
            elif Type == 'NEWTON':
                _cp = double_or_blank(card, i+3, 'Cp_nominal', 2.0)
            self._cps.append(_cp)
            i += 7
开发者ID:FrankNaets,项目名称:pyNastran,代码行数:28,代码来源:cards.py


示例13: add_card

    def add_card(cls, card, comment=''):
        conid = integer(card, 1, 'conid')
        gids = []
        constraints = []
        enforced = []

        fields = card.fields(0)
        nfields = len(fields)

        i = 1
        for ifield in range(2, nfields, 8):
            grid = integer(card, ifield, 'G%i' % i)
            component = components_or_blank(card, ifield + 1, 'constraint%i' % i, 0)  # scalar point
            if i == 1:
                enforcedi = double(card, ifield + 2, 'enforced%i' % i)
                if enforcedi == 0.0:
                    raise RuntimeError('enforced1 must be nonzero; enforcedi=%r' % enforcedi)
            else:
                enforcedi = double_or_blank(card, ifield + 2, 'enforced%i' % i, 0.0)
            gids.append(grid)
            constraints.append(component)
            enforced.append(enforcedi)
            i += 1

            if ifield + 4 > nfields and i != 2:
                # if G2 is empty (it's ifield+4 because nfields is length based and not loop friendly)
                break
            grid = integer(card, ifield + 3, 'G%i' % i)
            component = components_or_blank(card, ifield + 4, 'constraint%i' % i, 0)  # scalar point
            enforcedi = double_or_blank(card, ifield + 5, 'enforced%i' % i)
            gids.append(grid)
            constraints.append(component)
            enforced.append(enforcedi)
            i += 1
        return MPC(conid, gids, constraints, enforced, comment=comment)
开发者ID:marcinch18,项目名称:pyNastran,代码行数:35,代码来源:constraints.py


示例14: 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


示例15: _read_shock

    def _read_shock(self, card, istart):
        """
        F(u, v) = Cv * S(u) * sign(v) * |v|^ev
        """
        self.shockType = string_or_blank(card, istart + 1, 'shockType')
        self.shockCVT = double(card, istart + 2, 'shockCVT')
        self.shockCVC = double_or_blank(card, istart + 3, 'shockCVC')
        self.shockExpVT = double_or_blank(card, istart + 4, 'shockExpVT', 1.0)
        self.shockExpVC = double_or_blank(card, istart + 5,
                                          'shockExpVC', self.shockExpVT)

        if self.shockType == 'TABLE':
            pass
            # self.shockIDTS = integer(card, istart + 6, 'shockIDTS')
            # self.shockIDETS = blank(card, istart + 9, 'shockIDETS')
            # self.shockIDECS = blank(card, istart + 10, 'shockIDECS')
            # self.shockIDETSD = blank(card, istart + 11, 'shockIDETSD')
            # self.shockIDECSD = blank(card, istart + 12, 'shockIDECSD')
        elif self.shockType == 'EQUAT':
            self.shockIDTS = blank(card, istart + 6, 'shockIDTS')
            self.shockIDETS = integer(card, istart + 9, 'shockIDETS')
            self.shockIDECS = integer_or_blank(card, istart + 10,
                                               'shockIDECS', self.shockIDETS)
            self.shockIDETSD = integer(card, istart + 11, 'shockIDETSD')
            self.shockIDECSD = integer_or_blank(card, istart + 11,
                                                'shockIDECSD', self.shockIDETSD)

            #def DEquation(self):
                #if isinstance(self.dequation, int):
                    #return self.dequation
                #return self.dequation.equation_id
        else:
            raise RuntimeError('Invalid shockType=%r on card\n%s' %(self.shockType, card))
        istart += 8
        return istart
开发者ID:marcinch18,项目名称:pyNastran,代码行数:35,代码来源:bush.py


示例16: add_card

 def add_card(cls, card, comment=''):
     eid = integer(card, 1, 'eid')
     k = double(card, 2, 'k')
     s1 = integer_or_blank(card, 3, 's1', 0)
     s2 = integer_or_blank(card, 4, 's2', 0)
     assert len(card) <= 5, 'len(CELAS4 card) = %i\ncard=%s' % (len(card), card)
     return CELAS4(eid, k, s1, s2, comment=comment)
开发者ID:hurlei,项目名称:pyNastran,代码行数:7,代码来源:springs.py


示例17: add_card

 def add_card(cls, card, icard=0, comment=''):
     noffset = icard * 5
     pid = integer(card, 1 + noffset, 'pid')
     k = double(card, 2 + noffset, 'k')
     ge = double_or_blank(card, 3 + noffset, 'ge', 0.)
     s = double_or_blank(card, 4 + noffset, 's', 0.)
     return PELAS(pid, k, ge, s, comment=comment)
开发者ID:marcinch18,项目名称:pyNastran,代码行数:7,代码来源:springs.py


示例18: add_tempd

 def add_tempd(self, card, comment):
     assert (len(card) - 1) % 2 == 0, card
     for i in range(1, len(card), 2):
         temp_id = integer(card, i, 'temp_id')
         temperature = double(card, i+1, 'temperature')
         self._objs[temp_id].add_default(temp_id, temperature, comment)
     self.model.log.debug('TEMPs keys=%s' % self._objs.keys())
开发者ID:hurlei,项目名称:pyNastran,代码行数:7,代码来源:temp.py


示例19: add_card

    def add_card(self, card, comment=''):
        pid = integer(card, 1, 'property_id')
        if comment:
            self.set_comment(pid, comment)
        i = self.i
        self.property_id[i] = pid
        self.thickness[i] = double(card, 3, 'thickness')

        self.twelveIt3[i] = double_or_blank(card, 5, '12*I/t^3', 1.0)
        self.tst[i] = double_or_blank(card, 7, 'ts/t', 0.833333)
        self.nsm[i] = double_or_blank(card, 8, 'nsm', 0.0)

        t_over_2 = self.thickness[i] / 2.
        self.z1[i] = double_or_blank(card, 9, 'z1', -t_over_2)
        self.z2[i] = double_or_blank(card, 10, 'z2', t_over_2)
        self.material_ids[i, :] = [
            integer(card, 2, 'material_id'),
            integer_or_blank(card, 4, 'material_id2', -1),
            integer_or_blank(card, 6, 'material_id3', -1),
            integer_or_blank(card, 11, 'material_id4', -1)
        ]
        #self.model.log.debug(self.material_ids[i, :])

        #ii = np.array([i])
        #file_obj = StringIO()
        #file_obj.write('<PSHELL object> n=%s\n' % self.n)
        #self.write_card_by_index(file_obj, i=ii)
        #print(file_obj.getvalue())


        assert len(card) <= 12, 'len(PSHELL card) = %i\ncard=%s' % (len(card), card)
        self.i += 1
开发者ID:hurlei,项目名称:pyNastran,代码行数:32,代码来源:pshell.py


示例20: build

    def build(self):
        """
        :param cards: the list of MOMENT cards
        """
        cards = self._cards
        ncards = len(cards)
        self.n = ncards
        if ncards:
            float_fmt = self.model.float
            #: Property ID
            self.load_id = zeros(ncards, 'int32')
            self.node_id = zeros(ncards, 'int32')
            self.coord_id = zeros(ncards, 'int32')
            self.mag = zeros(ncards, float_fmt)
            self.xyz = zeros((ncards, 3), float_fmt)

            for i, card in enumerate(cards):
                self.load_id[i] = integer(card, 1, 'sid')
                self.node_id[i] = integer(card, 2, 'node')
                self.coord_id[i] = integer_or_blank(card, 3, 'cid', 0)
                self.mag[i] = double(card, 4, 'mag')
                xyz = [double_or_blank(card, 5, 'X1', 0.0),
                       double_or_blank(card, 6, 'X2', 0.0),
                       double_or_blank(card, 7, 'X3', 0.0)]
                self.xyz[i] = xyz
                assert len(card) <= 8, 'len(MOMENT card) = %i\ncard=%s' % (len(card), card)

            i = self.load_id.argsort()
            self.load_id = self.load_id[i]
            self.node_id = self.node_id[i]
            self.coord_id = self.coord_id[i]
            self.mag = self.mag[i]
            self.xyz = self.xyz[i]
            self._cards = []
            self._comments = []
开发者ID:EmanueleCannizzaro,项目名称:pyNastran,代码行数:35,代码来源:moment.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python assign_type.double_or_blank函数代码示例发布时间:2022-05-25
下一篇:
Python assign_type.components_or_blank函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap