Changeset 4026


Ignore:
Timestamp:
Nov 21, 2006, 8:36:47 PM (18 years ago)
Author:
jack
Message:

Moved the vpython visualiser to obsolete_code and cleared out things that call it from other code.

Location:
anuga_core/source
Files:
20 edited
2 moved

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/show_balanced_limiters.py

    r3846 r4026  
    3636domain = Domain(points, vertices, boundary)
    3737domain.smooth = False
    38 domain.visualise = False
    39 #domain.visualise = True
    4038domain.default_order = 2
    4139domain.set_name('show_balanced_limiters')
  • anuga_core/source/anuga/advection/advection.py

    r3928 r4026  
    7979        self.default_order = self.order = 1
    8080
    81         #Realtime visualisation
    82         self.visualiser = None
    83         self.visualise  = False
    84         self.visualise_color_stage = False
    85         self.visualise_stage_range = 1.0
    86         self.visualise_timer = True
    87         self.visualise_range_z = None
    88 
    89 
    9081        self.smooth = True
    91 
    92     def initialise_visualiser(self,scale_z=1.0,rect=None):
    93         #Realtime visualisation
    94         if self.visualiser is None:
    95             from realtime_visualisation_new import Visualiser
    96  #           from vtk_realtime_visualiser import Visualiser
    97             self.visualiser = Visualiser(self,scale_z,rect)
    98         self.visualise = True
    99 
    10082
    10183    def check_integrity(self):
     
    373355        """
    374356
    375         #Initialise real time viz if requested
    376         if self.visualise is True and self.time == 0.0:
    377             #pass
    378             #import realtime_visualisation_new as visualise
    379             #visualise.create_surface(self)
    380             self.initialise_visualiser()
    381             self.visualiser.setup_all()
    382             self.visualiser.update_timer()
    383 
    384 
    385357        #Call basic machinery from parent class
    386358        for t in Generic_domain.evolve(self,
     
    390362                                       skip_initial_step=skip_initial_step):
    391363
    392 
    393 
    394 
    395             #Real time viz
    396             if self.visualise is True:
    397                 #pass
    398                 self.visualiser.update_all()
    399                 self.visualiser.update_timer()
    400 
    401 
    402364            #Pass control on to outer loop for more specific actions
    403365            yield(t)
  • anuga_core/source/anuga/examples/advection_dirichlet.py

    r3560 r4026  
    2020domain = Domain(points, vertices, boundary, velocity=[1.0, -1.0])
    2121domain.smooth = False
    22 domain.visualise = True
    2322
    2423#Boundaries
  • anuga_core/source/anuga/examples/advection_waves.py

    r3560 r4026  
    1919domain = Domain(points, vertices, boundary, velocity=[1.0, -0.8])
    2020#domain.smooth = False
    21 domain.visualise = True
    2221
    2322#Boundaries
  • anuga_core/source/anuga/examples/bed_w_eden_boundary.py

    r3565 r4026  
    1717domain = Domain(points, vertices, boundary)
    1818domain.smooth = False
    19 domain.visualise = False
    2019domain.default_order = 2
    2120domain.store = True     #Store for visualisation purposes
  • anuga_core/source/anuga/examples/bed_w_file_boundary.py

    r3565 r4026  
    1919domain = Domain(points, vertices, boundary)
    2020domain.smooth = False
    21 domain.visualise = True
    2221domain.default_order=2
    2322
  • anuga_core/source/anuga/examples/cornell_room.py

    r3846 r4026  
    6363print "Number of triangles = ", len(domain)
    6464
    65 domain.visualise = False
    66 domain.checkpoint = False
    6765domain.store = True    #Store for visualisation purposes
    6866domain.format = 'sww'   #Native netcdf visualisation format
  • anuga_core/source/anuga/examples/flatbed_compare.py

    r3565 r4026  
    2020domain = Domain(points, vertices, boundary)
    2121domain.smooth = False
    22 domain.visualise = True
    2322domain.default_order=2
    2423
  • anuga_core/source/anuga/examples/island.py

    r3876 r4026  
    6161domain.maximum_allowed_speed = 100.0
    6262domain.minimum_storable_height = 1.0e-4
    63 domain.visualise_wet_dry_cutoff = 5.0e-2
    6463
    6564#------------------------------------------------------------------------------
     
    101100domain.check_integrity()
    102101
    103 domain.initialise_visualiser()
    104102#------------------------------------------------------------------------------
    105103# Evolve system through time
  • anuga_core/source/anuga/examples/netherlands.py

    r3962 r4026  
    122122
    123123if N > 150:
    124     domain.visualise = False
    125124    domain.checkpoint = False
    126125    domain.store = True    #Store for visualisation purposes
     
    132131    domain.set_name(basename)
    133132else:
    134     #domain.initialise_visualiser(rect=[0.0,0.0,1.0,1.0])
    135     #domain.initialise_visualiser()
    136     #domain.visualiser.coloring['stage'] = False
    137     domain.visualise_timer = True
    138133    domain.checkpoint = False
    139134    domain.store = False
    140     domain.visualise = False
    141135    vis = RealtimeVisualiser(domain)
    142136    vis.render_quantity_height("elevation", dynamic=False)
     
    177171t0 = time.time()
    178172
    179 
    180 #from realtime_visualisation_new import Visualiser
    181 #V = Visualiser(domain,title='netherlands')
    182 #V.update_quantity('stage')
    183 #V.update_quantity('elevation')
    184 
    185 
    186 
    187 
    188173for t in domain.evolve(yieldstep = 0.005, finaltime = None):
    189174    domain.write_time()
     
    192177    print domain.quantities['stage'].get_values(location='centroids',
    193178                                                indices=[0])
    194     #domain.visualiser.update_quantity('elevation')
    195179    #time.sleep(0.1)
    196180    #raw_input('pause>')
    197181    #V.update_quantity('stage')
    198182    #rpdb.set_active()
    199     #domain.visualiser.scale_z = 1.0
    200     #domain.visualiser.update_quantity_color('xmomentum',scale_z = 4.0)
    201183    #integral_label.text='Integral=%10.5e'%domain.quantities['stage'].get_integral()
    202184vis.evolveFinished()
  • anuga_core/source/anuga/examples/run_gong.py

    r3846 r4026  
    2121from mesh_factory import rectangular
    2222from anuga.pyvolution.pmesh2domain import pmesh_to_domain, pmesh_to_domain_instance
     23from anuga.visualiser import RealtimeVisualiser
    2324
    2425from Numeric import array
     
    5051    domain.checkpoint = False #True
    5152    domain.default_order = 1
    52     domain.visualise = visualise
    5353    domain.smooth = True
    5454    domain.set_datadir('.')
    5555    domain.starttime = 20000
    5656
    57     if (domain.visualise):
     57    if (visualise):
    5858        domain.store = False  #True    #Store for visualisation purposes
    5959    else:
     
    122122    domain.check_integrity()
    123123
     124    # prepare the visualiser
     125    if visualise is True:
     126        v = RealtimeVisualiser(domain)
     127        v.render_quantity_height('elevation', dynamic=False)
     128        v.render_quantity_height('stage', dynamic=True)
     129        v.colour_height_quantity('stage', (0.0, 0.0, 0.8))
     130        v.start()
    124131    ######################
    125132    #Evolution
     
    127134    for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
    128135        domain.write_time()
     136        if visualise is True:
     137            v.update()
     138    if visualise is True:
     139        v.evolveFinished()
    129140   
    130141    print 'That took %.2f seconds' %(time.time()-t0)
  • anuga_core/source/anuga/examples/run_sw_rectangle.py

    r3697 r4026  
    4848print 'Number of triangles =', len(domain)
    4949
    50 # Turn on the visualisation
    51 try:
    52     domain.initialise_visualiser()
    53 except:
    54     pass
    55 
    56 
    5750#-----------------------------------------------------------------
    5851# Boundaries and Initial conditions
     
    9184domain.set_name('new_limiter_second_order')
    9285print 'Number of triangles =', len(domain)
    93 
    94 # Turn on the visualisation
    95 try:
    96     domain.initialise_visualiser()
    97 except:
    98     pass
    9986
    10087#-----------------------------------------------------------------
     
    136123print 'Number of triangles =', len(domain)
    137124
    138 # Turn on the visualisation
    139 try:
    140     domain.initialise_visualiser()
    141 except:
    142     pass
    143 
    144125#-----------------------------------------------------------------
    145126# Boundaries and Initial conditions
  • anuga_core/source/anuga/examples/run_tsh.py

    r3846 r4026  
    6060    domain.checkpoint = False #True
    6161    domain.default_order = 1
    62     domain.visualise = visualise
    6362    domain.smooth = True
    6463    domain.set_datadir('.')
    6564
    66     if (domain.visualise):
     65    if (visualise):
    6766        domain.store = False  #True    #Store for visualisation purposes
    6867    else:
     
    149148         
    150149    domain.check_integrity()
    151 
     150   
     151    # prepare the visualiser
     152    if visualise is True:
     153        v = RealtimeVisualiser(domain)
     154        v.render_quantity_height('elevation', dynamic=False)
     155        v.render_quantity_height('stage', dynamic=True)
     156        v.colour_height_quantity('stage', (0.0, 0.0, 0.8))
     157        v.start()
    152158    ######################
    153159    #Evolution
     
    155161    for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
    156162        domain.write_time()
     163        if visualise is True:
     164            v.update()
     165    if visualise is True:
     166        v.evolveFinished()
     167
    157168   
    158169    print 'That took %.2f seconds' %(time.time()-t0)
  • anuga_core/source/anuga/examples/run_tsh_weir.py

    r3846 r4026  
    4343domain.set_name('weir')
    4444domain.checkpoint = False #True
    45 domain.visualise = True #False
    4645domain.default_order = 2
    4746
  • anuga_core/source/anuga/examples/twolevels.py

    r3846 r4026  
    3030domain.default_order=2
    3131domain.smooth = False
    32 domain.visualise = True
    3332
    3433#PLAY WITH THIS [0;1]:
  • anuga_core/source/anuga/examples/wind_example_variable.py

    r3565 r4026  
    1919domain = Domain(points, vertices, boundary)
    2020domain.smooth = True
    21 domain.visualise = False
    2221domain.store = True
    2322domain.default_order=2
  • anuga_core/source/anuga/shallow_water/shallow_water_domain.py

    r4005 r4026  
    164164        self.forcing_terms.append(gravity)
    165165
    166         #Realtime visualisation
    167         self.visualiser = None
    168         self.visualise  = False
    169         self.visualise_color_stage = False
    170         self.visualise_stage_range = 1.0
    171         self.visualise_timer = True
    172         self.visualise_range_z = None
    173 
    174166        #Stored output
    175167        self.store = True
     
    329321               get_maximum_location(indices=wet_elements)   
    330322
    331 
    332 
    333 
    334     def initialise_visualiser(self,scale_z=1.0,rect=None):
    335         #Realtime visualisation
    336         if self.visualiser is None:
    337             from realtime_visualisation_new import Visualiser
    338             self.visualiser = Visualiser(self,scale_z,rect)
    339             self.visualiser.setup['elevation']=True
    340             self.visualiser.updating['stage']=True
    341         self.visualise = True
    342         if self.visualise_color_stage == True:
    343             self.visualiser.coloring['stage'] = True
    344             self.visualiser.qcolor['stage'] = (0.0, 0.0, 0.8)
    345         print 'initialise visualiser'
    346         print self.visualiser.setup
    347         print self.visualiser.updating
    348 
    349323    def check_integrity(self):
    350324        Generic_Domain.check_integrity(self)
     
    435409        self.distribute_to_vertices_and_edges()
    436410
    437         #Initialise real time viz if requested
    438         if self.visualise is True and self.time == 0.0:
    439             if self.visualiser is None:
    440                 self.initialise_visualiser()
    441 
    442             self.visualiser.update_timer()
    443             self.visualiser.setup_all()
    444 
    445         #Store model data, e.g. for visualisation
    446411        if self.store is True and self.time == 0.0:
    447412            self.initialise_storage()
     
    460425                                       duration=duration,
    461426                                       skip_initial_step=skip_initial_step):
    462             #Real time viz
    463             if self.visualise is True:
    464                 self.visualiser.update_all()
    465                 self.visualiser.update_timer()
    466 
    467427
    468428            #Store model data, e.g. for subsequent visualisation
  • anuga_core/source/anuga/shallow_water/shallow_water_domain_kinetic.py

    r3699 r4026  
    9393        self.forcing_terms.append(manning_friction)
    9494
    95         #Realtime visualisation
    96         self.visualiser = None
    97         self.visualise  = False
    98         self.visualise_color_stage = False
    99         self.visualise_stage_range = 1.0
    100         self.visualise_timer = True
    101         self.visualise_range_z = None
    102 
    10395        #Stored output
    10496        self.store = False
     
    112104
    113105        self.quantities_to_be_stored = ['stage','xmomentum','ymomentum']
    114 
    115 
    116 
    117     def initialise_visualiser(self,scale_z=1.0,rect=None):
    118         #Realtime visualisation
    119         if self.visualiser is None:
    120             from realtime_visualisation_new import Visualiser
    121             self.visualiser = Visualiser(self,scale_z,rect)
    122             self.visualiser.setup['elevation']=True
    123             self.visualiser.updating['stage']=True
    124         self.visualise = True
    125         if self.visualise_color_stage == True:
    126             self.visualiser.coloring['stage'] = True
    127             self.visualiser.qcolor['stage'] = (0.0, 0.0, 0.8)
    128         print 'initialise visualiser'
    129         print self.visualiser.setup
    130         print self.visualiser.updating
    131106
    132107    def check_integrity(self):
     
    214189        #and or visualisation
    215190        self.distribute_to_vertices_and_edges()
    216 
    217         #Initialise real time viz if requested
    218         if self.visualise is True and self.time == 0.0:
    219             if self.visualiser is None:
    220                 self.initialise_visualiser()
    221 
    222             self.visualiser.update_timer()
    223             self.visualiser.setup_all()
    224191
    225192        #Store model data, e.g. for visualisation
     
    237204        for t in Generic_Domain.evolve(self, yieldstep, finaltime,
    238205                                       skip_initial_step):
    239             #Real time viz
    240             if self.visualise is True:
    241                 self.visualiser.update_all()
    242                 self.visualiser.update_timer()
    243 
    244206
    245207            #Store model data, e.g. for subsequent visualisation
  • anuga_core/source/anuga/shallow_water/test_data_manager.py

    r4024 r4026  
    27752775        domain.geo_reference = Geo_reference(56,11,11)
    27762776        domain.smooth = False
    2777         domain.visualise = False
    27782777        domain.store = True
    27792778        domain.set_name('bedslope')
     
    28372836        #Now evolve them both, just to be sure
    28382837        ######################################x
    2839         visualise = False
    2840         #visualise = True
    2841         domain.visualise = visualise
    28422838        domain.time = 0.
    28432839        from time import sleep
     
    28502846
    28512847        for t in domain.evolve(yieldstep = yiel, finaltime = final):
    2852             if visualise: sleep(1.)
    28532848            #domain.write_time()
    28542849            pass
     
    28592854
    28602855        domain2.smooth = False
    2861         domain2.visualise = visualise
    28622856        domain2.store = False
    28632857        domain2.default_order=2
     
    28752869
    28762870        for t in domain2.evolve(yieldstep = yiel, finaltime = final):
    2877             if visualise: sleep(1.)
    28782871            #domain2.write_time()
    28792872            pass
     
    29162909        domain = Domain(points, vertices, boundary)
    29172910        domain.smooth = False
    2918         domain.visualise = False
    29192911        domain.store = True
    29202912        domain.set_name('test_file')
     
    30253017        domain.geo_reference = Geo_reference(56,11,11)
    30263018        domain.smooth = True
    3027         domain.visualise = False
    30283019        domain.store = True
    30293020        domain.set_name('bedslope')
     
    30933084        #Now evolve them both, just to be sure
    30943085        ######################################x
    3095         visualise = False
    3096         visualise = True
    3097         domain.visualise = visualise
    30983086        domain.time = 0.
    30993087        from time import sleep
     
    31053093
    31063094        for t in domain.evolve(yieldstep = yiel, finaltime = final):
    3107             if visualise: sleep(.03)
    31083095            #domain.write_time()
    31093096            pass
    31103097
    31113098        domain2.smooth = True
    3112         domain2.visualise = visualise
    31133099        domain2.store = False
    31143100        domain2.default_order=2
     
    31283114
    31293115        for t in domain2.evolve(yieldstep = yiel, finaltime = final):
    3130             if visualise: sleep(.03)
    31313116            #domain2.write_time()
    31323117            pass
  • anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py

    r3928 r4026  
    19951995        domain.check_integrity()
    19961996
    1997         #domain.visualise = True #If you want to take a sticky beak
    1998 
    19991997        initial_volume = domain.quantities['stage'].get_integral()
    20001998        initial_xmom = domain.quantities['xmomentum'].get_integral()
     
    20462044
    20472045        domain.check_integrity()
    2048 
    2049         #domain.visualise = True #If you want to take a sticky beak
    20502046
    20512047        initial_volume = domain.quantities['stage'].get_integral()
     
    21102106
    21112107        domain.check_integrity()
    2112 
    2113         #domain.visualise = True #If you want to take a sticky beak
    21142108
    21152109        initial_volume = domain.quantities['stage'].get_integral()
     
    21882182        domain.check_integrity()
    21892183
    2190         #domain.visualise = True #If you want to take a sticky beak
    2191 
    21922184        initial_volume = domain.quantities['stage'].get_integral()
    21932185        initial_xmom = domain.quantities['xmomentum'].get_integral()
     
    22532245        domain.check_integrity()
    22542246
    2255         #domain.visualise = True #If you want to take a sticky beak
    2256 
    22572247        initial_volume = domain.quantities['stage'].get_integral()
    22582248        initial_xmom = domain.quantities['xmomentum'].get_integral()
     
    23042294        domain = Domain(points, vertices, boundary)
    23052295        domain.smooth = False
    2306         domain.visualise = False
    23072296        domain.default_order = 1
    23082297        domain.minimum_allowed_height = min_depth
     
    24632452        domain = Domain(points, vertices, boundary)
    24642453        domain.smooth = False
    2465         domain.visualise = False
    24662454        domain.default_order=1
    24672455
     
    25072495        domain = Domain(points, vertices, boundary)
    25082496        domain.smooth = False
    2509         domain.visualise = False
    25102497        domain.default_order=2
    25112498        domain.beta_w      = 0.9
     
    25712558        domain = Domain(points, vertices, boundary)
    25722559        domain.smooth = False
    2573         domain.visualise = False
    25742560        domain.default_order=2
    25752561        domain.beta_w      = 0.9
     
    26232609        domain = Domain(points, vertices, boundary)
    26242610        domain.smooth = False
    2625         domain.visualise = False
    26262611        domain.default_order=domain._order_=2
    26272612        domain.beta_w      = 0.9
     
    33323317        domain = Domain(points, vertices, boundary)
    33333318        domain.smooth = False
    3334         domain.visualise = False
    33353319        domain.default_order=2
    33363320
Note: See TracChangeset for help on using the changeset viewer.