Changeset 1639


Ignore:
Timestamp:
Jul 25, 2005, 11:26:36 PM (19 years ago)
Author:
steve
Message:
 
Location:
inundation/ga/storm_surge
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/parallel/run_advection.py

    r1575 r1639  
    99from config import g, epsilon
    1010from Numeric import allclose, array, zeros, ones, Float
    11 from advection import *
     11from advection import Domain, Transmissive_boundary, Dirichlet_boundary
    1212from Numeric import array
    1313
     
    3333#turn on the visualisation
    3434rect = [0.0, 0.0, 1.0, 1.0]
    35 domain.initialise_visualiser(rect=rect)
     35#domain.initialise_visualiser(rect=rect)
     36domain.visualise = True
    3637
    3738
  • inundation/ga/storm_surge/pyvolution/advection.py

    r1575 r1639  
    326326        """
    327327
    328         logger.debug('Trying to weave compute_fluxes')
     328        logger.debug('Trying to weave advection.compute_fluxes')
    329329        weave.inline(code, ['stage_edge','stage_bdry','stage_update',
    330330                             'neighbours','neighbour_edges','normals',
     
    344344            #import realtime_visualisation_new as visualise
    345345            self.initialise_visualiser()
    346             self.visualiser.update_quantity('stage')
     346            #self.visualiser.update_quantity('stage')
    347347            self.visualiser.update_timer()
    348348
     
    351351            #Real time viz
    352352            if self.visualise is True:
    353                 self.visualiser.update_quantity('stage')
     353                #self.visualiser.update_quantity('stage')
    354354                self.visualiser.update_timer()
    355355
  • inundation/ga/storm_surge/pyvolution/realtime_visualisation_new.py

    r1599 r1639  
     1
    12from visual import *
    23
     
    910class Visualiser:
    1011
    11     def __init__(self,domain,scale_z=1.0,rect=None):
     12    def __init__(self,domain,scale_z=1.0,rect=None,title='Test'):
    1213        """Create visualisation of domain
    1314        """
    1415
     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
    1522        self.frame  = frame()
    1623
    17         self.domain = domain
     24        self.domain   = domain
    1825        self.scale_z  = scale_z
    1926        self.vertices = domain.vertex_coordinates
     
    2431        #print keys
    2532        for key in self.domain.quantities:
    26             self.vpython_z_models[key] = faces(frame= self.frame)
     33            self.vpython_z_models[key] = faces(frame=self.frame)
    2734
    2835        #print self.z_models
     
    3340            self.max_y = max(max(self.vertices[:,1]),max(self.vertices[:,3]),max(self.vertices[:,5]))
    3441            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_x
    36             self.range_y = self.max_y - self.min_y
    37             self.range_xy = max(self.range_x, self.range_y)
    3842        else:
    3943            self.max_x = rect[2]
     
    4145            self.max_y = rect[3]
    4246            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)
    4652
    4753
     
    8490        #print 'keys',self.domain.quantities.keys()
    8591        #print 'shape of stage',shape(self.stage)
    86 
    87 
    88         setup_scene()
    8992
    9093        self.border_model = curve(frame = self.frame,
     
    141144    def setup_all(self):
    142145
     146        self.scene.select()
     147
    143148        self.update_quantity('elevation')
    144149        self.update_quantity('stage')
     
    146151    def update_all(self):
    147152
     153        self.scene.select()
     154
    148155        if self.updating['elevation']:
    149156            self.update_quantity('elevation')
     
    156163
    157164    def update_timer(self):
     165
     166        self.scene.select()
    158167
    159168        if self.domain.visualise_timer == True:
     
    592601
    593602    domain.visualiser.update_timer()
     603
     604
     605
     606if __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.