Changeset 1471


Ignore:
Timestamp:
May 26, 2005, 5:41:07 PM (20 years ago)
Author:
steve
Message:

Can now change base colour for different quantities, but need a better method!

Location:
inundation/ga/storm_surge
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/Hobart/run_hobart_buildings.py

    r1438 r1471  
    4242domain.default_order = 1
    4343domain.smooth = True
    44 domain.visualise = True
     44
     45# Turn on visualiser
     46domain.initialise_visualiser()
     47
     48# Colours for Hobart
     49domain.visualiser.stage_color = (0.0,0.38,0.1)
     50domain.visualiser.friction_color = (0.1,0.99,0.1)
     51domain.visualiser.other_color = (0.99,0.4,0.1)
     52
    4553
    4654#------------------------------
  • inundation/ga/storm_surge/parallel/advection.py

    r1466 r1471  
    4444
    4545        #Realtime visualisation
    46         self.visualise = False
     46        self.visualiser = None
     47        self.visualise  = False
    4748        self.visualise_color_stage = False
    4849        self.visualise_timer = True
     
    312313        #Initialise real time viz if requested
    313314        if self.visualise is True and self.time == 0.0:
    314             import realtime_visualisation_new as visualise
     315            #import realtime_visualisation_new as visualise
    315316            self.visualiser.update_quantity('stage')
    316317            self.visualiser.update_timer()
  • inundation/ga/storm_surge/parallel/run_parallel_advection.py

    r1466 r1471  
    3030# Initial condition is zero by default
    3131
     32#turn on the visualisation
    3233domain.initialise_visualiser()
    3334
     
    6061
    6162#Check that the boundary value gets propagated to all elements
    62 for t in domain.evolve(yieldstep = 0.1, finaltime = 3.0):
     63for t in domain.evolve(yieldstep = 0.5, finaltime = 3.0):
    6364    if myid == 0:
    6465        domain.write_time()
  • inundation/ga/storm_surge/pyvolution/realtime_visualisation_new.py

    r1462 r1471  
    22
    33elevation_color = (0.3,0.4,0.5)
    4 stage_color = (0.1,0.4,0.99)
    5 
    6 # Colours for Hobart
    7 stage_color = (0.0,0.38,0.1)
    8 friction_color = (0.1,0.99,0.1)
    9 other_color = (0.99,0.4,0.1)
     4stage_color     = (0.1,0.4,0.99)
     5friction_color  = (0.1,0.99,0.1)
     6other_color     = (0.99,0.4,0.1)
     7
    108
    119class Visualiser:
     
    6058        #print 'keys',self.domain.quantities.keys()
    6159        #print 'shape of stage',shape(self.stage)
     60
     61        self.stage_color     = stage_color
     62        self.elevation_color = elevation_color
     63        self.friction_color  = friction_color
     64        self.other_color     = other_color
    6265
    6366        setup_scene()
     
    98101            range_z = max(range_z, max_z - min_z)
    99102        except:
    100             print 'Visualisation: could not find range of '+qname1
     103            #print 'Visualisation: could not find range of '+qname1
    101104            pass
    102105
     
    108111            range_z = max(range_z, max_z - min_z)
    109112        except:
    110             print 'Visualisation: could not find range of '+qname2
     113            #print 'Visualisation: could not find range of '+qname2
    111114            pass
    112115
     
    115118    def update_all(self):
    116119
    117         self.update_quantity('elevation',elevation_color)
    118         self.update_quantity('stage',stage_color)
     120        self.update_quantity('elevation',self.elevation_color)
     121        self.update_quantity('stage',self.stage_color)
    119122
    120123    def update_timer(self):
     
    130133
    131134        if qcolor is None:
    132             qcolor = other_color
     135            qcolor = self.other_color
    133136
    134137            if qname=='elevation':
    135                 qcolor = elevation_color
     138                qcolor = self.elevation_color
    136139
    137140            if qname=='stage':
    138                 qcolor = stage_color
    139                
     141                qcolor = self.stage_color
     142
    140143            if qname=='friction':
    141                 qcolor = friction_color
     144                qcolor = self.friction_color
    142145
    143146        if scale_z is None:
     
    161164        if qcolor is None:
    162165            if qname=='elevation':
    163                 qcolor = elevation_color
     166                qcolor = self.elevation_color
    164167
    165168            if qname=='stage':
    166                 qcolor = stage_color
    167                
     169                qcolor = self.stage_color
     170
    168171            if qname=='friction':
    169                 qcolor = friction_color
     172                qcolor = self.friction_color
    170173
    171174        if scale_z is None:
     
    530533def create_surface(domain,scale_z=1.0):
    531534
    532     visualiser = Visualiser(domain,scale_z)
    533     domain.visualiser = visualiser
    534 
    535     visualiser.update_quantity('elevation')
    536     visualiser.update_quantity('stage')
    537     visualiser.update_timer()
     535    domain.initialise_visualiser(scale_z)
     536
     537    domain.visualiser.update_quantity('elevation')
     538    domain.visualiser.update_quantity('stage')
     539    domain.visualiser.update_timer()
    538540
    539541def update(domain):
    540542
    541     visualiser = domain.visualiser
    542543    if domain.visualise_color_stage:
    543         visualiser.update_quantity_color('stage')
     544        domain.visualiser.update_quantity_color('stage')
    544545    else:
    545         visualiser.update_quantity('stage')
    546 
    547     visualiser.update_timer()
     546        domain.visualiser.update_quantity('stage')
     547
     548    domain.visualiser.update_timer()
  • inundation/ga/storm_surge/pyvolution/shallow_water.py

    r1387 r1471  
    5757from domain import *
    5858from region import *
     59from realtime_visualisation_new import Visualiser
    5960Generic_domain = Domain #Rename
    6061
     
    8081
    8182        #Realtime visualisation
    82         self.visualise = False
     83        self.visualiser = None
     84        self.visualise  = False
    8385        self.visualise_color_stage = False
    8486        self.visualise_stage_range = 1.0
     
    105107        #self.z = self.quantities['elevation']
    106108        #self.eta = self.quantities['friction']
     109
     110    def initialise_visualiser(self,scale_z=1.0):
     111        #Realtime visualisation
     112        if self.visualiser is None:
     113            self.visualiser = Visualiser(self,scale_z)
     114        self.visualise = True
    107115
    108116    def check_integrity(self):
Note: See TracChangeset for help on using the changeset viewer.