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


Python PISM.optionsListWasSet方法代码示例

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


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

示例1: setFromOptions

# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import optionsListWasSet [as 别名]
  def setFromOptions(self):

    for o in PISM.OptionsGroup(self.grid.com,"","SSA options"):
      (ssa_method,wasSet) = PISM.optionsListWasSet(self.grid.com, "-ssa_method", 
                                    "Algorithm for computing the SSA solution",
                                    ["fem","fd","fem_f"], "fd")
      if wasSet: self.config.set_string("ssa_method",ssa_method);
      self.config.scalar_from_option("ssa_epsfd",  "epsilon_ssafd");
      self.config.scalar_from_option("ssa_maxi", "max_iterations_ssafd");
      self.config.scalar_from_option("ssa_rtol", "ssafd_relative_convergence");
开发者ID:matthiasmengel,项目名称:pism,代码行数:12,代码来源:ssa.py

示例2: _initGrid

# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import optionsListWasSet [as 别名]
    def _initGrid(self):
        """Override of :meth:`SSARun._initGrid`. Sets periodicity based on
        ``-periodicity`` command-line option."""
        # FIXME: allow specification of Mx and My different from what's
        # in the boot_file.
        periodicity = PISM.XY_PERIODIC
        (pstring, pflag) = PISM.optionsListWasSet('-periodicity', "Grid periodicity",
                                                  'x,y,xy,none', 'xy')
        if pflag:
            pdict = {'x': PISM.X_PERIODIC, 'y': PISM.Y_PERIODIC,
                     'xy': PISM.XY_PERIODIC, 'none': PISM.NOT_PERIODIC}
            periodicity = pdict[pstring]
        else:
            if self.is_regional and (self.config.get_string("ssa_method") == "fem"):
                periodicity = PISM.NOT_PERIODIC

        self.grid = PISM.IceGrid.FromFile(PISM.Context().ctx, self.boot_file, "enthalpy",
                                          periodicity)
开发者ID:crodehacke,项目名称:PISMcr,代码行数:20,代码来源:ssa.py

示例3: _initGrid

# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import optionsListWasSet [as 别名]
 def _initGrid(self):
     """Initialize grid size and periodicity. Called from :meth:`PISM.ssa.SSARun.setup`."""
     # The implementation in PISM.ssa.SSAFromInputFile uses a non-periodic
     # grid only if the run is regional and "ssa_method=fem" in the config
     # file.  For inversions, we always use an FEM type method, so for
     # regional inversions, we always use a non-periodic grid.
     periodicity = PISM.XY_PERIODIC
     (pstring, pflag) = PISM.optionsListWasSet('-periodicity', "Grid periodicity",
                                               'x,y,xy,none', 'xy')
     if pflag:
         pdict = {'x': PISM.X_PERIODIC, 'y': PISM.Y_PERIODIC,
                  'xy': PISM.XY_PERIODIC, 'none': PISM.NOT_PERIODIC}
         periodicity = pdict[pstring]
     else:
         periodicity = PISM.XY_PERIODIC
         if self.is_regional:
             periodicity = PISM.NOT_PERIODIC
     self.grid = PISM.IceGrid.FromFile(PISM.Context().ctx, self.input_filename, "enthalpy",
                                       periodicity)
开发者ID:crodehacke,项目名称:PISMcr,代码行数:21,代码来源:ssa.py


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