Changeset 1272
- Timestamp:
- May 2, 2005, 5:58:03 PM (20 years ago)
- Location:
- inundation/ga/storm_surge
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/realtime_visualisation_new.py
r1271 r1272 7 7 8 8 self.frame = frame() 9 self.bed_model = faces(frame=self.frame) 9 autoscale=0 10 self.bed_model = faces(frame=self.frame) 10 11 self.stage_model = faces(frame=self.frame) 11 12 self.domain = domain … … 27 28 self.max_bed = max(max(self.bed)) 28 29 self.min_bed = min(min(self.bed)) 29 self.range_bed = self.max_bed - self.min_bed30 self.range_bed = max(self.max_bed - self.min_bed, 1e-10)*2.0 30 31 31 32 print 'min_bed=',self.min_bed … … 45 46 #print 'shape of stage',shape(self.stage) 46 47 48 self.border_model = curve(frame = self.frame, pos=[(0,0),(0,1),(1,1),(1,0),(0,0)]) 49 self.timer=label(pos=(0.75,0.5,0.5),text='Time=%10.5e'%self.domain.time) 50 47 51 self.update_all() 48 52 … … 51 55 self.update_bed() 52 56 self.update_stage() 57 58 def update_timer(self): 59 self.timer.text='Time=%10.5e'%self.domain.time 53 60 54 61 def update_bed(self): … … 89 96 min_y = self.min_y 90 97 range_xy = self.range_xy 98 range_bed = self.range_bed 91 99 92 100 vertices = self.vertices … … 96 104 97 105 try: 98 update_arrays_weave(vertices,quantity,col,pos,normals,colour,N,min_x,min_y,range_xy,scale_z) 106 update_arrays_weave(vertices,quantity,col,pos,normals,colour,N, 107 min_x,min_y,range_xy,range_bed,scale_z) 99 108 except: 100 update_arrays_python(vertices,quantity,col,pos,normals,colour,N,min_x,min_y,range_xy,scale_z) 101 102 103 104 def update_arrays_python(vertices,quantity,col,pos,normals,colour,N,min_x,min_y,range_xy,scale_z): 109 update_arrays_python(vertices,quantity,col,pos,normals,colour,N, 110 min_x,min_y,range_xy,range_bed,scale_z) 111 112 113 114 def update_arrays_python(vertices,quantity,col,pos,normals,colour,N, 115 min_x,min_y,range_xy,range_bed,scale_z): 105 116 106 117 from math import sqrt … … 114 125 v[j,0] = (vertices[i,2*j ]-min_x)/range_xy 115 126 v[j,1] = (vertices[i,2*j+1]-min_y)/range_xy 116 v[j,2] = quantity[i,j] *scale_z127 v[j,2] = quantity[i,j]/range_bed*scale_z 117 128 118 129 v10 = v[1,:]-v[0,:] … … 156 167 157 168 158 def update_arrays_weave(vertices,quantity,col,pos,normals,colour,N,min_x,min_y,range_xy,scale_z): 169 def update_arrays_weave(vertices,quantity,col,pos,normals,colour, 170 N,min_x,min_y,range_xy,range_bed,scale_z): 159 171 160 172 import weave … … 174 186 v(j,0) = (vertices(i,2*j )-min_x)/range_xy; 175 187 v(j,1) = (vertices(i,2*j+1)-min_y)/range_xy; 176 v(j,2) = quantity(i,j) *scale_z;188 v(j,2) = quantity(i,j)/range_bed*scale_z; 177 189 } 178 190 … … 261 273 surface = domain.surface 262 274 surface.update_stage() 275 surface.update_timer() 263 276 #print 'end visual update'
Note: See TracChangeset
for help on using the changeset viewer.