本文整理汇总了Python中anuga.Domain.sww_merge方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.sww_merge方法的具体用法?Python Domain.sww_merge怎么用?Python Domain.sww_merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anuga.Domain
的用法示例。
在下文中一共展示了Domain.sww_merge方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pprint
# 需要导入模块: from anuga import Domain [as 别名]
# 或者: from anuga.Domain import sww_merge [as 别名]
#------------------------------------------------------------------------------
# Produce a documentation of parameters
#------------------------------------------------------------------------------
if myid == 0:
parameter_file=open('parameters.tex', 'w')
parameter_file.write('\\begin{verbatim}\n')
from pprint import pprint
pprint(domain.get_algorithm_parameters(),parameter_file,indent=4)
parameter_file.write('\\end{verbatim}\n')
parameter_file.close()
#------------------------------------------------------------------------------
# Evolve system through time
#------------------------------------------------------------------------------
for t in domain.evolve(yieldstep = 0.1, finaltime = 5.):
#print domain.timestepping_statistics(track_speeds=True)
if myid == 0: print domain.timestepping_statistics()
domain.sww_merge(delete_old=True)
finalize()
#
示例2: Region
# 需要导入模块: from anuga import Domain [as 别名]
# 或者: from anuga.Domain import sww_merge [as 别名]
# Setup region for integrating quantities
#p2 = [ [8.0, 2.5], [9.5, 2.5], [9.5, 4.0], [8.0, 4.0] ]
#reg = Region(domain, polygon=p2)
# Some useful aliases
stage = domain.quantities['stage']
elev = domain.quantities['elevation']
#------------------------------------------------------------------------------
# Evolve system through time
#------------------------------------------------------------------------------
for t in domain.evolve(yieldstep=0.1, finaltime=10.0):
if anuga.myid == 0:
domain.print_timestepping_statistics()
domain.print_operator_timestepping_statistics()
# let calculate the integral of height over a region
height = stage-elev
vol = height.get_integral()
vol=anuga.collect_value(vol)
if anuga.myid == 0: print indent+'Int_p2(h) = '+str(vol)
domain.sww_merge()
anuga.finalize()