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


Python Struct.ebc方法代码示例

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


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

示例1: solve_direct

# 需要导入模块: from sfepy.base.base import Struct [as 别名]
# 或者: from sfepy.base.base.Struct import ebc [as 别名]
def solve_direct(conf, options, problem=None, step_hook=None,
                 post_process_hook=None, post_process_hook_final=None,
                 pre_process_hook=None, nls_status=None):
    """Generic (simple) problem solver."""

    if problem is None:
        is_eqs = not options.solve_not
        problem = ProblemDefinition.from_conf(conf, init_equations=is_eqs)

        problem.setup_default_output(conf, options)

    if pre_process_hook is not None: # User pre_processing.
        pre_process_hook(problem)

    ofn_trunk = problem.ofn_trunk

    save_names = Struct( ebc = None, regions = None,
                         regions_as_groups = None, field_meshes = None,
                         region_field_meshes = None )
    if options.save_ebc:
        save_names.ebc = ofn_trunk + '_ebc.vtk'
    if options.save_regions:
        save_names.regions = ofn_trunk + '_region'
    if options.save_regions_as_groups:
        save_names.regions_as_groups = ofn_trunk + '_regions'
    if options.save_field_meshes:
        save_names.field_meshes = ofn_trunk + '_field'

    is_extra_save = False
    for name, val in save_names.to_dict().iteritems():
        if val is not None:
            is_extra_save = True
            break
    if is_extra_save:
        save_only( conf, save_names, problem=problem )

    if options.solve_not:
        return None, None, None

    if hasattr( conf.options, 'ts' ):
        ##
        # Time-dependent problem.
        state = solve_evolutionary_op(problem, options,
                                      step_hook=step_hook,
                                      post_process_hook=post_process_hook,
                                      nls_status=nls_status)
    else:
        ##
        # Stationary problem.
        state = solve_stationary_op(problem, options,
                                    post_process_hook=post_process_hook,
                                    nls_status=nls_status)

    if post_process_hook_final is not None: # User postprocessing.
       post_process_hook_final(problem, state)

    return problem, state
开发者ID:renatocoutinho,项目名称:sfepy,代码行数:59,代码来源:generic.py


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