Changeset 8301
- Timestamp:
- Jan 17, 2012, 5:01:09 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/shallow_water/forcing.py
r8293 r8301 497 497 def __parallel_safe(self): 498 498 499 return False499 return True 500 500 501 501 class Rainfall(General_forcing): -
trunk/anuga_core/source/anuga_parallel/parallel_operator_factory.py
r8227 r8301 36 36 """ 37 37 38 def Inlet_operator(domain, line, Q, master_proc = 0, procs = range(0,pypar.size()), debug = False): 38 def Inlet_operator(domain, 39 line, 40 Q, 41 description = None, 42 label = None, 43 logging = False, 44 master_proc = 0, 45 procs = range(0,pypar.size()), 46 verbose = False): 39 47 40 48 # If not parallel domain then allocate serial Inlet operator 41 49 if isinstance(domain, Parallel_domain) is False: 42 if debug: print "Allocating non parallel inlet operator ....." 43 return anuga.structures.inlet_operator.Inlet_operator(domain, line, Q) 50 if verbose: print "Allocating non parallel inlet operator ....." 51 return anuga.structures.inlet_operator.Inlet_operator(domain, 52 line, 53 Q, 54 description = description, 55 label = label, 56 logging = logging, 57 verbose = verbose) 44 58 45 59 … … 47 61 48 62 49 alloc, inlet_master_proc, inlet_procs, enquiry_proc = allocate_inlet_procs(domain, line, 63 alloc, inlet_master_proc, inlet_procs, enquiry_proc = allocate_inlet_procs(domain, 64 line, 50 65 master_proc = master_proc, 51 procs = procs, debug = debug) 66 procs = procs, 67 verbose = verbose) 52 68 53 69 54 70 55 71 if alloc: 56 if debugand myid == inlet_master_proc:72 if verbose and myid == inlet_master_proc: 57 73 print "Parallel Inlet Operator =================" 58 74 print "Line = " + str(line) … … 61 77 print "=========================================" 62 78 63 return Parallel_Inlet_operator(domain, line, Q, master_proc = inlet_master_proc, procs = inlet_procs) 79 return Parallel_Inlet_operator(domain, 80 line, 81 Q, 82 description = description, 83 label = label, 84 logging = logging, 85 master_proc = inlet_master_proc, 86 procs = inlet_procs, 87 verbose = verbose) 64 88 else: 65 89 return None … … 92 116 verbose=False, 93 117 master_proc=0, 94 procs=range(0,pypar.size()), 95 debug = False): 118 procs=range(0,pypar.size())): 96 119 97 120 # If not parallel domain then allocate serial Boyd box operator 98 121 if isinstance(domain, Parallel_domain) is False: 99 if debug: print "Allocating non parallel boyd box operator ....."122 if verbose: print "Allocating non parallel boyd box operator ....." 100 123 return anuga.structures.boyd_box_operator.Boyd_box_operator(domain, 101 124 losses, … … 162 185 alloc0, inlet0_master_proc, inlet0_procs, enquiry0_proc = allocate_inlet_procs(domain, line0, enquiry_point = enquiry_point0, 163 186 master_proc = master_proc, 164 procs = procs, debug = debug)187 procs = procs, verbose=verbose) 165 188 166 189 # Determine processors associated with second inlet … … 170 193 alloc1, inlet1_master_proc, inlet1_procs, enquiry1_proc = allocate_inlet_procs(domain, line1, enquiry_point = enquiry_point1, 171 194 master_proc = master_proc, 172 procs = procs, debug = debug)195 procs = procs, verbose=verbose) 173 196 174 197 structure_procs = list(set(inlet0_procs + inlet1_procs)) … … 177 200 enquiry_proc = [enquiry0_proc, enquiry1_proc] 178 201 179 if myid == master_proc and debug:202 if myid == master_proc and verbose: 180 203 print "Parallel Boyd Box Operator =============================" 181 204 print "Structure Master Proc is P" + str(inlet0_master_proc) … … 284 307 285 308 286 def allocate_inlet_procs(domain, line, enquiry_point = None, master_proc = 0, procs = range(0, pypar.size()), debug= False):309 def allocate_inlet_procs(domain, line, enquiry_point = None, master_proc = 0, procs = range(0, pypar.size()), verbose = False): 287 310 288 311 myid = pypar.rank() … … 301 324 tri_id = line_intersect(vertex_coordinates, line) 302 325 303 if debug:326 if verbose: 304 327 print "P%d has %d triangles on line %s" %(myid, len(tri_id), line) 305 328 … … 313 336 size = size + 1 314 337 has_enq_point = True 315 if debug: print "P%d has enq point %s" %(myid, enquiry_point)338 if verbose: print "P%d has enq point %s" %(myid, enquiry_point) 316 339 else: 317 if debug: print "P%d contains ghost copy of enq point %s" %(myid, enquiry_point)340 if verbose: print "P%d contains ghost copy of enq point %s" %(myid, enquiry_point) 318 341 has_enq_point = False 319 342 except: 320 if debug: print "P%d does not contain enq point %s" %(myid, enquiry_point)343 if verbose: print "P%d does not contain enq point %s" %(myid, enquiry_point) 321 344 has_enq_point = False 322 345 … … 380 403 381 404 if __name__ == "__main__": 382 print " Hello World"405 print "Parallel operator factory" -
trunk/anuga_core/source/anuga_parallel/parallel_shallow_water.py
r8291 r8301 220 220 for i in range(0, numprocs): 221 221 n = int(len(gx[i])/3) 222 223 triang = num.array(range(0,3*n))224 triang.shape = (n, 3)225 plt.triplot(gx[i], gy[i], triang, 'b--')222 if n > 0: 223 triang = num.array(range(0,3*n)) 224 triang.shape = (n, 3) 225 plt.triplot(gx[i], gy[i], triang, 'b--') 226 226 227 227 # Save triangulation to location pointed by filename -
trunk/anuga_core/source/anuga_parallel/test_parallel_frac_op.py
r8260 r8301 154 154 boyd_box0 = None 155 155 156 inlet0 = Inlet_operator(domain, line0, Q0, debug= False)157 inlet1 = Inlet_operator(domain, line1, Q1, debug= False)156 inlet0 = Inlet_operator(domain, line0, Q0, verbose = False) 157 inlet1 = Inlet_operator(domain, line1, Q1, verbose = False) 158 158 159 159 # Enquiry point [ 19. 2.5] is contained in two domains in 4 proc case … … 167 167 use_velocity_head=False, 168 168 manning=0.013, 169 verbose=False , debug = False)169 verbose=False) 170 170 171 171 if inlet0 is not None: inlet0.print_statistics() … … 174 174 175 175 # if parallel: 176 # factory = Parallel_operator_factory(domain, debug= True)176 # factory = Parallel_operator_factory(domain, verbose = True) 177 177 # 178 178 # inlet0 = factory.inlet_operator_factory(line0, Q0) … … 210 210 211 211 for t in domain.evolve(yieldstep = 0.1, finaltime = 38): 212 domain.write_time() 212 if myid == 0: 213 domain.write_time() 213 214 214 215 #print domain.volumetric_balance_statistics() … … 302 303 test_points = pypar.receive(0) 303 304 304 print "Test Points::"305 print test_points305 #print "Test Points::" 306 #print test_points 306 307 307 308 if myid == 0: -
trunk/anuga_work/shallow_water_balanced_steve/run_sw_merimbula.py
r8288 r8301 26 26 27 27 from swb_domain import Domain 28 #from anuga import Domain 28 29 from anuga import Reflective_boundary 29 30 from anuga import Dirichlet_boundary
Note: See TracChangeset
for help on using the changeset viewer.