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


Python LinearSolver.process_conf方法代码示例

本文整理汇总了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
开发者ID:olivierverdier,项目名称:sfepy,代码行数:29,代码来源:ls.py

示例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
开发者ID:LeiDai,项目名称:sfepy,代码行数:31,代码来源:ls.py

示例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
        )
开发者ID:ZJLi2013,项目名称:sfepy,代码行数:31,代码来源:ls.py

示例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
开发者ID:certik,项目名称:sfepy,代码行数:23,代码来源:ls.py


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