本文整理汇总了Python中sfepy.base.base.Struct.regions_as_groups方法的典型用法代码示例。如果您正苦于以下问题:Python Struct.regions_as_groups方法的具体用法?Python Struct.regions_as_groups怎么用?Python Struct.regions_as_groups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfepy.base.base.Struct
的用法示例。
在下文中一共展示了Struct.regions_as_groups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: solve_direct
# 需要导入模块: from sfepy.base.base import Struct [as 别名]
# 或者: from sfepy.base.base.Struct import regions_as_groups [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