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

Python assign_type.string_or_blank函数代码示例

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

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



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

示例1: __init__

    def __init__(self, card=None, data=None, comment=''):
        """
        Intilizes the CORD3G

        :param self: the CORD3G coordinate system object
        :param card: a list version of the fields
        """
        if comment:
            self._comment = comment

        Coord.__init__(self, card, data)

        self.cid = integer(card, 1, 'cid')
        method = string_or_blank(card, 2, 'E313')
        self.methodES = method[0]
        self.methodInt = int(method[1:])
        assert self.methodES in ['E', 'S'] # Euler / Space-Fixed
        assert 0 < self.methodInt < 1000

        self.form = string_or_blank(card, 3, 'form', 'EQN')
        self.thetas = [integer(card, 4, 'theta1'),
                       integer(card, 5, 'theta2'),
                       integer(card, 6, 'theta3')]
        assert len(self.thetas) == 3, 'thetas=%s' % (self.thetas)
        self.rid = integer_or_blank(card, 7, 'cidRef')
        assert len(card) <= 8, 'len(CORD3G card) = %i' % len(card)

        # EQN for DEQATN, TABLE for TABLE3D
        assert self.form in ['EQN', 'TABLE']
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:29,代码来源:coordinateSystems.py


示例2: __init__

    def __init__(self, card=None, data=None, comment=''):
        if comment:
            self._comment = comment
        if card:
            #: CRID Contact region ID. (Integer > 0)
            self.crid = integer(card, 1, 'crid')

            #: SURF Indicates the contact side. See Remark 1. (Character = "TOP" or
            #: "BOT"; Default = "TOP")
            self.surf = string_or_blank(card, 2, 'surf', 'TOP')

            #: Offset distance for the contact region. See Remark 2. (Real > 0.0,
            #: Default =OFFSET value in BCTPARA entry)
            self.offset = double_or_blank(card, 3, 'offset')

            #: Indicates whether a contact region is a rigid surface if it is used as a
            #: target region. See Remarks 3 and 4. (Character = "RIGID" or "FLEX",
            #: Default = "FLEX"). This is not supported for SOL 101.
            self.Type = string_or_blank(card, 4, 'type', 'FLEX')

            #: Master grid point for a target contact region with TYPE=RIGID or
            #: when the rigid-target algorithm is used. The master grid point may be
            #: used to control the motion of a rigid surface. (Integer > 0,; Default = 0)
            #: This is not supported for SOL 101.
            self.mgp = integer_or_blank(card, 5, 'mpg', 0)
        else:
            msg = '%s has not implemented data parsing' % self.type
            raise NotImplementedError(msg)
开发者ID:HibernantBear,项目名称:pyNastran,代码行数:28,代码来源:contact.py


