本文整理汇总了Python中PISM.exactJ方法的典型用法代码示例。如果您正苦于以下问题:Python PISM.exactJ方法的具体用法?Python PISM.exactJ怎么用?Python PISM.exactJ使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PISM
的用法示例。
在下文中一共展示了PISM.exactJ方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initSSACoefficients
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactJ [as 别名]
def initSSACoefficients(self):
solver = self.solver
solver.allocateBCs()
solver.tauc.set(0.0) # irrelevant for test J
solver.bed.set(0.0)
solver.ice_mask.set(PISM.MASK_FLOATING)
solver.bc_mask.set(0) # No dirichlet data.
solver.enthalpy.set(528668.35); # arbitrary; corresponds to 263.15 Kelvin at depth=0.
ocean_rho = self.config.get("sea_water_density");
nu0 = 30.0 * 1.0e6 * PISM.secpera; # 9.45e14 Pa s
H0 = 500.0; # 500 m typical thickness
# The PISM.utils.Access object ensures that we call beginAccess for each
# variable in 'vars', and that endAccess is called for each one on exiting
# the 'with' block.
vars = [solver.thickness, solver.surface, solver.bc_mask, solver.vel_bc]
with PISM.util.Access(vars):
grid = self.grid
for (i,j) in grid.points():
x = grid.x[i]; y = grid.y[j]
(H,junk,u,v) = PISM.exactJ(x,y);
solver.thickness[i,j] = H;
solver.surface[i,j] = (1.0 - self.ice.rho / ocean_rho) * H; #// FIXME task #7297
# // special case at center point (Dirichlet BC)
if (i == (grid.Mx)/2) and (j == (grid.My)/2):
solver.bc_mask[i,j] = 1;
solver.vel_bc[i,j] = [u,v]
# // communicate what we have set
for v in vars:
v.beginGhostComm(); v.endGhostComm();
# Test J has a viscosity that is independent of velocity. So we force a
# constant viscosity by settting the strength_extension
# thickness larger than the given ice thickness. (max = 770m).
solver.ssa.strength_extension.set_notional_strength(nu0 * H0);
solver.ssa.strength_extension.set_min_thickness(800.);
示例2: _initSSACoefficients
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactJ [as 别名]
def _initSSACoefficients(self):
self._allocStdSSACoefficients()
self._allocateBCs()
vecs = self.modeldata.vecs
vecs.tauc.set(0.0) # irrelevant for test J
# ensures that the ice is floating (max. thickness if 770 m)
vecs.bedrock_altitude.set(-1000.0)
vecs.mask.set(PISM.MASK_FLOATING)
vecs.bc_mask.set(0) # No dirichlet data.
EC = PISM.EnthalpyConverter(PISM.Context().config)
enth0 = EC.enthalpy(273.15, 0.01, 0) # 0.01 water fraction
vecs.enthalpy.set(enth0)
ocean_rho = self.config.get_double("constants.sea_water.density")
ice_rho = self.config.get_double("constants.ice.density")
# The PISM.vec.Access object ensures that we call beginAccess for each
# variable in 'vars', and that endAccess is called for each one on exiting
# the 'with' block.
with PISM.vec.Access(comm=[vecs.land_ice_thickness,
vecs.surface_altitude,
vecs.bc_mask,
vecs.vel_bc]):
grid = self.grid
for (i, j) in grid.points():
p = PISM.exactJ(grid.x(i), grid.y(j))
vecs.land_ice_thickness[i, j] = p.H
vecs.surface_altitude[i, j] = (1.0 - ice_rho / ocean_rho) * p.H # // FIXME task #7297
# special case at center point (Dirichlet BC)
if (i == grid.Mx() // 2) and (j == grid.My() // 2):
vecs.bc_mask[i, j] = 1
vecs.vel_bc[i, j] = [p.u, p.v]
示例3: exactSolution
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactJ [as 别名]
def exactSolution(self, i, j, x, y):
p = PISM.exactJ(x, y)
return [p.u, p.v]
示例4: exactSolution
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import exactJ [as 别名]
def exactSolution(self,i,j,x,y):
(j1,j2,u,v) = PISM.exactJ(x,y);
return [u,v]