本文整理汇总了Python中pyNastran.bdf.bdf.BDF.get_node_id_to_element_ids_map方法的典型用法代码示例。如果您正苦于以下问题:Python BDF.get_node_id_to_element_ids_map方法的具体用法?Python BDF.get_node_id_to_element_ids_map怎么用?Python BDF.get_node_id_to_element_ids_map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyNastran.bdf.bdf.BDF
的用法示例。
在下文中一共展示了BDF.get_node_id_to_element_ids_map方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: example5
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import get_node_id_to_element_ids_map [as 别名]
def example5():
"""
Example 5: Get Elements by Node ID - Level 2
"""
# this example will demonstate:
# - getting the list of elements that share a certain node
# our model
import pyNastran
pkg_path = pyNastran.__path__[0]
test_path = os.path.join(pkg_path, '..', 'models', 'solid_bending')
bdf_filename = os.path.join(test_path, 'solid_bending.bdf')
# instantiate the model
from pyNastran.bdf.bdf import BDF
model = BDF()
model.read_bdf(bdf_filename, xref=True)
f = open('junk.out', 'w')
# given a Node, get the Elements Attached to that Node
# assume node 55
# doesnt support 0d/1d elements yet
nid_to_eids_map = model.get_node_id_to_element_ids_map()
eids = nid_to_eids_map[55]
# convert to elements instead of element IDs
elements = []
for eid in eids:
elements.append(model.Element(eid))
print("eids = %s" % eids)
print("elements =\n %s" % elements)