本文整理汇总了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()
示例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
示例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]
示例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]