本文整理汇总了Python中pyNastran.bdf.bdfInterface.assign_type.double函数的典型用法代码示例。如果您正苦于以下问题:Python double函数的具体用法?Python double怎么用?Python double使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了double函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, card, data):
Load.__init__(self, card, data)
if card:
#: load ID
self.sid = integer(card, 1, 'sid')
#: overall scale factor
self.scale = double(card, 2, 'scale')
#: individual scale factors (corresponds to loadIDs)
self.scaleFactors = []
#: individual loadIDs (corresponds to scaleFactors)
self.loadIDs = []
# alternating of scale factor & load set ID
nLoads = len(card) - 3
assert nLoads % 2 == 0
for i in xrange(nLoads // 2):
n = 2 * i + 3
self.scaleFactors.append(double(card, n, 'scaleFactor'))
self.loadIDs.append(integer(card, n + 1, 'loadID'))
else:
self.sid = data[0]
self.scale = data[1]
self.scaleFactors = data[2]
self.loadIDs = data[3]
assert len(data) == 4, '%s data=%s' % (self.type, data)
示例2: __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')
self.Type = string(card, 3, 'Type')
self.scale = string(card, 4, 'scale')
self.x1 = double(card, 5, 'x1')
self.p1 = double(card, 6, 'p1')
self.x2 = double_or_blank(card, 7, 'x2', self.x1)
self.p2 = double_or_blank(card, 8, 'p2', self.p1)
assert 0 <= self.x1 <= self.x2
assert len(card) <= 9, 'len(PLOAD1 card) = %i' % len(card)
else:
self.sid = data[0]
self.eid = data[1]
self.Type = data[2]
self.scale = data[3]
self.x1 = data[4]
self.p1 = data[5]
self.x2 = data[6]
self.p2 = data[7]
if self.Type not in self.validTypes:
msg = '%s is an invalid type on the PLOAD1 card' % self.Type
raise RuntimeError(msg)
assert self.scale in self.validScales, '%s is an invalid scale on the PLOAD1 card' % (self.scale)
示例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
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]
ENDT = string(card, nfields, 'ENDT')
isData = False
else:
self.tid = data[0]
self.x1 = data[1]
self.x2 = data[2]
xy = data[3:]
isData = True
self.parse_fields(xy, nrepeated=2, isData=isData)
示例4: __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')
示例5: add
def add(self, card, comment=""):
i = self.i
# if comment:
# self._comment = comment
self.material_id[i] = integer(card, 1, "material_id")
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(card, 4, "nu12") #: .. todo:: is this the correct default
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" % len(card)
self.i += 1
示例6: __init__
def __init__(self, card=None, data=None, comment=''):
Property.__init__(self, card, data)
if comment:
self._comment = comment
if card:
#: Property ID
self.pid = integer(card, 1, 'pid')
#: diameter of the fastener
self.d = double(card, 2, 'd')
assert self.d > 0
#: Specifies the element stiffness coordinate system
self.mcid = integer_or_blank(card, 3, 'mcid', -1)
assert self.mcid >= -1
self.mflag = integer_or_blank(card, 4, 'mflag', 0) # 0-absolute 1-relative
assert self.mflag in [0, 1]
#: stiffness values in directions 1-3
self.kt1 = double(card, 5, 'kt1')
self.kt2 = double(card, 6, 'kt2')
self.kt3 = double(card, 7, 'kt3')
#: Rotational stiffness values in directions 1-3
self.kr1 = double_or_blank(card, 8, 'kr1', 0.0)
self.kr2 = double_or_blank(card, 9, 'kr2', 0.0)
self.kr3 = double_or_blank(card, 10, 'kr3', 0.0)
#: Lumped mass of fastener
self.mass = double_or_blank(card, 11, 'mass', 0.0)
#: Structural damping
self.ge = double_or_blank(card, 12, 'ge', 0.0)
assert len(card) <= 13, 'len(PFAST card) = %i' % len(card)
else:
raise NotImplementedError(data)
示例7: __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')
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]
xy = data[1:]
isData = True
self.parse_fields(xy, nrepeated=2, isData=isData)
示例8: add
def add(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
示例9: __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.Type = string_or_blank(card, 2, 'Type', 'G')
assert self.Type in ['G', 'CRIT', 'Q'], 'Type=%r' % self.Type
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]
ENDT = string(card, nfields, 'ENDT')
isData = False
else:
self.tid = data[0]
self.x1 = data[1]
self.Type = data[2]
xy = data[5:]
isData = True
self.parse_fields(xy, nrepeated=2, isData=isData)
示例10: __init__
def __init__(self, card=None, data=None, comment=''):
Property.__init__(self, card, data)
if comment:
self._comment = comment
if card:
#: Property ID
self.pid = integer(card, 1, 'pid')
#: Material ID
self.mid1 = integer_or_blank(card, 2, 'mid1', 0)
self.t1 = double_or_blank(card, 3, 't1')
self.mid2 = integer_or_blank(card, 4, 'mid2', 0)
if self.mid2 > 0:
self.i = double(card, 5, 'i')
assert self.i > 0.0
else:
self.i = blank(card, 5, 'i')
self.mid3 = integer(card, 6, 0)
if self.mid3 > 0:
self.t2 = double(card, 7, 't3')
assert self.t2 > 0.0
else:
self.t2 = blank(card, 7, 't3')
self.nsm = double(card, 8, 'nsm')
self.z1 = double(card, 9, 'z1')
self.z2 = double(card, 10, 'z2')
self.phi = fields(double, card, 'phi', i=11, j=len(card))
else:
raise NotImplementedError(data)
示例11: 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' % len(card)
self.i += 1
示例12: __init__
def __init__(self, card=None, data=None, comment=''): # this card has missing fields
Ring.__init__(self, card, data)
if comment:
self._comment = comment
self.nid = integer(card, 1, 'nid')
blank(card, 2, 'blank')
self.R = double(card, 3, 'R')
self.z = double(card, 4, 'z')
blank(card, 5, 'blank')
blank(card, 6, 'blank')
self.ps = integer_or_blank(card, 7, 'ps')
assert len(card) <= 8, 'len(RINGAX card) = %i' % len(card)
示例13: __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 xrange(nf):
self.freqs.append(f1 * exp(i * d)) # 0 based index
self.cleanFreqs()
示例14: 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())
示例15: __init__
def __init__(self, card=None, data=None, comment=''):
"""
Defines the properties of a shear panel (CSHEAR entry).
+--------+-----+-----+---+-----+----+----+
| PSHEAR | PID | MID | T | NSM | F1 | F2 |
+--------+-----+-----+---+-----+----+----+
"""
ShellProperty.__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.t = double(card, 3, 't')
self.nsm = double_or_blank(card, 4, 'nsm', 0.0)
self.f1 = double_or_blank(card, 5, 'f1', 0.0)
self.f2 = double_or_blank(card, 6, 'f2', 0.0)
assert self.t > 0.0
#assert self.f1 >= 0.0
#assert self.f2 >= 0.0
assert len(card) <= 7, 'len(PSHEAR card) = %i' % len(card)
else:
#(pid,mid,t,nsm,f1,f2) = out
self.pid = data[0]
self.mid = data[1]
self.t = data[2]
self.nsm = data[3]
self.f1 = data[4]
self.f2 = data[5]