本文整理汇总了Python中PISM.context_from_options方法的典型用法代码示例。如果您正苦于以下问题:Python PISM.context_from_options方法的具体用法?Python PISM.context_from_options怎么用?Python PISM.context_from_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PISM
的用法示例。
在下文中一共展示了PISM.context_from_options方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: flowlaw_test
# 需要导入模块: import PISM [as 别名]
# 或者: from PISM import context_from_options [as 别名]
def flowlaw_test():
ctx = PISM.context_from_options(PISM.PETSc.COMM_WORLD, "flowlaw_test")
EC = ctx.enthalpy_converter()
ff = PISM.FlowLawFactory("sia_", ctx.config(), EC)
law = ff.create()
TpaC = [-30, -5, 0, 0]
depth = 2000
gs = 1e-3
omega = [0.0, 0.0, 0.0, 0.005]
sigma = [1e4, 5e4, 1e5, 1.5e5]
p = EC.pressure(depth)
Tm = EC.melting_temperature(p)
print "flow law: \"%s\"" % law.name()
print "pressure = %9.3e Pa = (hydrostatic at depth %7.2f m)" % (p, depth)
print "flowtable:"
print " (dev stress) (abs temp) (liq frac) = (flow)"
for i in range(4):
for j in range(4):
T = Tm + TpaC[j]
E = EC.enthalpy(T, omega[j], p)
flowcoeff = law.flow(sigma[i], E, p, gs)
print " %10.2e %10.3f %9.3f = %10.6e" % (sigma[i], T, omega[j], flowcoeff)