Changeset 5832 for anuga_work/development/anuga_1d/shallow_water_domain.py
- Timestamp:
- Oct 11, 2008, 12:38:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/anuga_1d/shallow_water_domain.py
r5741 r5832 54 54 conserved_quantities = ['stage', 'xmomentum'] 55 55 other_quantities = ['elevation', 'friction'] 56 Generic_Domain.__init__(self, coordinates, boundary, 57 conserved_quantities, other_quantities, 58 tagged_elements) 56 Generic_Domain.__init__(self, 57 coordinates = coordinates, 58 boundary = boundary, 59 conserved_quantities = conserved_quantities, 60 other_quantities = other_quantities, 61 tagged_elements = tagged_elements) 59 62 60 63 from config import minimum_allowed_height, g, h0 … … 68 71 #print "\nI have Removed forcing terms line 64 1dsw" 69 72 70 #Realtime visualisation71 self.visualiser = None72 self.visualise = False73 self.visualise_color_stage = False74 self.visualise_stage_range = 1.075 self.visualise_timer = True76 self.visualise_range_z = None77 73 78 74 #Stored output … … 82 78 83 79 #Evolve parametrs 84 self. cfl = 1.080 self.set_CFL(1.0) 85 81 86 82 #Reduction operation for get_vertex_values … … 89 85 #self.reduction = min #Looks better near steep slopes 90 86 91 self. quantities_to_be_stored = ['stage','xmomentum']87 self.set_quantities_to_be_stored(['stage','xmomentum']) 92 88 93 89 self.__doc__ = 'shallow_water_domain' 94 90 91 self.check_integrity() 95 92 96 93 def set_quantities_to_be_stored(self, q): … … 125 122 126 123 127 def initialise_visualiser(self,scale_z=1.0,rect=None):128 #Realtime visualisation129 if self.visualiser is None:130 from realtime_visualisation_new import Visualiser131 self.visualiser = Visualiser(self,scale_z,rect)132 self.visualiser.setup['elevation']=True133 self.visualiser.updating['stage']=True134 self.visualise = True135 if self.visualise_color_stage == True:136 self.visualiser.coloring['stage'] = True137 self.visualiser.qcolor['stage'] = (0.0, 0.0, 0.8)138 print 'initialise visualiser'139 print self.visualiser.setup140 print self.visualiser.updating141 142 124 def check_integrity(self): 143 Generic_Domain.check_integrity(self) 125 144 126 #Check that we are solving the shallow water wave equation 145 127 … … 149 131 assert self.conserved_quantities[1] == 'xmomentum', msg 150 132 133 msg = 'First evolved quantity must be "stage"' 134 assert self.evolved_quantities[0] == 'stage', msg 135 msg = 'Second evolved quantity must be "xmomentum"' 136 assert self.evolved_quantities[1] == 'xmomentum', msg 137 138 Generic_Domain.check_integrity(self) 139 151 140 def extrapolate_second_order_sw(self): 152 141 #Call correct module function … … 584 573 import sys 585 574 575 cfl = domain.get_CFL() 586 576 587 577 timestep = float(sys.maxint) … … 596 586 #print 'g=',g 597 587 #print 'The type of g is',type(g) 588 589 h0 = domain.h0 598 590 599 591 neighbours = domain.neighbours … … 652 644 from comp_flux_ext import compute_fluxes_ext 653 645 654 domain.flux_timestep = compute_fluxes_ext(timestep, 655 epsilon, 656 g, 657 neighbours, 658 neighbour_vertices, 659 normals, 660 areas, 661 stage_edge_values, 662 xmom_edge_values, 663 bed_edge_values, 664 stage_boundary_values, 665 xmom_boundary_values, 666 stage_explicit_update, 667 xmom_explicit_update, 668 number_of_elements, 669 max_speed_array) 646 domain.flux_timestep = compute_fluxes_ext(cfl, 647 timestep, 648 epsilon, 649 g, 650 h0, 651 neighbours, 652 neighbour_vertices, 653 normals, 654 areas, 655 stage_edge_values, 656 xmom_edge_values, 657 bed_edge_values, 658 stage_boundary_values, 659 xmom_boundary_values, 660 stage_explicit_update, 661 xmom_explicit_update, 662 number_of_elements, 663 max_speed_array) 670 664 671 665
Note: See TracChangeset
for help on using the changeset viewer.