本文整理汇总了Python中anuga.Domain.get_triangle_containing_point方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.get_triangle_containing_point方法的具体用法?Python Domain.get_triangle_containing_point怎么用?Python Domain.get_triangle_containing_point使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anuga.Domain
的用法示例。
在下文中一共展示了Domain.get_triangle_containing_point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parallel_time_varying_file_boundary_sts
# 需要导入模块: from anuga import Domain [as 别名]
# 或者: from anuga.Domain import get_triangle_containing_point [as 别名]
#.........这里部分代码省略.........
domain_fbound=None
barrier()
if ( verbose and myid == 0 ):
print 'DISTRIBUTING PARALLEL DOMAIN'
domain_fbound = distribute(domain_fbound)
#--------------------------------------------------------------------
# Find which sub_domain in which the interpolation points are located
#
# Sometimes the interpolation points sit exactly
# between two centroids, so in the parallel run we
# reset the interpolation points to the centroids
# found in the sequential run
#--------------------------------------------------------------------
interpolation_points = [[279000,664000], [280250,664130],
[279280,665400], [280500,665000]]
interpolation_points=num.array(interpolation_points)
#if myid==0:
# import pylab as P
# boundary_polygon=num.array(boundary_polygon)
# P.plot(boundary_polygon[:,0],boundary_polygon[:,1])
# P.plot(interpolation_points[:,0],interpolation_points[:,1],'ko')
# P.show()
fbound_gauge_values = []
fbound_proc_tri_ids = []
for i, point in enumerate(interpolation_points):
fbound_gauge_values.append([]) # Empty list for timeseries
try:
k = domain_fbound.get_triangle_containing_point(point)
if domain_fbound.tri_full_flag[k] == 1:
fbound_proc_tri_ids.append(k)
else:
fbound_proc_tri_ids.append(-1)
except:
fbound_proc_tri_ids.append(-2)
if verbose: print 'P%d has points = %s' %(myid, fbound_proc_tri_ids)
#------------------------------------------------------------
# Set boundary conditions
#------------------------------------------------------------
Bf = File_boundary(sts_file+'.sts',
domain_fbound,
boundary_polygon=boundary_polygon)
Br = Reflective_boundary(domain_fbound)
domain_fbound.set_boundary({'ocean': Bf,'otherocean': Br})
#------------------------------------------------------------
# Evolve the domain on each processor
#------------------------------------------------------------
for i, t in enumerate(domain_fbound.evolve(yieldstep=yieldstep,
finaltime=finaltime,
skip_initial_step = False)):
stage = domain_fbound.get_quantity('stage')
for i in range(4):
if fbound_proc_tri_ids[i] > -1:
fbound_gauge_values[i].append(stage.centroid_values[fbound_proc_tri_ids[i]])