Changeset 8492
- Timestamp:
- Aug 6, 2012, 11:14:34 AM (12 years ago)
- Location:
- trunk/anuga_core/source
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/operators/base_operator.py
r8477 r8492 1 2 from anuga.utilities.system_tools import log_to_file 3 1 4 2 5 class Operator: … … 37 40 38 41 39 if label == None: 40 self.label = "operator_%g" % Operator.counter 41 else: 42 self.label = label + '_%g' % Operator.counter 42 self.set_label(label) 43 43 44 44 … … 96 96 log_to_file(self.log_filename, self.timestepping_statistics()) 97 97 98 def set_label(self, label=None): 99 100 if label == None: 101 self.label = "operator_%g" % Operator.counter 102 else: 103 self.label = label + '_%g' % Operator.counter 98 104 99 105 … … 106 112 self.log_filename = self.label + '.log' 107 113 log_to_file(self.log_filename, self.statistics(), mode='w') 108 log_to_file(self.log_filename, 'time,Q')114 #log_to_file(self.log_filename, 'time,Q') 109 115 110 116 #log_to_file(self.log_filename, self.culvert_type) -
trunk/anuga_core/source/anuga/operators/erosion_operators.py
r8484 r8492 66 66 #----------------------------------------- 67 67 self.setup_node_structures() 68 69 #----------------------------------------- 70 # Some stras for reporting 71 #----------------------------------------- 72 self.max_change = 0 73 68 74 69 75 … … 89 95 #-------------------------------------- 90 96 # Update all three vertices for each cell 97 # associated with self.indices 91 98 #-------------------------------------- 92 99 ind = self.indices 93 100 m = num.sqrt(self.xmom_c[ind]**2 + self.ymom_c[ind]**2) 94 m = num.vstack((m,m,m)).T 101 m = num.vstack((m,m,m)).T # Stack up m to apply to vertices 95 102 m = num.where(m>self.threshold, m, 0.0) 96 self.elev_v[ind] = num.maximum(self.elev_v[ind] - m*dt, self.base) 97 #num.maximum(self.elev_v[ind] - momentum*dt, Z) 98 103 104 de = m*dt 105 self.elev_v[ind] = num.maximum(self.elev_v[ind] - de, self.base) 106 107 self.max_change = num.max(de) 99 108 100 109 return updated … … 188 197 189 198 def timestepping_statistics(self): 190 191 message = indent + self.label + ': Erosion_operator' 199 from anuga import indent 200 201 message = indent + self.label + ': Erosion_operator, time ' 202 message += str(self.get_time())+ ' max(Delta Elev) '+ str(self.max_change) 192 203 return message 193 204 -
trunk/anuga_core/source/anuga_parallel/run_parallel_sw_merimbula.py
r8487 r8492 42 42 #-------------------------------------------------------------------------- 43 43 44 mesh_filename = "merimbula_10785_1.tsh" ; x0 = 756000.0 ; x1 = 756500.045 #mesh_filename = "merimbula_43200.tsh" ; x0 = 756000.0 ; x1 = 756500.044 #mesh_filename = "merimbula_10785_1.tsh" ; x0 = 756000.0 ; x1 = 756500.0 45 mesh_filename = "merimbula_43200.tsh" ; x0 = 756000.0 ; x1 = 756500.0 46 46 #mesh_filename = "test-100.tsh" ; x0 = 0.25 ; x1 = 0.5 47 47 #mesh_filename = "test-20.tsh" ; x0 = 250.0 ; x1 = 350.0 48 yieldstep = 2049 finaltime = 100048 yieldstep = 50 49 finaltime = 500 50 50 verbose = True 51 51 … … 109 109 #-------------------------------------------------------------------------- 110 110 111 111 domain.set_flow_algorithm('2_0') 112 112 113 #domain.smooth = False 113 domain.set_default_order(2)114 domain.set_timestepping_method('rk2')114 #domain.set_default_order(2) 115 #domain.set_timestepping_method('rk2') 115 116 #domain.set_CFL(0.7) 116 117 #domain.set_beta(1.5) … … 153 154 154 155 155 if myid == 0: 156 print 'Number of processors %g ' %numprocs 157 print 'That took %.2f seconds' %(time.time()-t0) 158 print 'Communication time %.2f seconds'%domain.communication_time 159 print 'Reduction Communication time %.2f seconds'%domain.communication_reduce_time 160 print 'Broadcast time %.2f seconds'%domain.communication_broadcast_time 156 barrier() 157 158 for p in range(numprocs): 159 if myid == p: 160 print 'Processor %g ' %myid 161 print 'That took %.2f seconds' %(time.time()-t0) 162 print 'Communication time %.2f seconds'%domain.communication_time 163 print 'Reduction Communication time %.2f seconds'%domain.communication_reduce_time 164 print 'Broadcast time %.2f seconds'%domain.communication_broadcast_time 165 else: 166 pass 167 168 barrier() 161 169 162 170 … … 164 172 # Merge the individual sww files into one file 165 173 #-------------------------------------------------- 166 domain.sww_merge(delete_old=False)174 #domain.sww_merge(delete_old=False) 167 175 168 176 finalize()
Note: See TracChangeset
for help on using the changeset viewer.