Changeset 1436


Ignore:
Timestamp:
May 19, 2005, 5:47:00 PM (19 years ago)
Author:
steve
Message:
 
Location:
inundation/ga/storm_surge
Files:
3 edited

Legend:

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

    r1434 r1436  
    2424######################
    2525# Domain
    26 filename = 'Noca_mesh_1000.tsh'   
     26filename = 'Noca_mesh_1000.tsh'
    2727print 'Creating domain from', filename
    2828domain = pmesh_to_domain_instance(filename, Domain)
     
    3131#--------------------
    3232# Order of the scheme
    33 domain.default_order = 1
     33domain.default_order = 2
    3434domain.smooth = True
    3535
     
    6969yieldstep = 0.1
    7070finaltime = 10
    71          
     71
    7272######################
    7373#Evolution
     
    7777    domain.write_time()
    7878    domain.visualiser.update_quantity_color('friction',(1.0,0.0,0.0))
    79    
     79
    8080print 'That took %.2f seconds' %(time.time()-t0)
    8181
    82    
  • inundation/ga/storm_surge/parallel/parallel_advection.py

    r1428 r1436  
    8181        # the separate processors
    8282
     83        from weave import converters
     84
    8385        stage_cv = self.quantities['stage'].centroid_values
    8486
     
    9294                        Idf  = self.full_send_dict[send_proc][0]
    9395                        Xout = self.full_send_dict[send_proc][1]
    94                         for i, _ in enumerate(Xout):
     96                        N = len(Xout)
     97
     98                        """
     99                        # Original python Code
     100                        for i in range(N):
    95101                            Xout[i] = stage_cv[Idf[i]]
     102                        """
     103                        code1 = """
     104                        for (int i=0; i<N ; i++){
     105                            Xout(i) = stage_cv(Idf(i));
     106                        }
     107                        """
     108                        weave.inline(code1, ['stage_cv','Idf','Xout','N'],
     109                                     type_converters = converters.blitz, compiler='gcc');
    96110
    97111                        pypar.send(Xout,send_proc)
     
    104118
    105119                    X = pypar.receive(iproc,X)
     120                    N = len(X)
    106121                    #print 'Processor %d receiving from Processor %d'%(self.processor,iproc)
    107                     for i, _ in enumerate(X):
     122                    for i in range(N):
    108123                        stage_cv[Idg[i]] = X[i]
    109124            pypar.barrier()
     
    115130            #print Idf
    116131            Idg  = self.ghost_recv_dict[iproc][0]
     132            N = len(Idg)
    117133            #print Idg
    118             for i, _ in enumerate(Idf):
     134            for i in range(N):
    119135                #print i,Idg[i],Idf[i]
    120136                stage_cv[Idg[i]] = stage_cv[Idf[i]]
  • inundation/ga/storm_surge/parallel/run_parallel_advection.py

    r1428 r1436  
    1818
    1919
    20 N = 20
    21 M = 20
     20#N = 50
     21N = 25
     22M = 25
    2223
    23 points, vertices, boundary, full_send_dict, ghost_recv_dict = parallel_rectangular(N, M)
     24points, vertices, boundary, full_send_dict, ghost_recv_dict = parallel_rectangular(N, M, len1=1.0)
    2425
    2526#Create advection domain with direction (1,-1)
     
    2930# Initial condition is zero by default
    3031
    31 domain.initialise_visualiser()
     32#domain.initialise_visualiser()
    3233
    3334#Boundaries
     
    5556if myid == 0:
    5657    domain.set_quantity('stage', Set_Stage(0.2,0.4,1.0))
     58    import time
     59    t0 = time.time()
    5760
    5861#Check that the boundary value gets propagated to all elements
    59 for t in domain.evolve(yieldstep = 0.1, finaltime = 3.0):
     62for t in domain.evolve(yieldstep = 0.1, finaltime = 2.0):
    6063    if myid == 0:
    6164        domain.write_time()
    6265
    6366if myid == 0:
    64     print 'Evolution ended'
     67    print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.