Changeset 1639
- Timestamp:
- Jul 25, 2005, 11:26:36 PM (19 years ago)
- Location:
- inundation/ga/storm_surge
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/parallel/run_advection.py
r1575 r1639 9 9 from config import g, epsilon 10 10 from Numeric import allclose, array, zeros, ones, Float 11 from advection import *11 from advection import Domain, Transmissive_boundary, Dirichlet_boundary 12 12 from Numeric import array 13 13 … … 33 33 #turn on the visualisation 34 34 rect = [0.0, 0.0, 1.0, 1.0] 35 domain.initialise_visualiser(rect=rect) 35 #domain.initialise_visualiser(rect=rect) 36 domain.visualise = True 36 37 37 38 -
inundation/ga/storm_surge/pyvolution/advection.py
r1575 r1639 326 326 """ 327 327 328 logger.debug('Trying to weave compute_fluxes')328 logger.debug('Trying to weave advection.compute_fluxes') 329 329 weave.inline(code, ['stage_edge','stage_bdry','stage_update', 330 330 'neighbours','neighbour_edges','normals', … … 344 344 #import realtime_visualisation_new as visualise 345 345 self.initialise_visualiser() 346 self.visualiser.update_quantity('stage')346 #self.visualiser.update_quantity('stage') 347 347 self.visualiser.update_timer() 348 348 … … 351 351 #Real time viz 352 352 if self.visualise is True: 353 self.visualiser.update_quantity('stage')353 #self.visualiser.update_quantity('stage') 354 354 self.visualiser.update_timer() 355 355 -
inundation/ga/storm_surge/pyvolution/realtime_visualisation_new.py
r1599 r1639 1 1 2 from visual import * 2 3 … … 9 10 class Visualiser: 10 11 11 def __init__(self,domain,scale_z=1.0,rect=None ):12 def __init__(self,domain,scale_z=1.0,rect=None,title='Test'): 12 13 """Create visualisation of domain 13 14 """ 14 15 16 self.scene = display(title=title) 17 self.scene.center = (0.5,0.5,0.0) 18 self.scene.forward = vector(-0.0, 0.5, -0.8) 19 self.scene.ambient = 0.4 20 self.scene.lights = [(0.6, 0.3, 0.2), (0.1, -0.5, 0.4)] 21 15 22 self.frame = frame() 16 23 17 self.domain = domain24 self.domain = domain 18 25 self.scale_z = scale_z 19 26 self.vertices = domain.vertex_coordinates … … 24 31 #print keys 25 32 for key in self.domain.quantities: 26 self.vpython_z_models[key] = faces(frame= 33 self.vpython_z_models[key] = faces(frame=self.frame) 27 34 28 35 #print self.z_models … … 33 40 self.max_y = max(max(self.vertices[:,1]),max(self.vertices[:,3]),max(self.vertices[:,5])) 34 41 self.min_y = min(min(self.vertices[:,1]),min(self.vertices[:,3]),min(self.vertices[:,5])) 35 self.range_x = self.max_x - self.min_x36 self.range_y = self.max_y - self.min_y37 self.range_xy = max(self.range_x, self.range_y)38 42 else: 39 43 self.max_x = rect[2] … … 41 45 self.max_y = rect[3] 42 46 self.min_y = rect[1] 43 self.range_x = self.max_x - self.min_x 44 self.range_y = self.max_y - self.min_y 45 self.range_xy = max(self.range_x, self.range_y) 47 48 49 self.range_x = self.max_x - self.min_x 50 self.range_y = self.max_y - self.min_y 51 self.range_xy = max(self.range_x, self.range_y) 46 52 47 53 … … 84 90 #print 'keys',self.domain.quantities.keys() 85 91 #print 'shape of stage',shape(self.stage) 86 87 88 setup_scene()89 92 90 93 self.border_model = curve(frame = self.frame, … … 141 144 def setup_all(self): 142 145 146 self.scene.select() 147 143 148 self.update_quantity('elevation') 144 149 self.update_quantity('stage') … … 146 151 def update_all(self): 147 152 153 self.scene.select() 154 148 155 if self.updating['elevation']: 149 156 self.update_quantity('elevation') … … 156 163 157 164 def update_timer(self): 165 166 self.scene.select() 158 167 159 168 if self.domain.visualise_timer == True: … … 592 601 593 602 domain.visualiser.update_timer() 603 604 605 606 if __name__ == '__main__': 607 608 from advection import Domain as A_Domain 609 from shallow_water import Domain as SW_Domain 610 from mesh_factory import rectangular 611 612 points, vertices, boundary = rectangular(20, 20, len1=200, len2=200) 613 a_domain = A_Domain(points, vertices, boundary) 614 sw_domain = SW_Domain(points, vertices, boundary) 615 616 a_domain.initialise_visualiser() 617 a_domain.visualiser.update_all() 618 619 620 sw_domain.initialise_visualiser() 621 sw_domain.visualiser.update_all() 622 623 #a_v = Visualiser(domain=a_domain, title='advection') 624 #a_v.update_all() 625 626 627 #sw_v = Visualiser(domain=sw_domain, title='shallow water') 628 #sw_v.update_all()
Note: See TracChangeset
for help on using the changeset viewer.