Changeset 8950
- Timestamp:
- Aug 9, 2013, 4:30:31 PM (11 years ago)
- Location:
- trunk/anuga_core/source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/structures/structure_operator.py
r8876 r8950 193 193 # set outflow 194 194 if old_inflow_depth > 0.0 : 195 195 timestep_star = timestep*new_inflow_depth/old_inflow_depth 196 196 else: 197 197 timestep_star = 0.0 -
trunk/anuga_core/source/anuga/utilities/plot_utils.py
r8845 r8950 200 200 """ 201 201 def __init__(self,p, velocity_extrapolation=False): 202 202 203 self.time, self.x, self.y, self.stage, self.xmom,\ 203 204 self.ymom, self.elev, self.xvel, \ … … 213 214 # Make 3 arrays, each containing one index of a vertex of every triangle. 214 215 l=len(p.vols) 215 vols0=numpy.zeros(l, dtype='int')216 vols1=numpy.zeros(l, dtype='int')217 vols2=numpy.zeros(l, dtype='int')216 #vols0=numpy.zeros(l, dtype='int') 217 #vols1=numpy.zeros(l, dtype='int') 218 #vols2=numpy.zeros(l, dtype='int') 218 219 219 220 # FIXME: 22/2/12/ - I think this loop is slow, should be able to do this 220 221 # another way 221 for i in range(l): 222 vols0[i]=p.vols[i][0] 223 vols1[i]=p.vols[i][1] 224 vols2[i]=p.vols[i][2] 222 # for i in range(l): 223 # vols0[i]=p.vols[i][0] 224 # vols1[i]=p.vols[i][1] 225 # vols2[i]=p.vols[i][2] 226 227 228 229 vols0=p.vols[:,0] 230 vols1=p.vols[:,1] 231 vols2=p.vols[:,2] 232 233 #print vols0.shape 234 #print p.vols.shape 225 235 226 236 # Then use these to compute centroid averages … … 262 272 xvel_cent[i,:]=xmom_cent[i,:]/(stage_cent[i,:]-elev_cent+1.0e-06)*(stage_cent[i,:]>elev_cent+p.minimum_allowed_height) 263 273 yvel_cent[i,:]=ymom_cent[i,:]/(stage_cent[i,:]-elev_cent+1.0e-06)*(stage_cent[i,:]>elev_cent+p.minimum_allowed_height) 264 274 275 265 276 266 277 # Compute velocity … … 378 389 ######################## 379 390 # TRIANGLE AREAS, WATER VOLUME 380 def triangle_areas(p, subset= 'null'):391 def triangle_areas(p, subset=None): 381 392 # Compute areas of triangles in p -- assumes p contains vertex information 382 393 # subset = vector of centroid indices to include in the computation. 383 394 384 if(subset =='null'):395 if(subset is None): 385 396 subset=range(len(p.vols[:,0])) 386 397 … … 406 417 ### 407 418 408 def water_volume(p,p2, per_unit_area=False, subset= 'null'):419 def water_volume(p,p2, per_unit_area=False, subset=None): 409 420 # Compute the water volume from p(vertex values) and p2(centroid values) 410 421 411 if(subset =='null'):422 if(subset is None): 412 423 subset=range(len(p2.x)) 413 424 … … 431 442 432 443 433 444 def get_triangle_containing_point(p,point): 445 446 V = p.vols 447 448 x = p.x 449 y = p.y 450 451 l = len(x) 452 453 from anuga.geometry.polygon import is_outside_polygon,is_inside_polygon 454 455 # FIXME: Horrible brute force 456 for i in xrange(l): 457 i0 = V[i,0] 458 i1 = V[i,1] 459 i2 = V[i,2] 460 poly = [ [x[i0], y[i0]], [x[i1], y[i1]], [x[i2], y[i2]] ] 461 462 if is_inside_polygon(point, poly, closed=True): 463 return i 464 465 msg = 'Point %s not found within a triangle' %str(point) 466 raise Exception(msg) 467 468 469 def get_extent(p): 470 471 import numpy 472 473 x_min = numpy.min(p.x) 474 x_max = numpy.max(p.x) 475 476 y_min = numpy.min(p.y) 477 y_max = numpy.max(p.y) 478 479 return x_min, x_max, y_min, y_max 480 481 482 483 -
trunk/anuga_core/source/anuga_parallel/parallel_boyd_box_operator.py
r8875 r8950 191 191 # Get attribute from outflow enquiry point 192 192 if self.myid == self.master_proc: 193 193 194 if self.myid == self.enquiry_proc[self.outflow_index]: 194 195 outflow_enq_depth = self.inlets[self.outflow_index].get_enquiry_depth() -
trunk/anuga_core/source/anuga_parallel/parallel_shallow_water.py
r8664 r8950 229 229 230 230 if myid == 0: 231 232 fig = plt.figure() 231 233 fx = {} 232 234 fy = {} … … 252 254 triang = num.array(range(0,3*n)) 253 255 triang.shape = (n, 3) 254 plt.triplot(fx[i], fy[i], triang, 'g-' )256 plt.triplot(fx[i], fy[i], triang, 'g-', linewidth = 0.5) 255 257 256 258 # Plot ghost triangles … … 260 262 triang = num.array(range(0,3*n)) 261 263 triang.shape = (n, 3) 262 plt.triplot(gx[i], gy[i], triang, 'b--' )264 plt.triplot(gx[i], gy[i], triang, 'b--', linewidth = 0.5) 263 265 264 266 # Save triangulation to location pointed by filename 265 plt.savefig(filename )267 plt.savefig(filename, dpi=600) 266 268 267 269 else: -
trunk/anuga_core/source/anuga_parallel/parallel_structure_operator.py
r8877 r8950 308 308 gain = outflow_extra_depth*outflow_area 309 309 310 # Update Stats310 # Update Stats 311 311 self.discharge = Q#outflow_extra_depth*self.outflow.get_area()/timestep 312 312 self.velocity = barrel_speed#self.discharge/outlet_depth/self.width -
trunk/anuga_core/source/anuga_parallel/run_parallel_sw_merimbula.py
r8871 r8950 43 43 #-------------------------------------------------------------------------- 44 44 45 mesh_filename = "merimbula_10785_1.tsh" ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 10; finaltime = 10 0045 mesh_filename = "merimbula_10785_1.tsh" ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 10; finaltime = 10 46 46 #mesh_filename = "merimbula_17156.tsh" ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 50; finaltime = 500 47 47 #mesh_filename = "merimbula_43200_1.tsh" ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 50; finaltime = 500 … … 113 113 114 114 domain.set_flow_algorithm('2_0') 115 #domain.set_store_vertices_smoothly(True)116 117 #domain.smooth = False118 #domain.set_default_order(2)119 #domain.set_timestepping_method('rk2')120 #domain.set_CFL(0.7)121 #domain.set_beta(1.5)122 115 123 116 … … 197 190 domain.sww_merge(delete_old=False) 198 191 192 193 domain.dump_triangulation() 194 199 195 finalize() 200 196 -
trunk/anuga_core/source/anuga_validation_tests/analytical_exact/runup_on_sinusoid_beach
-
Property
svn:ignore
set to
.deps
-
Property
svn:ignore
set to
-
trunk/anuga_core/source/anuga_validation_tests/other_references/radial_dam_break_wet
-
Property
svn:ignore
set to
.deps
-
Property
svn:ignore
set to
Note: See TracChangeset
for help on using the changeset viewer.