示例3: __init__

    def __init__(self, card=None, data=None, comment=''):
        if comment:
            self._comment = comment
        if card:
            self.nid = integer(card, 1, 'nid')
            self.ninc = integer_or_blank(card, 2, 'ninc', 10)
            self.dt = double_or_blank(card, 3, 'dt', 0.0)
            self.kMethod = string_or_blank(card, 4, 'kMethod', 'AUTO')
            self.kStep = integer_or_blank(card, 5, 'kStep', 5)
            self.maxIter = integer_or_blank(card, 6, 'maxIter', 25)
            self.conv = string_or_blank(card, 7, 'conv', 'PW')
            self.intOut = string_or_blank(card, 8, 'intOut', 'NO')

            # line 2
            self.epsU = double_or_blank(card, 9, 'epsU', 0.01)
            self.epsP = double_or_blank(card, 10, 'epsP', 0.01)
            self.epsW = double_or_blank(card, 11, 'epsW', 0.01)
            self.maxDiv = integer_or_blank(card, 12, 'maxDiv', 3)

            if self.kMethod == 'PFNT':
                self.maxQn = integer_or_blank(card, 13, 'maxQn', 0)
            else:
                self.maxQn = integer_or_blank(card, 13, 'maxQn', self.maxIter)

            self.maxLs = integer_or_blank(card, 14, 'maxLs', 4)
            self.fStress = double_or_blank(card, 15, 'fStress', 0.2)
            self.lsTol = double_or_blank(card, 16, 'lsTol', 0.5)

            # line 3
            self.maxBisect = integer_or_blank(card, 17, '', 5)
            self.maxR = double_or_blank(card, 21, 'maxR', 20.)
            self.rTolB = double_or_blank(card, 23, 'rTolB', 20.)
            assert len(card) <= 24, 'len(NLPARM card) = %i' % len(card)
        else:
            (sid, ninc, dt, kMethod, kStep, maxIter, conv, intOut, epsU, epsP,
             epsW, maxDiv, maxQn, maxLs, fStress, lsTol, maxBisect, maxR,
             rTolB) = data
            self.nid = sid
            self.ninc = ninc
            self.dt = dt
            self.kMethod = kMethod
            self.kStep = kStep
            self.maxIter = maxIter
            self.conv = conv
            self.intOut = intOut

            # line 2
            self.epsU = epsU
            self.epsP = epsP
            self.epsW = epsW
            self.maxDiv = maxDiv
            self.maxQn = maxQn
            self.maxLs = maxLs
            self.fStress = fStress
            self.lsTol = lsTol

            # line 3
            self.maxBisect = maxBisect
            self.maxR = maxR
            self.rTolB = rTolB
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:60,代码来源:dynamic.py


示例4: __init__

    def __init__(self, card=None, data=None, comment=''):
        RandomTable.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            self.tid = integer(card, 1, 'tid')
            self.xaxis = string_or_blank(card, 2, 'xaxis', 'LINEAR')
            self.yaxis = string_or_blank(card, 3, 'yaxis', 'LINEAR')

            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(card, n, 'x' + str(i + 1))
                y = double(card, n + 1, 'y' + str(i + 1))
                xy += [x, y]
            string(card, nfields, 'ENDT')
            isData = False
        else:
            self.tid = data[0]
            self.xaxis = self.map_axis(data[1])
            self.yaxis = self.map_axis(data[2])
            xy = data[3:]
            isData = True
        assert self.xaxis in ['LINEAR', 'LOG'], 'xaxis=|%s|' % (self.xaxis)
        assert self.yaxis in ['LINEAR', 'LOG'], 'yaxis=|%s|' % (self.yaxis)
        self.parse_fields(xy, nrepeated=2, isData=isData)
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:32,代码来源:bdf_tables.py


示例5: add

    def add(self, card=None, comment=''):
        if comment:
            self._comment = comment

        self.nlparm_id = integer(card, 1, 'nlparm_id')
        self.ninc = integer_or_blank(card, 2, 'ninc', 10)
        self.dt = double_or_blank(card, 3, 'dt', 0.0)
        self.kMethod = string_or_blank(card, 4, 'kMethod', 'AUTO')
        self.kStep = integer_or_blank(card, 5, 'kStep', 5)
        self.maxIter = integer_or_blank(card, 6, 'maxIter', 25)
        self.conv = string_or_blank(card, 7, 'conv', 'PW')
        self.intOut = string_or_blank(card, 8, 'intOut', 'NO')

        # line 2
        self.epsU = double_or_blank(card, 9, 'epsU', 0.01)
        self.epsP = double_or_blank(card, 10, 'epsP', 0.01)
        self.epsW = double_or_blank(card, 11, 'epsW', 0.01)
        self.maxDiv = integer_or_blank(card, 12, 'maxDiv', 3)

        if self.kMethod == 'PFNT':
            self.maxQn = integer_or_blank(card, 13, 'maxQn', 0)
        else:
            self.maxQn = integer_or_blank(card, 13, 'maxQn', self.maxIter)

        self.maxLs = integer_or_blank(card, 14, 'maxLs', 4)
        self.fStress = double_or_blank(card, 15, 'fStress', 0.2)
        self.lsTol = double_or_blank(card, 16, 'lsTol', 0.5)

        # line 3
        self.maxBisect = integer_or_blank(card, 17, '', 5)
        self.maxR = double_or_blank(card, 21, 'maxR', 20.)
        self.rTolB = double_or_blank(card, 23, 'rTolB', 20.)
        assert len(card) <= 24, 'len(NLPARM card) = %i' % len(card)
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:33,代码来源:nlparm.py


