Ignore:
Timestamp:
Sep 15, 2008, 2:04:22 PM (16 years ago)
Author:
steve
Message:

Fixed a few bugs in the parallel shallow water code. Seems to
be working for low level code. Need to check Ole' parallel api

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga_parallel/run_parallel_sw_rectangle.py

    r3876 r5763  
    3030from parallel_meshes import parallel_rectangle
    3131
    32 
     32###############################
     33# Read in processor information
     34###############################
    3335numprocs = pypar.size()
    3436myid = pypar.rank()
     
    3840N = M*numprocs
    3941
     42
    4043if myid == 0:
    4144    print 'N == %d' %N
     
    4447        parallel_rectangle(N, M, len1_g=1.0*numprocs, len2_g = 1.0)
    4548
     49print "Myid = ", myid, "no points = ", len(points), \
     50      "no vertices = ", len(vertices), "no boundaries = ", len(boundary)
    4651
     52###########################################
     53# Start the computations on each subpartion
     54###########################################
    4755
    4856domain = Parallel_Domain(points, vertices, boundary,
    4957                         full_send_dict  = full_send_dict,
    5058                         ghost_recv_dict = ghost_recv_dict)
    51 
    52 # Make a notes of which triangles are full and which are ghost
    53 
    54 tri_full_flag = build_full_flag(domain, ghost_recv_dict)
    55 
    56 print 'number of triangles = ', domain.number_of_elements
    57 
    58 
    59 rect = [ 0.0, 0.0, 1.0*numprocs, 1.0]
    60 ## try:
    61 ##     domain.initialise_visualiser(rect=rect)
    62 ##     domain.visualiser.qcolor['stage'] = (0.0, 0.0, 0.8)
    63 ##     domain.visualiser.scale_z['stage'] = 1.0
    64 ##     domain.visualiser.scale_z['elevation'] = 0.05
    65 ## except:
    66 ##     print 'No visualiser'
    67 
    68 
    69 
    70 
    71 
    7259
    7360
     
    8067
    8168domain.set_boundary( {'left': R, 'right': R, 'bottom': R, 'top': R, 'ghost': None} )
     69
     70
     71
     72
    8273domain.check_integrity()
    8374
     
    9990domain.set_quantity('stage', Set_Stage(0.2, 0.4, 0.25, 0.75, 1.0, 0.00))
    10091
     92
     93# Set Evolve parameters
     94domain.set_default_order(2)
     95domain.set_timestepping_method('rk2')
     96
     97print domain.get_timestepping_method()
     98
     99#domain.use_edge_limiter = True
     100#domain.tight_slope_limiters = True
     101#domain.use_centroid_velocities = False
     102
     103domain.CFL = 1.0
     104
     105domain.set_beta(0.8)
     106
     107
     108
    101109if myid == 0:
    102110    import time
     
    105113
    106114# Turn on the visualisation
     115visualise = True
     116if visualise:
     117    from anuga.visualiser import RealtimeVisualiser
     118    vis = RealtimeVisualiser(domain)
     119    vis.render_quantity_height("elevation", offset=0.001, dynamic=False)
     120    vis.render_quantity_height("stage", dynamic=True)
     121    vis.colour_height_quantity('stage', (0.2, 0.2, 0.8))
     122    vis.start()
     123    import time
     124    time.sleep(2.0)
    107125
    108 rect = [0.0, 0.0, 1.0, 1.0]
    109 domain.initialise_visualiser()
    110126
    111 domain.default_order = 2
    112 domain.beta_w      = 1.0
    113 domain.beta_w_dry  = 0.2
    114 domain.beta_uh     = 1.0
    115 domain.beta_uh_dry = 0.2
    116 domain.beta_vh     = 1.0
    117 domain.beta_vh_dry = 0.2
    118127
    119 #domain.beta_w      = 0.9
    120 #domain.beta_w_dry  = 0.9
    121 #domain.beta_uh     = 0.9
    122 #domain.beta_uh_dry = 0.9
    123 #domain.beta_vh     = 0.9
    124 #domain.beta_vh_dry = 0.9
    125 
    126 yieldstep = 0.005
     128yieldstep = 0.01
    127129finaltime = 1.0
    128130
     
    132134        domain.write_time()
    133135    #print_test_stats(domain, tri_full_flag)
     136    if visualise:
     137        vis.update()                                           
     138
     139
     140
     141if visualise: vis.evolveFinished()
    134142
    135143if myid == 0:
     
    140148
    141149
     150if visualise: vis.join()
    142151pypar.finalize()
Note: See TracChangeset for help on using the changeset viewer.