Changeset 8418
- Timestamp:
- May 8, 2012, 5:29:03 PM (13 years ago)
- Location:
- trunk/anuga_core/source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py
r8371 r8418 467 467 return q 468 468 469 def get_CFL(self): 470 """get CFL 471 """ 472 473 return self.CFL 474 475 469 476 def set_CFL(self, cfl=1.0): 470 """Set CFL parameter, warn if greater than 1.0471 """ 472 if cfl > 1.0:477 """Set CFL parameter, warn if greater than 2.0 478 """ 479 if cfl > 2.0: 473 480 self.CFL = cfl 474 log.warn('Setting CFL > 1.0')481 log.warn('Setting CFL > 2.0') 475 482 476 483 assert cfl > 0.0 477 484 self.CFL = cfl 478 479 480 485 481 486 def set_time(self, time=0.0): -
trunk/anuga_core/source/anuga/config.py
r8406 r8418 117 117 # beta values. In this case the settings for timestepping_method will be overriden 118 118 119 #flow_algorithm = 1# 1st order euler and conservative piecewise constant spatial reconstruction120 flow_algorithm = 1.5# 1st order euler and conservative piecewise linear spatial reconstruction121 #flow_algorithm = 1.75# 1st order euler and more aggressive piecewise linear spatial reconstruction122 #flow_algorithm = 2# 2nd order TVD scheme and more aggressive piecewise linear spatial reconstruction123 #flow_algorithm = 2.5# 3rd order TVD scheme and more aggressive piecewise linear spatial reconstruction119 #flow_algorithm = '1_0' # 1st order euler and conservative piecewise constant spatial reconstruction 120 flow_algorithm = '1_5' # 1st order euler and conservative piecewise linear spatial reconstruction 121 #flow_algorithm = '1_75' # 1st order euler and more aggressive piecewise linear spatial reconstruction 122 #flow_algorithm = '2_0' # 2nd order TVD scheme and more aggressive piecewise linear spatial reconstruction 123 #flow_algorithm = '2.5' # 3rd order TVD scheme and more aggressive piecewise linear spatial reconstruction 124 124 125 125 -
trunk/anuga_core/source/anuga/operators/base_operator.py
r8366 r8418 27 27 28 28 29 if domain.numproc > 1:30 msg = 'Not implemented to run in parallel'31 assert self.__parallel_safe(), msg29 # if domain.numproc > 1: 30 # msg = 'Not implemented to run in parallel' 31 # assert self.__parallel_safe(), msg 32 32 33 33 if description == None: … … 63 63 """By default an operator is not parallel safe 64 64 """ 65 66 print "ZZZZ in --parallel_safe base_oprator" 65 67 return False 66 68 -
trunk/anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r8406 r8418 270 270 parameters['use_sloped_mannings'] = self.use_sloped_mannings 271 271 parameters['compute_fluxes_method'] = self.get_compute_fluxes_method() 272 parameters['flow_algorithm'] = self.get_flow_algorithm() 272 parameters['flow_algorithm'] = self.get_flow_algorithm() 273 parameters['CFL'] = self.get_CFL() 274 parameters['timestepping_method'] = self.get_timestepping_method() 273 275 274 276 parameters['optimised_gradient_limiter'] = self.optimised_gradient_limiter … … 358 360 """ 359 361 360 flag = str(flag) 361 362 flow_algorithms = ['1', '1.5', '1.75', '2', '2.5'] 362 if isinstance(flag, str) : 363 flag = flag.replace(".","_") 364 else: 365 flag = str(float(str(flag))).replace(".","_") 366 367 flow_algorithms = ['1_0', '1_5', '1_75', '2_0', '2_5'] 363 368 364 369 if flag in flow_algorithms: … … 370 375 371 376 372 if self.flow_algorithm == '1 ':377 if self.flow_algorithm == '1_0': 373 378 self.set_timestepping_method(1) 374 379 self.set_default_order(1) 375 376 if self.flow_algorithm == '1.5': 380 self.set_CFL(1.0) 381 382 if self.flow_algorithm == '1_5': 377 383 self.set_timestepping_method(1) 378 384 self.set_default_order(2) … … 384 390 beta_vh_dry = 0.2 385 391 self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry) 386 387 388 if self.flow_algorithm == '1.75': 392 self.set_CFL(1.0) 393 394 395 if self.flow_algorithm == '1_75': 389 396 self.set_timestepping_method(1) 390 397 self.set_default_order(2) … … 396 403 beta_vh_dry = 0.2 397 404 self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry) 398 399 400 if self.flow_algorithm == '2': 405 self.set_CFL(0.75) 406 407 408 if self.flow_algorithm == '2_0': 401 409 self.set_timestepping_method(2) 402 410 self.set_default_order(2) 403 beta_w = 1. 7411 beta_w = 1.9 404 412 beta_w_dry = 0.2 405 beta_uh = 1. 7413 beta_uh = 1.9 406 414 beta_uh_dry = 0.2 407 beta_vh = 1. 7415 beta_vh = 1.9 408 416 beta_vh_dry = 0.2 409 417 self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry) 410 411 if self.flow_algorithm == '2.5': 418 self.set_CFL(1.0) 419 420 if self.flow_algorithm == '2_5': 412 421 self.set_timestepping_method(3) 413 422 self.set_default_order(2) 414 beta_w = 1. 7423 beta_w = 1.9 415 424 beta_w_dry = 0.2 416 beta_uh = 1. 7425 beta_uh = 1.9 417 426 beta_uh_dry = 0.2 418 beta_vh = 1. 7427 beta_vh = 1.9 419 428 beta_vh_dry = 0.2 420 429 self.set_betas(beta_w, beta_w_dry, beta_uh, beta_uh_dry, beta_vh, beta_vh_dry) 430 self.set_CFL(1.0) 421 431 422 432 … … 426 436 427 437 Currently 428 1 , 1.5, 2, 2.5438 1_0, 1_5, 1_75 2_0, 2_5 429 439 """ 430 440 … … 898 908 Q.extrapolate_first_order() 899 909 elif self._order_ == 2: 900 Q.extrapolate_second_order_and_limit_by_edge() 910 if self.use_edge_limiter: 911 Q.extrapolate_second_order_and_limit_by_edge() 912 else: 913 Q.extrapolate_second_order_and_limit_by_vertex() 901 914 else: 902 915 raise Exception('Unknown order') -
trunk/anuga_core/source/anuga_parallel/parallel_boyd_box_operator.py
r8224 r8418 95 95 96 96 97 def __parallel_safe(self): 98 99 print "ZZZZ parallel_boyd" 100 return True 101 102 103 104 97 105 def debug_discharge_routine(self): 98 106 local_debug ='false' -
trunk/anuga_core/source/anuga_parallel/parallel_structure_operator.py
r8224 r8418 55 55 enquiry_proc = None): 56 56 57 self.myid = pypar.rank() 58 self.num_procs = pypar.size() 59 57 60 anuga.Operator.__init__(self,domain) 58 61 … … 82 85 self.exchange_lines = ensure_numeric(exchange_lines) 83 86 self.enquiry_points = ensure_numeric(enquiry_points) 84 self.myid = pypar.rank() 85 self.num_procs = pypar.size() 87 86 88 87 89 if height is None: … … 162 164 self.outflow_index = 1 163 165 164 self.set_ logging(logging)166 self.set_parallel_logging(logging) 165 167 166 168 def __call__(self): … … 440 442 441 443 442 def set_ logging(self, flag=True):444 def set_parallel_logging(self, flag=True): 443 445 # Warning: requires synchronization, must be called by all procs associated 444 446 # with this structure … … 448 450 449 451 # If flag is true open file with mode = "w" to form a clean file for logging 450 if self.logging :452 if self.logging and self.myid == self.master_proc: 451 453 self.log_filename = self.label + '.log' 452 454 log_to_file(self.log_filename, stats, mode='w') … … 455 457 #log_to_file(self.log_filename, self.culvert_type) 456 458 459 def set_logging(self, flag=True): 460 # Overwrite the sequential procedure with a dummy procedure. 461 # Need to call set_parallel_logging which needs t obe done later 462 # after the calculation of master processors 463 464 pass 465 457 466 458 467 def timestepping_statistics(self): … … 504 513 return self.enquiry_proc 505 514 515 506 516 def __parallel_safe(self): 507 517 return True 518 519 520 -
trunk/anuga_core/source/anuga_parallel/run_parallel_sw_merimbula_profile.py
r8225 r8418 35 35 36 36 37 from anuga_parallel import distribute, myid, numprocs, finalize 37 from anuga_parallel import distribute, myid, numprocs, finalize, barrier 38 38 39 39 … … 83 83 #domain.smooth = False 84 84 85 domain.set_default_order(2) 86 domain.set_timestepping_method('rk2') 85 86 domain.set_flow_algorithm(2.0) 87 88 if myid == 0: 89 domain.print_algorithm_parameters() 90 91 barrier() 92 93 #domain.set_default_order(2) 94 #domain.set_timestepping_method('rk2') 87 95 #domain.set_CFL(0.7) 88 96 #domain.set_beta(1.5) 97 98 89 99 domain.set_name('meribula') 90 100
Note: See TracChangeset
for help on using the changeset viewer.