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


Python PISM.exactI方法代码示例

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


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

示例1: initSSACoefficients

# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactI [as 别名]
  def initSSACoefficients(self):
    solver = self.solver
    solver.allocateBCs()
    solver.bc_mask.set(0)
    solver.thickness.set(H0_schoof)
    solver.ice_mask.set(PISM.MASK_GROUNDED)

    # The finite difference code uses the following flag to treat 
    # the non-periodic grid correctly.
    self.config.set_flag("compute_surf_grad_inward_ssa", True);
    self.config.set("epsilon_ssafd", 0.0);  # don't use this lower bound

    standard_gravity = self.config.get("standard_gravity");
    theta = math.atan(0.001)
    f = self.ice.rho*standard_gravity*H0_schoof*math.tan(theta)
    grid = self.grid
    with PISM.util.Access([solver.tauc]):
      for (i,j) in grid.points():
        y=grid.y[j]
        solver.tauc[i,j] = f* (abs(y/L_schoof)**m_schoof)
    solver.tauc.beginGhostComm(); solver.tauc.endGhostComm();


    bc_mask = solver.bc_mask
    vel_bc  = self.solver.vel_bc
    surface = solver.surface
    bed     = solver.bed

    grid = self.grid
    vars = [surface,bed,vel_bc,bc_mask]
    with PISM.util.Access(vars):
      for (i,j) in grid.points():
        x=grid.x[i]; y=grid.y[j]
        (bed_ij,junk,u,v) = PISM.exactI(m_schoof,x,y)
        bed[i,j] = bed_ij
        surface[i,j] = bed_ij + H0_schoof

        edge = ( (j == 0) or (j == grid.My - 1) ) or ( (i==0) or (i==grid.Mx-1) );
        if (edge):
          bc_mask[i,j] = 1;
          vel_bc[i,j].u = u;
          vel_bc[i,j].v = v;

    for v in vars:
      v.beginGhostComm(); v.endGhostComm()
开发者ID:matthiasmengel,项目名称:pism,代码行数:47,代码来源:ssa_testi.py

示例2: _initSSACoefficients

# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactI [as 别名]
    def _initSSACoefficients(self):
        self._allocStdSSACoefficients()
        self._allocateBCs()
        vecs = self.modeldata.vecs

        vecs.bc_mask.set(0)
        vecs.thk.set(H0_schoof)
        vecs.mask.set(PISM.MASK_GROUNDED)

        # The finite difference code uses the following flag to treat
        # the non-periodic grid correctly.
        self.config.set_boolean("stress_balance.ssa.compute_surface_gradient_inward", True)
        self.config.set_double("stress_balance.ssa.epsilon", 0.0)  # don't use this lower bound

        standard_gravity = self.config.get_double("constants.standard_gravity")
        ice_rho = self.config.get_double("constants.ice.density")
        theta = math.atan(0.001)
        f = ice_rho * standard_gravity * H0_schoof * math.tan(theta)
        grid = self.grid
        with PISM.vec.Access(comm=[vecs.tauc]):
            for (i, j) in grid.points():
                y = grid.y(j)
                vecs.tauc[i, j] = f * (abs(y / L_schoof) ** m_schoof)

        bc_mask = vecs.bc_mask
        vel_bc = vecs.vel_bc
        surface = vecs.surface_altitude
        bed = vecs.bedrock_altitude
        grid = self.grid
        with PISM.vec.Access(comm=[surface, bed, vel_bc, bc_mask]):
            for (i, j) in grid.points():
                p = PISM.exactI(m_schoof, grid.x(i), grid.y(j))
                bed[i, j] = p.bed
                surface[i, j] = p.bed + H0_schoof

                edge = ((j == 0) or (j == grid.My() - 1)) or ((i == 0) or (i == grid.Mx() - 1))
                if edge:
                    bc_mask[i, j] = 1
                    vel_bc[i, j].u = p.u
                    vel_bc[i, j].v = p.v
开发者ID:pism,项目名称:pism,代码行数:42,代码来源:ssa_testi.py

示例3: exactSolution

# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactI [as 别名]
 def exactSolution( self, i, j, x, y ):
   (j1,j2,u,v) = PISM.exactI(m_schoof,x,y)
   return [u,v]
开发者ID:matthiasmengel,项目名称:pism,代码行数:5,代码来源:ssa_testi.py

示例4: exactSolution

# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactI [as 别名]
 def exactSolution(self, i, j, x, y):
     p = PISM.exactI(m_schoof, x, y)
     return [p.u, p.v]
开发者ID:pism,项目名称:pism,代码行数:5,代码来源:ssa_testi.py


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