Ignore:
Timestamp:
Sep 5, 2008, 9:16:45 PM (17 years ago)
Author:
steve
Message:

Updated timestepping

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_work/development/demos/netherlands.py

    r5153 r5741  
    2727N = 130 # size = 33800
    2828N = 600 # Size = 720000
    29 N = 100
     29N = 50
    3030
    3131points, elements, boundary = rectangular_cross(N, N)
     
    3434domain.check_integrity()
    3535
     36import sys
     37base = os.path.basename(sys.argv[0])
     38domain.simulation_name = 'netherlands'
    3639domain.set_name(os.path.splitext(__file__)[0])
    37 domain.set_timestepping_method('rk3')
     40domain.set_timestepping_method('rk2')
    3841domain.set_default_order(2)
    3942domain.set_store_vertices_uniquely(True) # Store as internally represented
     
    130133domain.set_boundary({'left': Bd, 'right': Br, 'bottom': Br, 'top': Br})
    131134
     135#-------------------------------------------------------------------------------
     136# Copy scripts to time stamped output directory and capture screen
     137# output to file
     138#-------------------------------------------------------------------------------
     139time = strftime('%Y%m%d_%H%M%S',localtime())
     140
     141output_dir = 'dam_break_'+time
     142output_file = 'dam_break'
     143
     144copy_code_files(output_dir,__file__)
     145#start_screen_catcher(output_dir+'_')
     146
    132147
    133148#------------------------------------------------------------------------------
     
    139154    # Initialise real-time visualiser
    140155
    141     pass
    142     #vis = RealtimeVisualiser(domain)
    143     #vis.render_quantity_height("elevation", dynamic=False)
    144     #vis.render_quantity_height("stage", dynamic=True)
    145     #vis.colour_height_quantity('stage', (0.0, 0.0, 0.8))
    146     #vis.start()
     156    #pass
     157    visualise = True
     158    if visualise:
     159        from anuga.visualiser import RealtimeVisualiser
     160        vis = RealtimeVisualiser(domain)
     161        vis.render_quantity_height("elevation", offset=0.01, dynamic=False)
     162        vis.render_quantity_height("stage", dynamic=True)
     163        vis.colour_height_quantity('stage', (0.2, 0.2, 0.8))
     164        vis.start()
     165        import time
     166        time.sleep(2.0)
     167   
     168   
    147169
    148170
     
    151173t0 = time.time()
    152174
    153 for t in domain.evolve(yieldstep = 0.005, finaltime = None):
     175for t in domain.evolve(yieldstep = 0.05, finaltime = 5.0):
    154176    print domain.timestepping_statistics()
    155     print domain.quantities['stage'].get_values(location='centroids',
    156                                                 indices=[0])
    157                                                
    158     #vis.update()                                               
    159     #time.sleep(0.1)
    160     #raw_input('pause>')
    161     #V.update_quantity('stage')
    162     #rpdb.set_active()
    163     #integral_label.text='Integral=%10.5e'%domain.quantities['stage'].get_integral()
    164 #vis.evolveFinished()
     177    #print domain.quantities['stage'].get_values(location='centroids',
     178                                                #indices=[0])
     179    if visualise:
     180        vis.update()                                           
     181
     182       
     183
     184if visualise: vis.evolveFinished()
    165185
    166186print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.