本文整理汇总了Python中pyNastran.bdf.bdf.BDF.getNodeIDsWithElements方法的典型用法代码示例。如果您正苦于以下问题:Python BDF.getNodeIDsWithElements方法的具体用法?Python BDF.getNodeIDsWithElements怎么用?Python BDF.getNodeIDsWithElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyNastran.bdf.bdf.BDF
的用法示例。
在下文中一共展示了BDF.getNodeIDsWithElements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_CQUAD4_01
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import getNodeIDsWithElements [as 别名]
def test_CQUAD4_01(self):
model = BDF(debug=False)
eid = 10
pid = 20
mid = 30
n1 = 1
n2 = 2
n3 = 3
n4 = 4
n5 = 5
n6 = 6
A = 2.
t = rho = nsm = E = G = nu = 0.1
mid2 = mid3 = mid4 = twelveIt3 = tst = z1 = z2 = None
mass = A * (t * rho + nsm)
cards = [
['grid', n1, 0, 0., 0., 0.],
['grid', n2, 0, 2., 0., 0.],
['grid', n3, 0, 2., 1., 0.],
['grid', n4, 0, 0., 1., 0.],
['grid', n5, 0, 0., 0., 0.],
['grid', n6, 0, 2., 0., 0.],
['cquad4', eid, pid, n1, n2, n3, n4],
['cquad4', eid+1, pid, n5, n6, n3, n4],
['pshell', pid, mid, t, mid2, twelveIt3, mid3, tst, nsm, z1, z2],
['mat1', mid, E, G, nu, rho],
]
for fields in cards:
model.add_card(fields, fields[0], is_list=True)
# get node IDs without cross referencing
eids = [10]
nids = model.getNodeIDsWithElements(eids)
assert nids == set([1, 2, 3, 4]), nids
eids = [11]
nids = model.getNodeIDsWithElements(eids)
assert nids == set([3, 4, 5, 6]), nids
eids = [10, 11]
nids = model.getNodeIDsWithElements(eids)
assert nids == set([1, 2, 3, 4, 5, 6]), nids
# get node IDs with cross referencing
model.cross_reference()
eids = [10]
nids = model.getNodeIDsWithElements(eids)
assert nids == set([1, 2, 3, 4]), nids
eids = [11]
nids = model.getNodeIDsWithElements(eids)
assert nids == set([3, 4, 5, 6]), nids
eids = [10, 11]
nids = model.getNodeIDsWithElements(eids)
assert nids == set([1, 2, 3, 4, 5, 6]), nids