本文整理汇总了Python中pyNastran.bdf.fieldWriter16.print_card_16函数的典型用法代码示例。如果您正苦于以下问题:Python print_card_16函数的具体用法?Python print_card_16怎么用?Python print_card_16使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_card_16函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: write_bdf
def write_bdf(self, size=8, is_double=False):
card = self.reprFields()
if size == 8:
return self.comment() + print_card_8(card)
elif is_double:
return self.comment() + print_card_double(card)
return self.comment() + print_card_16(card)
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:coordinateSystems.py
示例2: write_bdf
def write_bdf(self, f, size=8):
card = ['SPCADD', self.spc_id] + self.spc_ids
#print "card = ", card
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:spcadd.py
示例3: write_bdf
def write_bdf(self, f, size=8, property_id=None):
#print('PBARL.n = %s' % self.n)
if self.n:
if property_id is None:
i = arange(self.n)
else:
i = searchsorted(self.property_id, property_id)
#print('i = %s' % i)
#cid = [cid if cid != 0 else '' for cid in self.coord_id]
#group = set_blank_if_default(self.group, 'MSCBMLO')
#list_fields = ['PBARL', self.pid, self.Mid(), group, self.Type, None,
#None, None, None] + self.dim + [self.nsm]
#self.model.log.debug('*pbarl write pids=%s' % self.property_id)
for (j, pid, mid, group, Type, nsm) in zip(count(), self.property_id[i], self.material_id[i],
self.group[i], self.Type[i], self.nsm[i]):
dim = self.dim[j]
sgroup = set_blank_if_default(group, 'MSCBMLO')
list_fields = ['PBARL', pid, mid, group, Type, None,
None, None, None] + dim + [nsm]
if size == 8:
f.write(print_card_8(list_fields))
else:
f.write(print_card_16(list_fields))
开发者ID:umvarma,项目名称:pynastran,代码行数:26,代码来源:pbarl.py
示例4: write_bdf
def write_bdf(self, f, size, is_double, coord_id=None):
assert size in [8, 16], size
assert is_double in [True, False], is_double
if self.n:
#if coord_id is None:
i = arange(self.n)
#else:
#assert len(unique(coord_id))==len(coord_id), unique(coord_id)
#i = searchsorted(self.coord_id, coord_id)
if size == 8:
for cid, coord in iteritems(self.coords):
if cid > 0:
list_fields = [coord.type, cid, coord.rid] + list(coord.e1) + list(coord.e2) + list(coord.e3)
f.write(print_card_8(list_fields))
else:
if is_double:
for cid, coord in iteritems(self.coords):
if cid > 0:
list_fields = [coord.type, cid, coord.rid] + list(coord.e1) + list(coord.e2) + list(coord.e3)
f.write(print_card_16(list_fields))
else:
for cid, coord in iteritems(self.coords):
if cid > 0:
list_fields = [coord.type, cid, coord.rid] + list(coord.e1) + list(coord.e2) + list(coord.e3)
f.write(print_card_double(list_fields))
开发者ID:umvarma,项目名称:pynastran,代码行数:27,代码来源:coord.py
示例5: 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, offt, pin, wa, wb) 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.offt[i],
self.pin_flags[i], self.wa[i], self.wb[i]):
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)
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 = set_string8_blank_if_default(offt, 'GGG')
card = ['CBAR', eid, pid, n[0], n[1], x1, x2, x3, offt,
pa, pb, w1a, w2a, w3a, w1b, w2b, w3b]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:33,代码来源:cbar.py
示例6: write_bdf
def write_bdf(self, f, size=8):
card = ['NLPCI', self.nlpci_id, self.Type, self.minalr,
self.maxalr, self.scale, None, self.desiter, self.mxinc]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:nlpci.py
示例7: write_bdf
def write_bdf(self, f, size=8):
for comp, nodes in iteritems(self.components):
card = ['SPC1', self.constraint_id, comp] + list(nodes)
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:spc1.py
示例8: write_bdf
def write_bdf(self, f, size=8, is_double=False):
if self.n:
card = ['GRDSET', None, self.cp, None, None, None, self.cd, self.seid]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:grid.py
示例9: write_bdf
def write_bdf(self, f, size=8, is_double=False):
#..todo:: collapse the IDs
if self.n:
card = ['EPOINT'] + list(self.epoint)
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:8,代码来源:epoint.py
示例10: write_bdf
def write_bdf(self, f, size=8):
if self.n:
n = 0
for lid, t in zip(self.load_id, self.temperature_default):
card = ['TEMPD', lid, t]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:9,代码来源:temp.py
示例11: write_bdf
def write_bdf(self, f, size=8):
if self.n:
for constraint in self.constraints:
card = ['MPC', self.constraint_id]
for (G, C, A) in constraint:
card += [G, C, A]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:mpc.py
示例12: write_bdf
def write_bdf(self, f, size=8, lids=None):
if self.n:
for (lid, cid, scale, N, mb) in zip(
self.load_id, self.coord_id, self.scale, self.N, self.mb):
card = ['GRAV', lid, cid, scale, N[0], N[1], n[2], mb]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:grav.py
示例13: write_bdf
def write_bdf(self, f, size=8, lids=None):
if self.n:
for (lid, nid, cid, mag, xyz) in zip(
self.load_id, self.node_id, self.coord_id, self.mag, self.xyz):
card = ['MOMENT', lid, nid, cid, mag, xyz[0], xyz[1], xyz[2] ]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:moment.py
示例14: write_bdf
def write_bdf(self, f, size=8):
if self.n:
for dof, node_ids in sorted(iteritems(self.components)):
card = ['SPC', self.constraint_id]
for node_id in node_ids:
card += [node_id, dof, 0.0]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:spc.py
示例15: write_bdf
def write_bdf(self, f, size=8, is_double=False, load_id=None):
if load_id is None:
load_id = self.load_id
load_id = asarray(load_id)
list_fields = ['LOAD', self.load_id, self.scale]
for (scaleFactor, lid) in zip(self.scale_factors, self.load_ids):
list_fields += [scaleFactor, lid]
if size == 8:
f.write(print_card_8(list_fields))
else:
f.write(print_card_16(list_fields))
开发者ID:umvarma,项目名称:pynastran,代码行数:11,代码来源:load.py
示例16: write_bdf
def write_bdf(self, f, size=8, eids=None):
if self.n:
if eids is None:
i = arange(self.n)
else:
i = searchsorted(self.element_id, self.eid)
for (eid, pid, n, c) in zip(self.element_id[i], self.property_id[i], self.node_ids[i], self.components[i]):
card = ['CELAS1', eid, pid, n[0], n[1], c[0], c[1] ]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:13,代码来源:celas1.py
示例17: write_bdf
def write_bdf(self, f, size=8, is_double=False, load_id=None):
if self.n:
if load_id is None:
for (lid, nid, cid, mag, xyz) in zip(
self.load_id, self.node_id, self.coord_id, self.mag, self.xyz):
card = ['FORCE', lid, nid, cid, mag, xyz[0], xyz[1], xyz[2] ]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
else:
for lid in unique(load_id):
i = where(self.load_id == lid)[0]
for (lid, nid, cid, mag, xyz) in zip(
self.load_id[i], self.node_id[i], self.coord_id[i], self.mag[i], self.xyz[i]):
card = ['FORCE', lid, nid, cid, mag, xyz[0], xyz[1], xyz[2] ]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:22,代码来源:force.py
示例18: write_bdf
def write_bdf(self, f, size=8, element_id=None):
if self.n:
if element_id is None:
i = arange(self.n)
for (eid, n12, mid, A, J, c, nsm) in zip(
self.element_id, self.node_ids, self.material_id, self.A, self.J,
self.c, self.nsm):
card = ['CONROD', eid, n12[0], n12[1], mid, A, J, c, nsm ]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:13,代码来源:conrod.py
示例19: test_card_double
def test_card_double(self):
card = print_card_double(['GRID', 1, None, 120.322,-4.82872,1.13362])
card_expected = 'GRID* 1 1.2032200000D+02-4.828720000D+00\n'
card_expected += '* 1.1336200000D+00\n'
self.assertEqual(card, card_expected)
#card = print_card_double(['CHEXA', 1, 2, 2, 3, 4, 1, 8, 5,
#6, 7])
#card_expected = ''
#card_expected += 'CHEXA* 1 2 2 3\n'
#card_expected +='* 4 1 8 5\n'
#card_expected +='* 6 7\n'
#card_expected += '* 1.1336200000D+00\n'
#card = print_card_double(['CTETRA',6437,1,14533,5598,1577,9976,42364,5599,42365,42363,30022,12904])
#card_expected = ''
#card_expected += 'CTETRA* 6437 1 14533 5598\n'
#card_expected += '* 1577 9976 42364 5599\n'
#card_expected += '* 42365 42363 30022 12904\n'
#card_expected += '* \n'
#card_expected +='CTETRA* 6437 1 14533 5598\n'
#card_expected +='* 1577 9976 42364 5599\n'
#card_expected +='* 42365 42363 30022 12904\n'
#card_expected +='* \n'
#self.assertEqual(card, card_expected)
#=============================
# mid E1 E2 nu12 G12 G1z G2z rho
card = print_card_8(['MAT8', 6, 1.7e+7, 1.7e+7, .98, 340000., 180000., 180000., .0001712,
# a1 a2 TRef
None, 71.33])
card_expected = ''
card_expected += 'MAT8 6 1.7+7 1.7+7 .98 340000. 180000. 180000..0001712\n'
card_expected += ' 71.33\n'
self.assertEqual(card, card_expected)
card = print_card_16(['MAT8', 6, 1.7e+7, 1.7e+7, .98, 340000., 180000., 180000., .0001712,
# a1 a2 TRef
None, 71.33])
card_expected = ''
card_expected += 'MAT8* 6 17000000. 17000000. .98\n'
card_expected += '* 340000. 180000. 180000. .0001712\n'
card_expected += '* 71.33\n'
card_expected += '*\n'
# bad
self.assertEqual(card, card_expected)
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:50,代码来源:test_field_writer.py
示例20: write_bdf
def write_bdf(self, f, size=8, load_ids=None):
if self.n:
if load_ids is None:
i = arange(self.n)
else:
i = searchsorted(load_ids, self.load_id)
for (load_id, element_id, Type, scale, x1, p1, x2, p2) in zip(self.load_id[i], self.element_id[i],
self.Type[i], self.scale[i], self.x1[i], self.p1[i], self.x2[i], self.p2[i]):
card = ['PLOAD1', load_id, element_id, Type, scale, x1, p1, x2, p2 ]
if size == 8:
f.write(print_card_8(card))
else:
f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:14,代码来源:pload1.py
注:本文中的pyNastran.bdf.fieldWriter16.print_card_16函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论