本文整理汇总了Python中pyNastran.bdf.fieldWriter.set_blank_if_default函数的典型用法代码示例。如果您正苦于以下问题:Python set_blank_if_default函数的具体用法?Python set_blank_if_default怎么用?Python set_blank_if_default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_blank_if_default函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reprFields
def reprFields(self):
#phi = set_blank_if_default(self.phi,0.0)
cd = set_blank_if_default(self.Cd(), 0)
ps = set_blank_if_default(self.ps, 0)
idf = set_blank_if_default(self.idf, 0)
fields = ['GRIDB', self.nid, None, None, self.phi, None, cd, ps, idf]
return fields
示例2: reprFields
def reprFields(self):
rho = set_blank_if_default(self.rho, 0.0)
TRef = set_blank_if_default(self.TRef, 0.0)
ge = set_blank_if_default(self.ge, 0.0)
fields = ['MAT3', self.mid, self.ex, self.eth, self.ez, self.nuxth, self.nuthz, self.nuzx, rho,
None, None, self.gzx, self.ax, self.ath, self.az, TRef, ge]
return fields
示例3: reprFields
def reprFields(self):
nodes = self.nodeIDs()
ge = set_blank_if_default(self.ge, 0.)
s = set_blank_if_default(self.s, 0.)
list_fields = ['CELAS2', self.eid, self.k, nodes[0], self.c1,
nodes[1], self.c2, ge, s]
return list_fields
示例4: reprFields
def reprFields(self):
nsm = set_blank_if_default(self.nsm, 0.)
gamma = set_blank_if_default(self.gamma, 0.5)
phi = set_blank_if_default(self.phi, 180.)
list_fields = ['PRAC2D', self.pid, self.Mid(), self.thick,
self.iPlane, nsm, gamma, phi]
return list_fields
示例5: reprFields
def reprFields(self):
c0 = set_blank_if_default(self.c0, 0.)
cmult = set_blank_if_default(self.cmult, 1.)
list_fields = ['DLINK', self.oid, self.ddvid, c0, cmult]
for (idv, ci) in izip(self.IDv, self.Ci):
list_fields += [idv, ci]
return list_fields
示例6: reprFields
def reprFields(self):
cp = set_blank_if_default(self.Cp(), 0)
nspan = set_blank_if_default(self.nspan, 0)
nchord = set_blank_if_default(self.nchord, 0)
fields = ['CAERO1', self.eid, self.Pid(), cp, nspan, nchord, self.lspan, self.lchord, self.igid,
] + list(self.p1) + [self.x12] + list(self.p4) + [self.x43]
return fields
示例7: reprFields
def reprFields(self):
filmNode = set_blank_if_default(self.filmNode, 0)
ta2 = set_blank_if_default(self.ta2, self.ta1)
mdot = set_blank_if_default(self.mdot, 1.0)
fields = ['CONVM', self.eid, self.pconvmID, filmNode, self.cntmdot,
self.ta1, ta2, mdot]
return fields
示例8: repr_fields
def repr_fields(self):
j = set_blank_if_default(self.j, 0.0)
c = set_blank_if_default(self.c, 0.0)
nsm = set_blank_if_default(self.nsm, 0.0)
list_fields = ['CONROD', self.eid] + self.nodeIDs() + [self.Mid(),
self.A, j, c, nsm]
return list_fields
示例9: test_field_defaults
def test_field_defaults(self):
self.assertEqual(set_blank_if_default(0.0, 0.0), None,
set_blank_if_default(0.0, 0.0))
self.assertEqual(set_blank_if_default(1.0, 0.0), 1.0,
set_blank_if_default(1.0, 0.0))
# None
self.assertEqual(set_default_if_blank(None, None), None,
set_default_if_blank(None, None))
# floats
self.assertEqual(set_default_if_blank(4.0, None), 4.0,
set_default_if_blank(4.0, None))
self.assertEqual(set_default_if_blank(None, 4.0), 4.0,
set_default_if_blank(None, 4.0))
# ints
self.assertEqual(set_default_if_blank(4, None), 4,
set_default_if_blank(4, None))
self.assertEqual(set_default_if_blank(None, 4), 4,
set_default_if_blank(None, 4))
# strings
self.assertEqual(set_default_if_blank('dummy', 'GGG'), 'dummy',
set_default_if_blank('dummy', 'GGG'))
self.assertEqual(set_default_if_blank(None, 'GGG'), 'GGG',
set_default_if_blank(None, 'GGG'))
示例10: write_bdf
def write_bdf(self, f, size=8, element_ids=None):
if self.n:
if element_ids is None:
i = arange(self.n)
else:
i = searchsorted(self.element_id, self.element_id)
for (eid, pid, n, is_g0, g0, x, is_offt, offt, bit, pin, wa, wb, sa, sb) in zip(
self.element_id[i], self.property_id[i], self.node_ids[i],
self.is_g0[i], self.g0[i], self.x[i],
self.is_offt[i], self.offt[i], self.bit[i],
self.pin_flags[i], self.wa[i], self.wb[i], self.sa[i], self.sb[i]):
x1 = g0 if is_g0 else x[0]
x2 = 0 if is_g0 else x[1]
x3 = 0 if is_g0 else x[2]
offt_bit = offt if is_offt else bit
#print('is_offt=%s offt=%s bit=%s offt_bit=%s' % (is_offt, offt, bit, offt_bit))
pa = set_blank_if_default(pin[0], 0)
pb = set_blank_if_default(pin[1], 0)
w1a = set_blank_if_default(wa[0], 0.0)
w2a = set_blank_if_default(wa[1], 0.0)
w3a = set_blank_if_default(wa[2], 0.0)
w1b = set_blank_if_default(wb[0], 0.0)
w2b = set_blank_if_default(wb[1], 0.0)
w3b = set_blank_if_default(wb[2], 0.0)
sa = set_blank_if_default(sa, 0)
sb = set_blank_if_default(sb, 0)
card = ['CBEAM', eid, pid, n[0], n[1], x1, x2, x3, offt_bit,
pa, pb, w1a, w2a, w3a, w1b, w2b, w3b,
sa, sb]
f.write(print_card_8(card))
示例11: reprFields
def reprFields(self):
cp = set_blank_if_default(self.Cp(), 0)
cd = set_blank_if_default(self.Cd(), 0)
ps = set_blank_if_default(self.ps, 0)
seid = set_blank_if_default(self.SEid(), 0)
list_fields = ['GRDSET', None, cp, None, None, None, cd, ps, seid]
return list_fields
示例12: reprFields
def reprFields(self):
nodes = self.nodeIDs(allowEmptyNodes=True,
msg=str(['CELAS2', self.eid]))
ge = set_blank_if_default(self.ge, 0.)
s = set_blank_if_default(self.s, 0.)
fields = ['CELAS2', self.eid, self.k, nodes[0], self.c1,
nodes[1], self.c2, ge, s]
return fields
示例13: reprFields
def reprFields(self):
N = []
for n in self.N:
N.append(set_blank_if_default(n, 0.0))
mb = set_blank_if_default(self.mb, 0)
list_fields = ['GRAV', self.sid, self.Cid(), self.scale] + N + [mb]
return list_fields
示例14: reprFields
def reprFields(self):
#method = set_blank_if_default(self.method,1)
racc = set_blank_if_default(self.racc, 0.)
mb = set_blank_if_default(self.mb, 0)
idrf = set_blank_if_default(self.idrf, 0)
list_fields = ['RFORCE', self.sid, self.Nid(), self.Cid(), self.scale,
self.r1, self.r2, self.r3, self.method, racc,
mb, idrf]
return list_fields
示例15: repr_fields
def repr_fields(self):
mpMax = set_blank_if_default(self.mpMax, 1e20)
c0 = set_blank_if_default(self.c0, 0.)
list_fields = ['DVMREL1', self.oid, self.Type, self.Mid(),
self.mpName, self.mpMin, mpMax, c0, None]
for (dvid, coeff) in zip(self.dvids, self.coeffs):
list_fields.append(dvid)
list_fields.append(coeff)
return list_fields