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


Python BDF.load方法代码示例

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


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

示例1: find_surface_panels

# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import load [as 别名]
def find_surface_panels(bdf_filename=None, op2_filename=None, isubcase=1,
                        consider_pids=False, rebuild_patches=True,
                        workpath='results'):
    """prevents bleedover of data"""
    model = BDF()
    #bdf_filename = r'F:\work\pyNastran\pyNastran\master2\pyNastran\applications\mesh\surface\BWB_afl_static_analysis_short.bdf'
    #op2_filename = r'F:\work\pyNastran\pyNastran\master2\pyNastran\applications\mesh\surface\BWB_afl_static_analysis_short.op2'

    if bdf_filename is None:
        bdf_filename = 'model_144.bdf'
    if op2_filename is None:
        op2_filename = 'model_144.op2'

    #bdf_filename = r'F:\work\pyNastran\pyNastran\master2\models\solid_bending\solid_bending.bdf'
    if 0:
        if not os.path.exists(bdf_filename):
            bdf_filename = os.path.join(os.path.expanduser('~'),
                                        'Desktop', 'move', '3_LoadCases_Final',
                                        'BWB_afl_static_analysis_short.bdf')
            op2_filename = os.path.join(os.path.expanduser('~'),
                                        'Desktop', 'move', '3_LoadCases_Final',
                                        'BWB_afl_static_analysis_short.op2')
            assert os.path.exists(bdf_filename), bdf_filename

    if not os.path.exists('model.obj') or 1:
        model.read_bdf(bdf_filename, xref=False)
        #model.save('model.obj')
    else:
        model.load('model.obj')
    model.cross_reference()

    #create_plate_buckling_models(model, op2_filename, 'load')
    create_plate_buckling_models(model, op2_filename, 'displacement',
                                 workpath=workpath, isubcase=isubcase,
                                 consider_pids=consider_pids,
                                 rebuild_patches=rebuild_patches)
开发者ID:watkinrt,项目名称:pyNastran,代码行数:38,代码来源:find_surface_panels.py

示例2: run_fem1

# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import load [as 别名]
def run_fem1(fem1, bdf_model, mesh_form, xref, punch, sum_load, size, is_double, cid,
             encoding=None):
    """
    Reads/writes the BDF

    Parameters
    ----------
    fem1 : BDF()
        The BDF object
    bdf_model : str
        The root path of the bdf filename
    mesh_form : str {combined, separate}
        'combined' : interspersed=True
        'separate' : interspersed=False
    xref : bool
        The xref mode
    punch : bool
        punch flag
    sum_load : bool
        static load sum flag
    size : int, {8, 16}
        size flag
    is_double : bool
        double flag
    cid : int / None
        cid flag
    """
    assert os.path.exists(bdf_model), print_bad_path(bdf_model)
    try:
        if '.pch' in bdf_model:
            fem1.read_bdf(bdf_model, xref=False, punch=True, encoding=encoding)
        else:
            fem1.read_bdf(bdf_model, xref=False, punch=punch, encoding=encoding)
            #fem1.geom_check(geom_check=True, xref=False)
            fem1.write_skin_solid_faces('skin_file.bdf', size=16, is_double=False)
            if xref:
                #fem1.uncross_reference()
                fem1.cross_reference()
                fem1._xref = True
                spike_fem = read_bdf(fem1.bdf_filename, encoding=encoding)

                remake = False
                if remake:
                    log = fem1.log
                    fem1.save('model.obj')
                    fem1.save('model.obj', unxref=False)
                    fem1.write_bdf('spike_out.bdf')
                    fem1.get_bdf_stats()

                    fem1 = BDF()
                    fem1.load('model.obj')
                    fem1.write_bdf('spike_in.bdf')
                    fem1.log = log
                    fem1.get_bdf_stats()

                    fem1.cross_reference()
                    #fem1.get_bdf_stats()
                    fem1._xref = True

                #fem1.geom_check(geom_check=True, xref=True)
                #fem1.uncross_reference()
                #fem1.cross_reference()
    except:
        print("failed reading %r" % bdf_model)
        raise
    #fem1.sumForces()

    if fem1._auto_reject:
        out_model = bdf_model + '.rej'
    else:
        out_model = bdf_model + '_out'
        if cid is not None and xref:
            fem1.resolve_grids(cid=cid)

        if mesh_form == 'combined':
            fem1.write_bdf(out_model, interspersed=False, size=size, is_double=is_double)
        elif mesh_form == 'separate':
            fem1.write_bdf(out_model, interspersed=False, size=size, is_double=is_double)
        else:
            msg = "mesh_form=%r; allowedForms=['combined','separate']" % mesh_form
            raise NotImplementedError(msg)
        #fem1.writeAsCTRIA3(out_model)

    fem1._get_maps()
    return out_model, fem1
开发者ID:marcinch18,项目名称:pyNastran,代码行数:87,代码来源:test_bdf.py


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