本文整理汇总了Python中anuga.Domain.add_quantity方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.add_quantity方法的具体用法?Python Domain.add_quantity怎么用?Python Domain.add_quantity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anuga.Domain
的用法示例。
在下文中一共展示了Domain.add_quantity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_values
# 需要导入模块: from anuga import Domain [as 别名]
# 或者: from anuga.Domain import add_quantity [as 别名]
# get_values(interpolation_points=[[12, 3]])
#print 'Elevation at pole location = %.2fm' % z
# Start variable elevation after 10 seconds
if t > 10 and not (shrinking or growing or done):
growing = True
# Stop growing when pole has reached a certain height
if t > 16 and growing:
growing = False
shrinking = False
# Start shrinking
if t > 20:
shrinking = True
growing = False
# Stop changing when pole has shrunk to original level
if t > 25 and shrinking:
done = True
shrinking = growing = False
domain.set_quantity('elevation', topography)
# Grow or shrink
if growing:
domain.add_quantity('elevation', pole_increment)
if shrinking:
domain.add_quantity('elevation', lambda x,y: -2*pole_increment(x,y))