示例6: __init__

    def __init__(self, card=None, data=None, comment=''):
        if comment:
            self._comment = comment
        if card:
            self.sid = integer(card, 1, 'sid')
            self.eid = integer(card, 2, 'eid')
            p1 = double_or_blank(card, 3, 'p1', 0.0)
            p = [p1,
                 double_or_blank(card, 4, 'p2', p1),
                 double_or_blank(card, 5, 'p3', p1),
                 double_or_blank(card, 6, 'p4', p1)]
            self.pressures = p

            self.eids = [self.eid]
            if (integer_string_or_blank(card, 7, 'g1/THRU') == 'THRU' and
                integer_or_blank(card, 8, 'eid2')):  # plates
                eid2 = integer(card, 8, 'eid2')
                if eid2:
                    self.eids = expand_thru([self.eid, 'THRU', eid2])

                self.g1 = None
                self.g34 = None
            else:
                #: used for CPENTA, CHEXA
                self.eids = [self.eid]
                #: used for solid element only
                self.g1 = integer_or_blank(card, 7, 'g1')
                #: g3/g4 - different depending on CHEXA/CPENTA or CTETRA
                self.g34 = integer_or_blank(card, 8, 'g34')

            #: Coordinate system identification number. See Remark 2.
            #: (Integer >= 0;Default=0)
            self.cid = integer_or_blank(card, 9, 'cid', 0)
            #print "PLOAD4 cid = ",self.cid
            self.NVector = array([double_or_blank(card, 10, 'N1', 0.0),
                                  double_or_blank(card, 11, 'N2', 0.0),
                                  double_or_blank(card, 12, 'N3', 0.0)])
            self.sorl = string_or_blank(card, 13, 'sorl', 'SURF')
            self.ldir = string_or_blank(card, 14, 'ldir', 'NORM')
            assert len(card) <= 15, 'len(PLOAD4 card) = %i' % len(card)
        else:
            #print "PLOAD4 = ",data
            self.sid = data[0]
            self.eid = data[1]
            self.pressures = data[2]

            self.g1 = data[3]
            self.g34 = data[4]
            self.cid = data[5]
            self.NVector = data[6]

            self.sorl = data[7]
            #self.ldir = data[8]
            #assert len(data)==8

            self.g1 = self.g1
            self.g34 = self.g34
            self.eids = [self.eid]
开发者ID:anick107,项目名称:von_mises_rms,代码行数:58,代码来源:staticLoads.py


