本文整理汇总了Python中pyNastran.bdf.bdf.BDF._add_property_object方法的典型用法代码示例。如果您正苦于以下问题:Python BDF._add_property_object方法的具体用法?Python BDF._add_property_object怎么用?Python BDF._add_property_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyNastran.bdf.bdf.BDF
的用法示例。
在下文中一共展示了BDF._add_property_object方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_mass
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import _add_property_object [as 别名]
def get_mass(self, nid1, nid2, xyz1, xyz2, eid, pid, mid, A, J, c, nsm, E, G, nu, rho, L):
"""tests a CROD and a CONROD"""
model = BDF(debug=False)
lines = ['conrod,%i, %i, %i, %i, %f, %f, %f, %f' % (eid, nid1, nid2, mid, A, J, c, nsm)]
card = model.process_card(lines)
cardi = BDFCard(card)
conrod = CONROD.add_card(cardi)
model._add_element_object(conrod)
card = model.elements[eid]
node_ids = card.node_ids
assert node_ids == [nid1, nid2], node_ids # probably wrong
lines = ['crod,%i, %i, %i, %i' % (eid+1, pid, nid1, nid2)]
card = model.process_card(lines)
cardi = BDFCard(card)
crod = CROD.add_card(cardi)
model._add_element_object(crod)
card = model.elements[eid+1]
node_ids = card.node_ids
assert node_ids == [nid1, nid2], node_ids # probably wrong
lines = ['ctube,%i, %i, %i, %i' % (eid+2, pid+1, nid1, nid2)]
card = model.process_card(lines)
cardi = BDFCard(card)
ctube = CTUBE.add_card(cardi)
model._add_element_object(ctube)
card = model.elements[eid+2]
node_ids = card.node_ids
assert node_ids == [nid1, nid2], node_ids # probably wrong
lines = ['prod,%i, %i, %f, %f, %f, %f' % (pid, mid, A, J, c, nsm)]
card = model.process_card(lines)
cardi = BDFCard(card)
prod = PROD.add_card(cardi)
model._add_property_object(prod)
#self.pid = integer(card, 1, 'pid')
#self.mid = integer(card, 2, 'mid')
#self.OD1 = double(card, 3, 'OD1')
#self.t = double_or_blank(card, 4, 't', self.OD1 / 2.)
#self.nsm = double_or_blank(card, 5, 'nsm', 0.0)
#self.OD2 = double_or_blank(card, 6, 'OD2', self.OD1)
OD1 = sqrt(4*A/pi)
t = 0.
OD2 = OD1
lines = ['ptube,%i, %i, %f, %f, %f, %f' % (pid+1, mid, OD1, t, nsm, OD2)]
card = model.process_card(lines)
cardi = BDFCard(card)
ptube = PTUBE.add_card(cardi)
model._add_property_object(ptube)
lines = ['mat1,%i, %.2e, %.2e, %f, %f' % (mid, E, G, nu, rho)]
card = model.process_card(lines)
cardi = BDFCard(card)
card = MAT1.add_card(cardi)
model._add_structural_material_object(card)
lines = ['grid,%i, %i, %f, %f, %f' % (nid1, 0, xyz1[0], xyz1[1], xyz1[2])]
card = model.process_card(lines)
cardi = BDFCard(card)
card = GRID.add_card(cardi)
model._add_node_object(card)
lines = ['grid,%i, %i, %f, %f, %f' % (nid2, 0, xyz2[0], xyz2[1], xyz2[2])]
card = model.process_card(lines)
cardi = BDFCard(card)
card = GRID.add_card(cardi)
model._add_node_object(card)
model.cross_reference()
mass = L * (rho * A + nsm)
# conrod
self.assertEqual(conrod.eid, eid)
self.assertEqual(conrod.Pid(), None)
self.assertEqual(conrod.Mid(), mid)
self.assertEqual(conrod.Length(), L)
self.assertEqual(conrod.Nsm(), nsm)
self.assertEqual(conrod.Mass(), mass)
self.assertEqual(conrod.E(), E)
self.assertEqual(conrod.G(), G)
self.assertEqual(conrod.Area(), A)
self.assertEqual(conrod.J(), J)
self.assertEqual(conrod.C(), c)
self.assertEqual(conrod.Rho(), rho)
# crod
self.assertEqual(crod.eid, eid+1)
self.assertEqual(crod.Pid(), pid)
self.assertEqual(crod.Mid(), mid)
self.assertEqual(crod.Length(), L)
self.assertEqual(crod.Nsm(), nsm)
self.assertEqual(crod.Mass(), mass)
self.assertEqual(crod.E(), E)
self.assertEqual(crod.G(), G)
self.assertEqual(crod.Area(), A)
self.assertEqual(crod.J(), J)
self.assertEqual(crod.C(), c)
self.assertEqual(crod.Rho(), rho)
#self.assertEqual(crod.Nu(), nu)
#.........这里部分代码省略.........