- Timestamp:
- May 13, 2013, 5:09:25 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/gareth/experimental/balanced_dev/swb2_domain.py
r8865 r8866 66 66 self.set_CFL(1.0) 67 67 self.set_use_kinematic_viscosity(False) 68 self.timestepping_method='rk2'#'rk2'#' euler'#'rk2'68 self.timestepping_method='rk2'#'rk2'#'rk2'#'euler'#'rk2' 69 69 # The following allows storage of the negative depths associated with this method 70 70 self.minimum_storable_height=-99999999999.0 … … 74 74 self.extrapolate_velocity_second_order=True 75 75 76 # Note that the extrapolation method used in quantity_ext.c (e.g.77 # extrapolate_second_order_and_limit_by_edge) uses a constant value for78 # all the betas.79 76 self.beta_w=0.0 80 77 self.beta_w_dry=0.0 … … 83 80 self.beta_vh=0.0 84 81 self.beta_vh_dry=0.0 82 83 #self.epsilon=1.0e-100 85 84 86 85 #self.optimise_dry_cells=True … … 111 110 self.boundary_flux_sum=numpy.ndarray(1) 112 111 self.boundary_flux_sum[0]=0. 112 113 self.call=1 # Integer counting how many times we call compute_fluxes_central 114 115 # Integer recording the order of the time-stepping scheme 116 if(self.timestepping_method=='rk2'): 117 self.timestep_order=2 118 elif(self.timestepping_method=='euler'): 119 self.timestep_order=1 120 elif(self.timestepping_method=='rk3'): 121 self.timestep_order=3 122 else: 123 err_mess='ERROR: timestepping_method= ' + self.timestepping_method +' not supported in this solver' 124 raise Exception, err_mess 113 125 114 126 print '##########################################################################' … … 252 264 # raise Exception, err_mess 253 265 254 if(domain.timestepping_method=='rk2'):255 timestep_order=2256 elif(domain.timestepping_method=='euler'):257 timestep_order=1266 #if(domain.timestepping_method=='rk2'): 267 # timestep_order=2 268 #elif(domain.timestepping_method=='euler'): 269 # timestep_order=1 258 270 #elif(domain.timestepping_method=='rk3'): 259 271 # timestep_order=3 260 else:261 err_mess='ERROR: domain.timestepping_method= ' + domain.timestepping_method +' not supported in this solver'262 raise Exception, err_mess263 264 # print 'timestep_order=', timestep_order272 #else: 273 # err_mess='ERROR: domain.timestepping_method= ' + domain.timestepping_method +' not supported in this solver' 274 # raise Exception, err_mess 275 276 ##print 'timestep_order=', timestep_order 265 277 266 278 Stage = domain.quantities['stage'] … … 271 283 timestep = float(sys.maxint) 272 284 285 domain.call+=1 273 286 flux_timestep = compute_fluxes_ext(timestep, 274 287 domain.epsilon, … … 297 310 domain.max_speed, 298 311 int(domain.optimise_dry_cells), 299 timestep_order,312 domain.timestep_order, 300 313 Stage.centroid_values, 301 314 Xmom.centroid_values, … … 304 317 Bed.vertex_values) 305 318 306 #import pdb 307 #pdb.set_trace() 308 #print 'flux timestep: ', flux_timestep, domain.timestep 319 320 # Update the boundary flux integral 309 321 if(domain.timestepping_method=='rk2'): 310 if(flux_timestep == float(sys.maxint)):322 if(domain.call%2==1): 311 323 domain.boundary_flux_integral[0]= domain.boundary_flux_integral[0] +\ 312 324 domain.boundary_flux_sum[0]*domain.timestep*0.5 313 325 #print 'dbfi ', domain.boundary_flux_integral, domain.boundary_flux_sum 314 326 domain.boundary_flux_sum[0]=0. 327 328 elif(domain.timestepping_method=='euler'): 329 domain.boundary_flux_integral=0. 330 # This presently doesn't work -- this section of code may need to go elsewhere 331 #domain.boundary_flux_integral[0]= domain.boundary_flux_integral[0] +\ 332 # domain.boundary_flux_sum[0]*domain.timestep 333 #domain.boundary_flux_sum[0]=0. 334 335 elif(domain.timestepping_method=='rk3'): 336 domain.boundary_flux_integral=0. 337 # This needs to be designed 338 else: 339 mess='ERROR: domain.timestepping_method', domain.timestepping_method,' method not recognised' 340 raise Exception, mess 315 341 316 342 domain.flux_timestep = flux_timestep
Note: See TracChangeset
for help on using the changeset viewer.