示例7: __init__

    def __init__(self, card=None, data=None, sol=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')
            #: For vibration analysis: frequency range of interest. For
            #: buckling analysis: eigenvalue range of interest. See Remark 4.
            #: (Real or blank, -5 10e16 <= V1 < V2 <= 5.10e16)
            self.v1 = double_or_blank(card, 2, 'v1')
            self.v2 = double_or_blank(card, 3, 'v2')
            #: Number of roots desired
            self.nd = integer_or_blank(card, 4, 'nd')
            #: Diagnostic level. (0 < Integer < 4; Default = 0)
            self.msglvl = integer_or_blank(card, 5, 'msglvl', 0)
            #: Number of vectors in block or set. Default is machine dependent
            self.maxset = integer_or_blank(card, 6, 'maxset')
            #: Estimate of the first flexible mode natural frequency
            #: (Real or blank)
            self.shfscl = double_or_blank(card, 7, 'shfscl')
            #: Method for normalizing eigenvectors (Character: 'MASS' or 'MAX')
            self.norm = string_or_blank(card, 8, 'norm')

            optionValues = [interpret_value(field) for field in card[9:] ]
            self.options = []
            self.values = []
            #print "optionValues = ",optionValues
            for optionValue in optionValues:
                #print "optionValue = ",optionValue
                (option, value) = optionValue.split('=')
                self.options.append(option)
                self.values.append(value)

            #: Method for normalizing eigenvectors
            if sol in [103, 115, 146]:
                # normal modes,cyclic normal modes, flutter
                self.norm = string_or_blank(card, 8, 'norm', 'MASS')
            elif sol in [105, 110, 111, 116]:
                # buckling, modal complex eigenvalues,
                # modal frequency response,cyclic buckling
                self.norm = string_or_blank(card, 8, 'norm', 'MAX')
            else:
                self.norm = string_or_blank(card, 8, 'norm')

            #assert len(card) <= 9, 'len(EIGRL card) = %i' % len(card)
            assert len(card) <= 10, 'len(EIGRL card) = %i' % len(card)

            #msg = 'norm=%s sol=%s' % (self.norm, sol)
            #assert self.norm in ['MASS', 'MAX'],msg
            #assert card.nFields()<9,'card = %s' %(card.fields(0))
        else:
            raise NotImplementedError('EIGRL')
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:53,代码来源:methods.py


示例8: __init__

    def __init__(self, card=None, data=None, comment=''):
        IntegratedLineProperty.__init__(self, card, data)
        if comment:
            self._comment = comment

        if card:
            #: Property ID
            self.pid = integer(card, 1, 'pid')
            #: Material ID
            self.mid = integer(card, 2, 'mid')
            self.group = string_or_blank(card, 3, 'group', 'MSCBMLO')
            #: Section Type (e.g. 'ROD', 'TUBE', 'I', 'H')
            self.Type = string(card, 4, 'Type')

            # determine the number of required dimensions on the PBEAM
            ndim = self.validTypes[self.Type]
            #nAll = ndim + 1

            #: dimension list
            self.dim = []
            Dim = []

            #: Section position
            self.xxb = [0.]

            #: Output flag
            self.so = ['YES']

            #: non-structural mass :math:`nsm`
            self.nsm = []

            i = 9
            n = 0
            while i < len(card):
                if n > 0:
                    so = string_or_blank(card, i, 'so_n=%i' % n, 'YES')
                    xxb = double_or_blank(card, i + 1, 'xxb_n=%i' % n, 1.0)
                    self.so.append(so)
                    self.xxb.append(xxb)
                    i += 2

                Dim = []
                for ii in range(ndim):
                    dim = double(card, i, 'dim_n=%i_ii=%i' % (n, ii))
                    Dim.append(dim)
                    i += 1
                self.dim.append(Dim)

                nsm = double_or_blank(card, i, 'nsm_n=%i' % n, 0.0)
                self.nsm.append(nsm)
                n += 1
                i += 1
开发者ID:HibernantBear,项目名称:pyNastran,代码行数:52,代码来源:beam.py


示例9: __init__

    def __init__(self, card=None, data=None, comment=''):
        ShellProperty.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            self.pid = integer(card, 1, 'pid')
            # z0 will be calculated later
            self.nsm = double_or_blank(card, 3, 'nsm', 0.0)
            self.sb = double_or_blank(card, 4, 'sb', 0.0)
            self.ft = string_or_blank(card, 5, 'ft')
            assert self.ft in ['HILL', 'HOFF', 'TSAI', 'STRN', None]
            self.TRef = double_or_blank(card, 6, 'TRef', 0.0)
            self.ge = double_or_blank(card, 7, 'ge', 0.0)
            self.lam = string_or_blank(card, 8, 'lam')
            fields = card.fields(9)

            T = 0.  # thickness
            midLast = None
            tLast = None
            self.plies = []

            i = 0
            #n = 0
            while i < len(fields):
                gPlyID = integer(card, 9 + i, 'gPlyID')
                mid = integer_or_blank(card, 9 + i + 1, 'mid', midLast)

                # can be blank 2nd time thru
                thickness = double_or_blank(card, 9 + i + 2, 'thickness', tLast)

                theta = double_or_blank(card, 9 + i + 3, 'theta', 0.0)
                sout = string_or_blank(card, 9 + i + 4, 'sout', 'NO')
                #print('n=%s gPlyID=%s mid=%s thickness=%s len=%s' %(
                #    n,gPlyID,mid,thickness,len(fields)))

                ply = [mid, thickness, theta, sout, gPlyID]
                #print("ply = %s" %(ply))
                self.plies.append(ply)
                #[mid,t,theta,sout] # PCOMP

                assert mid is not None
                assert thickness is not None
                assert isinstance(mid, int), 'mid=%s' % mid
                assert isinstance(thickness, float), 'thickness=%s' % thickness
                midLast = mid
                tLast = thickness
                T += thickness
                i += 8
                #n += 1
                self.z0 = double_or_blank(card, 2, 'z0', -0.5 * T)
        else:
            raise NotImplementedError('PCOMPG data')
开发者ID:umvarma,项目名称:pynastran,代码行数:52,代码来源:shell.py


示例10: __init__

    def __init__(self, card=None, data=None, comment=''):
        SolidProperty.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Property ID
            self.pid = integer(card, 1, 'pid')
            #: Material ID
            self.mid = integer(card, 2, 'mid')
            self.cordm = integer_or_blank(card, 3, 'cordm', 0)
            self.integ = integer_string_or_blank(card, 4, 'integ')
            #validIntegration = ['THREE', 'TWO', 'FULL', 'BUBBLE',
            #                    2, 3, None, 'REDUCED']
            self.stress = integer_string_or_blank(card, 5, 'stress')
            self.isop = integer_string_or_blank(card, 6, 'isop')
            self.fctn = string_or_blank(card, 7, 'fctn', 'SMECH')
            assert len(card) <= 8, 'len(PSOLID card) = %i' % len(card)
        else:
            self.pid = data[0]
            self.mid = data[1]
            self.cordm = data[2]
            self.integ = data[3]
            self.stress = data[4]
            self.isop = data[5]
            self.fctn = data[6]

            if self.fctn == 'SMEC':
                self.fctn = 'SMECH'
开发者ID:abk-ShuaiHaotian,项目名称:pyNastran,代码行数:28,代码来源:properties.py


示例11: __init__

    def __init__(self, card=None, data=None, comment=''):
        """
        Design Sensitivity Equation Response Quantities
        Defines equation responses that are used in the design, either as
        constraints or as an objective.
        """
        if comment:
            self._comment = comment
        self.oid = integer(card, 1, 'oid')
        self.label = string(card, 2, 'label')
        self.eqidFunc = integer_or_string(card, 3, 'eqid_Func')
        self.region = integer_or_blank(card, 4, 'region')
        self.method = string_or_blank(card, 5, 'method', 'MIN')
        self.c1 = double_or_blank(card, 6, 'c1', 100.)
        self.c2 = double_or_blank(card, 7, 'c2', 0.005)
        self.c3 = double_or_blank(card, 8, 'c3') #: .. todo:: or blank?

        i = 0
        fields = [interpret_value(field) for field in card[9:] ]
        key = '$NULL$'  # dummy key
        self.params = {key: []}
        valueList = []
        for (i, field) in enumerate(fields):
            if i % 8 == 0 and field is not None:
                self.params[key] = valueList
                key = field
                valueList = []
            elif field is not None:
                valueList.append(field)
            #else:
            #    pass

        self.params[key] = valueList
        del self.params['$NULL$']
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:34,代码来源:optimization.py


示例12: add

 def add(self, card, comment=''):
     i = self.i
     self.element_id[i] = integer(card, 1, 'element_id')
     self.caero[i] = integer(card, 2, 'caero')
     self.box1[i] = integer(card, 3, 'box1')
     self.box2[i] = integer(card, 4, 'box2')
     self.setg[i] = integer(card, 5, 'setg')
     self.dz[i] = double_or_blank(card, 6, 'dz', 0.0)
     self.method[i] = string_or_blank(card, 7, 'method', 'IPS')
     self.usage[i] = string_or_blank(card, 8, 'usage', 'BOTH')
     self.nelements[i] = integer_or_blank(card, 9, 'nelements', 10)
     self.melements[i] = integer_or_blank(card, 10, 'melements', 10)
     assert self.nelements[i] > 0, 'nelements = %s' % self.nelements[i]
     assert self.melements[i] > 0, 'melements = %s' % self.melements[i]
     assert len(card) <= 11, 'len(SPLINE1 card) = %i' % len(card)
     self.i += 1
开发者ID:umvarma,项目名称:pynastran,代码行数:16,代码来源:spline1.py


示例13: __init__

    def __init__(self, card=None, data=None, comment=''):
        TabularLoad.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            self.sid = integer(card, 1, 'sid')
            self.exciteID = integer(card, 2, 'exciteID')
            self.delay = integer_double_or_blank(card, 3, 'delay')
            self.dphase = integer_double_or_blank(card, 4, 'dphase')
            self.tb = integer_or_blank(card, 5, 'tb', 0)
            self.tp = integer_or_blank(card, 6, 'tp', 0)
            self.Type = string_or_blank(card, 7, 'Type', 'LOAD')

            if self.Type in [0, 'L', 'LO', 'LOA', 'LOAD']:
                self.Type = 'LOAD'
            elif self.Type in [1, 'D', 'DI', 'DIS', 'DISP']:
                self.Type = 'DISP'
            elif self.Type in [2, 'V', 'VE', 'VEL', 'VELO']:
                self.Type = 'VELO'
            elif self.Type in [3, 'A', 'AC', 'ACC', 'ACCE']:
                self.Type = 'ACCE'
            else:
                msg = 'invalid RLOAD2 type  Type=|%s|' % self.Type
                raise RuntimeError(msg)
            assert len(card) <= 8, 'len(RLOAD2 card) = %i' % len(card)
        else:
            raise NotImplementedError(data)
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:27,代码来源:loads.py


示例14: add

    def add(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' % len(card)
        self.i += 1
开发者ID:umvarma,项目名称:pynastran,代码行数:31,代码来源:psolid.py


示例15: getShockA

    def getShockA(self, card, iStart):
        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)
        else:
            raise RuntimeError('Invalid shockType=|%s| on card\n%s' %(self.shockType, card))

        iStart += 8
        return iStart
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:28,代码来源:bush.py


示例16: __init__

    def __init__(self, card, data=None, comment=''):
        if comment:
            self._comment = comment
        if card:
            self.key = string(card, 1, 'key')
            n = 1
            if self.key == 'ACOUT':
                self.value = string_or_blank(card, 2, 'value', 'PEAK')
            elif self.key == 'ACOWEAK':
                self.value = string_or_blank(card, 2, 'value', 'NO')
            elif self.key == 'ACSYM':
                self.value = string_or_blank(card, 2, 'value', 'YES')
            elif self.key == 'ADJMETH':
                self.value = integer_or_blank(card, 2, 'value', 0)
            elif self.key == 'ADMPOST':
                self.value = string_or_blank(card, 2, 'value', 0)
            elif self.key == 'ADSTAT':
                self.value = string_or_blank(card, 2, 'value', 'YES')
            elif self.key in ['ALPHA1', 'ALPHA2']:
                self.value1 = double_or_blank(card, 2, 'value1', 0.0)
                self.value2 = double_or_blank(card, 2, 'value2', 0.0)
                n = 2
            elif self.key in ['ALPHA1FL', 'ALPHA2FL']:
                self.value1 = double_or_blank(card, 2, 'value1', 0.0)
                self.value2 = double_or_blank(card, 3, 'value2', 0.0)
                n = 2
            elif self.key in ['CB1', 'CB2', 'CK1', 'CK2', 'CK3', 'CM1', 'CM2', 'CP1', 'CP2']:
                self.value1 = double_or_blank(card, 2, 'value1', 1.0)
                self.value2 = double_or_blank(card, 3, 'value2', 0.0)
                n = 2
            else:
                self.value = integer_double_or_string(card, 2, 'value')

            if hasattr(self, 'value1'):
                self.values = [self.value1, self.value2]
            else:
                self.values = [self.value]

            if n == 1:
                assert len(card) == 3, 'len(PARAM card)=%i card=%r' % (len(card), card)
            else:
                assert len(card) == 4, 'len(PARAM card)=%i card=%r' % (len(card), card)
        else:
            self.key = data[0]
            self.value = data[1]
开发者ID:anick107,项目名称:von_mises_rms,代码行数:45,代码来源:params.py


示例17: __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')

            #: Method of eigenvalue extraction. (Character: 'INV' for inverse
            #: power method or 'SINV' for enhanced inverse power method.)
            #: apparently it can also be blank...
            self.method = string_or_blank(card, 2, 'method')

            if self.method not in ['INV', 'SINV', None]:
                msg = 'method must be INV or SINV.  method=|%s|' % self.method
                raise RuntimeError(msg)

            #: Eigenvalue range of interest. (Real, L1 < L2)
            self.L1 = double(card, 3, 'L1')
            self.L2 = double(card, 4, 'L2')
            if not self.L1 < self.L2:
                msg = 'L1=%s L2=%s; L1<L2 is requried' % (self.L1, self.L2)
                raise RuntimeError(msg)

            #: Estimate of number of roots in positive range not used for
            #: METHOD = 'SINV'. (Integer > 0)
            self.nep = integer_or_blank(card, 5, 'nep', 0)

            #: Desired number of positive and negative roots.
            #: (Integer>0; Default = 3*NEP)
            self.ndp = integer_or_blank(card, 6, 'ndp', 3 * self.nep)
            self.ndn = integer_or_blank(card, 7, 'ndn', 3 * self.nep)

            #: Method for normalizing eigenvectors.
            #: ('MAX' or 'POINT';Default='MAX')
            self.norm = string_or_blank(card, 9, 'norm', 'MAX')
            if self.norm == 'POINT':
                self.G = integer(card, 10, 'G')
                self.C = components(card, 11, 'C')
            else:
                self.G = integer_or_blank(card, 10, 'G')
                self.C = components_or_blank(card, 11, 'C')
            assert len(card) <= 12, 'len(EIGB card) = %i' % len(card)
        else:
            raise NotImplementedError('EIGB')
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:45,代码来源:methods.py


示例18: add

    def add(self, card, comment=''):
        #: Trim set identification number. (Integer > 0)
        self.trim_id = integer(card, 1, 'trim_id')

        #: Mach number. (Real > 0.0 and != 1.0)
        self.mach = double(card, 2, 'mach')
        assert self.mach >= 0.0 and self.mach != 1.0, 'mach = %s' % self.mach

        #: Dynamic pressure. (Real > 0.0)
        self.q = double(card, 3, 'q')
        assert self.q > 0.0, 'q=%s' % self.q

        #: The label identifying aerodynamic trim variables defined on an
        #: AESTAT or AESURF entry.
        self.labels = []

        #: The magnitude of the aerodynamic extra point degree-of-freedom.
        #: (Real)
        self.uxs = []

        label = string_or_blank(card, 4, 'label1')
        if label:
            ux = double(card, 5, 'ux1')
            self.uxs.append(ux)
            self.labels.append(label)

        label = string_or_blank(card, 6, 'label2')
        if label:
            ux = double(card, 7, 'ux1')
            self.uxs.append(ux)
            self.labels.append(label)

        #: Flag to request a rigid trim analysis (Real > 0.0 and < 1.0;
        #: Default = 1.0. A value of 0.0 provides a rigid trim analysis,
        #: not supported
        self.aeqr = double_or_blank(card, 8, 'aeqr', 1.0)

        i = 9
        n = 3
        while i < len(card):
            label = string(card, i, 'label%i' % n)
            ux = double(card, i + 1, 'ux%i' % n)
            self.labels.append(label)
            self.uxs.append(ux)
            i += 2
开发者ID:umvarma,项目名称:pynastran,代码行数:45,代码来源:trim.py


示例19: __init__

    def __init__(self, card=None, data=None, comment=''):
        LineProperty.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Property ID
            self.pid = integer(card, 1, 'pid')
            #: Material ID
            self.mid = integer(card, 2, 'mid')
            self.group = string_or_blank(card, 3, 'group', 'MSCBMLO')
            #: Section Type (e.g. 'ROD', 'TUBE', 'I', 'H')
            self.Type = string(card, 4, 'Type')

            ndim = self.validTypes[self.Type]
            j = 9 + ndim + 1

            dims = []
            #dim_old = None  ## TODO: is there a default?
            for i in range(ndim):
                dim = double_or_blank(card, 9 + i, 'dim%i' % (i + 1))
                dims.append(dim)

            #: dimension list
            self.dim = dims
            assert len(dims) == ndim, 'PBARL ndim=%s len(dims)=%s' % (ndim, len(dims))
            assert len(dims) == len(self.dim), 'PBARL ndim=%s len(dims)=%s' % (ndim, len(self.dim))

            #: non-structural mass
            self.nsm = double_or_blank(card, 9 + ndim + 1, 'nsm', 0.0)

        else:
            self.pid = data[0]
            self.mid = data[1]
            self.group = data[2].strip()
            self.Type = data[3].strip()
            self.dim = list(data[4:-1])
            self.nsm = data[-1]
            #print("group = %r" % self.group)
            #print("Type  = %r" % self.Type)
            #print("dim = ",self.dim)
            #print(str(self))
            #print("*PBARL = ",data)
            #raise NotImplementedError('not finished...')
        if self.Type not in self.validTypes:
            msg = ('Invalid PBARL Type, Type=%s '
                   'validTypes=%s' % (self.Type, self.validTypes.keys()))
            raise RuntimeError(msg)

        if len(self.dim) != self.validTypes[self.Type]:
            msg = 'dim=%s len(dim)=%s Type=%s len(dimType)=%s' % (
                self.dim, len(self.dim), self.Type,
                self.validTypes[self.Type])
            raise RuntimeError(msg)

        assert None not in self.dim
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:55,代码来源:bars.py


示例20: __init__

    def __init__(self, card=None, data=None, comment=''):
        LineProperty.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Property ID
            self.pid = integer(card, 1, 'pid')
            #: Material ID
            self.mid = integer(card, 2, 'mid')
            self.group = string_or_blank(card, 3, 'group', 'MSCBMLO')
            #: Section Type (e.g. 'ROD', 'TUBE', 'I', 'H')
            self.Type = string(card, 4, 'Type')

            ndim = self.validTypes[self.Type]
            j = 9 + ndim + 1

            #: dimension list
            self.dim = fields(double_or_blank, card, 'dim', i=9, j=j)

            #: non-structural mass
            self.nsm = double_or_blank(card, 9 + ndim + 1, 'nsm', 0.0)

            if ndim > 0:
                self.nsm = set_default_if_blank(self.dim.pop(), 0.0)
            else:
                self.nsm = 0.0

            assert isinstance(self.nsm, float), 'nsm=%r' % self.nsm
        else:
            self.pid = data[0]
            self.mid = data[1]
            self.group = data[2].strip()
            self.Type = data[3].strip()
            self.dim = list(data[4:-1])
            self.nsm = data[-1]
            #print("group = %r" % self.group)
            #print("Type  = %r" % self.Type)
            #print("dim = ",self.dim)
            #print(str(self))
            #print("*PBARL = ",data)
            #raise NotImplementedError('not finished...')
        if self.Type not in self.validTypes:
            msg = ('Invalid PBARL Type, Type=%s '
                   'validTypes=%s' % (self.Type, self.validTypes.keys()))
            raise RuntimeError(msg)

        if len(self.dim) != self.validTypes[self.Type]:
            msg = 'dim=%s len(dim)=%s Type=%s len(dimType)=%s' % (
                self.dim, len(self.dim), self.Type,
                self.validTypes[self.Type])
            raise RuntimeError(msg)

        assert None not in self.dim
开发者ID:umvarma,项目名称:pynastran,代码行数:53,代码来源:bars.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python assign_type.components_or_blank函数代码示例发布时间:2022-05-25
下一篇:
Python assign_type.string函数代码示例发布时间: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