Changeset 1436
- Timestamp:
- May 19, 2005, 5:47:00 PM (20 years ago)
- Location:
- inundation/ga/storm_surge
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/Hobart/Run_noca.py
r1434 r1436 24 24 ###################### 25 25 # Domain 26 filename = 'Noca_mesh_1000.tsh' 26 filename = 'Noca_mesh_1000.tsh' 27 27 print 'Creating domain from', filename 28 28 domain = pmesh_to_domain_instance(filename, Domain) … … 31 31 #-------------------- 32 32 # Order of the scheme 33 domain.default_order = 133 domain.default_order = 2 34 34 domain.smooth = True 35 35 … … 69 69 yieldstep = 0.1 70 70 finaltime = 10 71 71 72 72 ###################### 73 73 #Evolution … … 77 77 domain.write_time() 78 78 domain.visualiser.update_quantity_color('friction',(1.0,0.0,0.0)) 79 79 80 80 print 'That took %.2f seconds' %(time.time()-t0) 81 81 82 -
inundation/ga/storm_surge/parallel/parallel_advection.py
r1428 r1436 81 81 # the separate processors 82 82 83 from weave import converters 84 83 85 stage_cv = self.quantities['stage'].centroid_values 84 86 … … 92 94 Idf = self.full_send_dict[send_proc][0] 93 95 Xout = self.full_send_dict[send_proc][1] 94 for i, _ in enumerate(Xout): 96 N = len(Xout) 97 98 """ 99 # Original python Code 100 for i in range(N): 95 101 Xout[i] = stage_cv[Idf[i]] 102 """ 103 code1 = """ 104 for (int i=0; i<N ; i++){ 105 Xout(i) = stage_cv(Idf(i)); 106 } 107 """ 108 weave.inline(code1, ['stage_cv','Idf','Xout','N'], 109 type_converters = converters.blitz, compiler='gcc'); 96 110 97 111 pypar.send(Xout,send_proc) … … 104 118 105 119 X = pypar.receive(iproc,X) 120 N = len(X) 106 121 #print 'Processor %d receiving from Processor %d'%(self.processor,iproc) 107 for i , _ in enumerate(X):122 for i in range(N): 108 123 stage_cv[Idg[i]] = X[i] 109 124 pypar.barrier() … … 115 130 #print Idf 116 131 Idg = self.ghost_recv_dict[iproc][0] 132 N = len(Idg) 117 133 #print Idg 118 for i , _ in enumerate(Idf):134 for i in range(N): 119 135 #print i,Idg[i],Idf[i] 120 136 stage_cv[Idg[i]] = stage_cv[Idf[i]] -
inundation/ga/storm_surge/parallel/run_parallel_advection.py
r1428 r1436 18 18 19 19 20 N = 20 21 M = 20 20 #N = 50 21 N = 25 22 M = 25 22 23 23 points, vertices, boundary, full_send_dict, ghost_recv_dict = parallel_rectangular(N, M )24 points, vertices, boundary, full_send_dict, ghost_recv_dict = parallel_rectangular(N, M, len1=1.0) 24 25 25 26 #Create advection domain with direction (1,-1) … … 29 30 # Initial condition is zero by default 30 31 31 domain.initialise_visualiser()32 #domain.initialise_visualiser() 32 33 33 34 #Boundaries … … 55 56 if myid == 0: 56 57 domain.set_quantity('stage', Set_Stage(0.2,0.4,1.0)) 58 import time 59 t0 = time.time() 57 60 58 61 #Check that the boundary value gets propagated to all elements 59 for t in domain.evolve(yieldstep = 0.1, finaltime = 3.0):62 for t in domain.evolve(yieldstep = 0.1, finaltime = 2.0): 60 63 if myid == 0: 61 64 domain.write_time() 62 65 63 66 if myid == 0: 64 print ' Evolution ended'67 print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset
for help on using the changeset viewer.