本文整理汇总了Python中sfepy.solvers.solvers.LinearSolver.process_conf方法的典型用法代码示例。如果您正苦于以下问题:Python LinearSolver.process_conf方法的具体用法?Python LinearSolver.process_conf怎么用?Python LinearSolver.process_conf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfepy.solvers.solvers.LinearSolver
的用法示例。
在下文中一共展示了LinearSolver.process_conf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_conf
# 需要导入模块: from sfepy.solvers.solvers import LinearSolver [as 别名]
# 或者: from sfepy.solvers.solvers.LinearSolver import process_conf [as 别名]
def process_conf( conf ):
"""
Missing items are set to default values.
Example configuration, all items::
solver_120 = {
'name' : 'ls120',
'kind' : 'ls.petsc',
'method' : 'cg', # ksp_type
'precond' : 'icc', # pc_type
'eps_a' : 1e-12, # abstol
'eps_r' : 1e-12, # rtol
'i_max' : 1000, # maxits
}
"""
get = conf.get_default_attr
method = get( 'method', 'cg' )
precond = get( 'precond', 'icc' )
eps_a = get( 'eps_a', 1e-8 )
eps_r = get( 'eps_r', 1e-8 )
i_max = get( 'i_max', 100 )
common = LinearSolver.process_conf( conf )
return Struct( **locals() ) + common
示例2: process_conf
# 需要导入模块: from sfepy.solvers.solvers import LinearSolver [as 别名]
# 或者: from sfepy.solvers.solvers.LinearSolver import process_conf [as 别名]
def process_conf(conf, kwargs):
"""
Missing items are set to default values.
Example configuration, all items::
solver_120 = {
'name' : 'ls120',
'kind' : 'ls.petsc',
'method' : 'cg', # ksp_type
'precond' : 'icc', # pc_type
'precond_side' : 'left', # ksp_pc_side
'eps_a' : 1e-12, # abstol
'eps_r' : 1e-12, # rtol
'eps_d' : 1e5, # divtol
'i_max' : 1000, # maxits
}
"""
get = make_get_conf(conf, kwargs)
common = LinearSolver.process_conf(conf)
return Struct(method=get('method', 'cg'),
precond=get('precond', 'icc'),
precond_side=get('precond_side', None),
i_max=get('i_max', 100),
eps_a=get('eps_a', 1e-8),
eps_r=get('eps_r', 1e-8),
eps_d=get('eps_d', 1e5)) + common
示例3: process_conf
# 需要导入模块: from sfepy.solvers.solvers import LinearSolver [as 别名]
# 或者: from sfepy.solvers.solvers.LinearSolver import process_conf [as 别名]
def process_conf(conf, kwargs):
"""
Missing items are set to default values.
Example configuration, all items::
solver_1100 = {
'name' : 'dls1100',
'kind' : 'ls.scipy_direct',
'method' : 'superlu',
'presolve' : False,
'warn' : True,
}
"""
get = make_get_conf(conf, kwargs)
common = LinearSolver.process_conf(conf)
return (
Struct(
method=get("method", "auto"),
presolve=get("presolve", False),
warn=get("warn", True),
i_max=None,
eps_a=None,
eps_r=None,
)
+ common
)
示例4: process_conf
# 需要导入模块: from sfepy.solvers.solvers import LinearSolver [as 别名]
# 或者: from sfepy.solvers.solvers.LinearSolver import process_conf [as 别名]
def process_conf(conf):
"""
Missing items are set to default values.
Example configuration, all items:
solver_102 = {
'name' : 'ls102',
'kind' : 'ls.pyamg',
'method' : 'smoothed_aggregation_solver',
'eps_a' : 1e-12,
}
"""
get = conf.get_default_attr
method = get("method", "smoothed_aggregation_solver")
eps_a = get("eps_a", 1e-8)
common = LinearSolver.process_conf(conf)
return Struct(**locals()) + common