当前位置: 首页>>代码示例>>Python>>正文


Python BDF.get_node_ids_with_elements方法代码示例

本文整理汇总了Python中pyNastran.bdf.bdf.BDF.get_node_ids_with_elements方法的典型用法代码示例。如果您正苦于以下问题:Python BDF.get_node_ids_with_elements方法的具体用法?Python BDF.get_node_ids_with_elements怎么用?Python BDF.get_node_ids_with_elements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyNastran.bdf.bdf.BDF的用法示例。


在下文中一共展示了BDF.get_node_ids_with_elements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_cquad4_01

# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import get_node_ids_with_elements [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.get_node_ids_with_elements(eids)
        assert nids == set([1, 2, 3, 4]), nids

        eids = [11]
        nids = model.get_node_ids_with_elements(eids)
        assert nids == set([3, 4, 5, 6]), nids

        eids = [10, 11]
        nids = model.get_node_ids_with_elements(eids)
        assert nids == set([1, 2, 3, 4, 5, 6]), nids

        # get node IDs with cross referencing
        model.cross_reference()
        eids = [10]
        nids = model.get_node_ids_with_elements(eids)
        assert nids == set([1, 2, 3, 4]), nids

        eids = [11]
        nids = model.get_node_ids_with_elements(eids)
        assert nids == set([3, 4, 5, 6]), nids

        eids = [10, 11]
        nids = model.get_node_ids_with_elements(eids)
        assert nids == set([1, 2, 3, 4, 5, 6]), nids
开发者ID:saullocastro,项目名称:pyNastran,代码行数:60,代码来源:test_shells.py


注:本文中的pyNastran.bdf.bdf.BDF.get_node_ids_with_elements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。