Changeset 1510
- Timestamp:
- Jun 9, 2005, 5:49:59 PM (20 years ago)
- Location:
- inundation/ga/storm_surge
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/parallel/advection.py
r1472 r1510 23 23 Geoscience Australia, 2004 24 24 """ 25 26 27 import logging, logging.config 28 logger = logging.getLogger('advection') 29 logger.setLevel(logging.WARNING) 30 31 try: 32 logging.config.fileConfig('log.ini') 33 except: 34 pass 35 25 36 26 37 from realtime_visualisation_new import Visualiser … … 52 63 self.smooth = True 53 64 54 def initialise_visualiser(self,scale_z=1.0 ):65 def initialise_visualiser(self,scale_z=1.0,rect=None): 55 66 #Realtime visualisation 56 67 if self.visualiser is None: 57 self.visualiser = Visualiser(self,scale_z )68 self.visualiser = Visualiser(self,scale_z,rect) 58 69 self.visualise = True 59 70 … … 297 308 """ 298 309 310 logger.debug('Trying to weave compute_fluxes') 299 311 weave.inline(code, ['stage_edge','stage_bdry','stage_update', 300 312 'neighbours','neighbour_edges','normals', -
inundation/ga/storm_surge/parallel/build_local.py
r1500 r1510 1 1 ######################################################### 2 # 2 # 3 3 # Given the subdivision of the grid assigned to the 4 4 # current processor convert it into a form that is 5 # appropriate for the GA datastructure. 6 # 5 # appropriate for the GA datastructure. 6 # 7 7 # The main function of these modules is to change the 8 8 # node numbering. The GA datastructure assumes they … … 38 38 39 39 def build_local_GA(nodes, triangles): 40 40 41 41 Nnodes =len(nodes) 42 42 Ntriangles = len(triangles) 43 43 44 44 index={} #a dictionary mapping existing node ids to the new ids 0,1,2,... 45 45 … … 51 51 GAnodes.append(nodes[node_idnew][1:3]) 52 52 nodes[node_idnew][0]=node_idnew #renumber the node 53 54 #Now loop over the triangles, changing the node ids and orientation. 53 54 #Now loop over the triangles, changing the node ids and orientation. 55 55 for t in range(Ntriangles): 56 56 for i in range(3): … … 59 59 60 60 del (index) 61 61 62 62 return GAnodes, triangles 63 63 … … 92 92 93 93 # initialise 94 94 95 95 full_send = {} 96 96 ghost_recv = {} … … 98 98 # build the ghost_recv dictionary (sort the 99 99 # information by the global numbering) 100 100 101 101 ghostc.sort(sort_tup) 102 102 for c in ghostc: … … 113 113 # (this version allows the information to be stored 114 114 # by the global numbering) 115 115 116 116 tmp_send = {} 117 117 for global_id in fullc: … … 124 124 # extract the full send information and put it in the form 125 125 # required for the full_send dictionary 126 126 127 127 for neigh in tmp_send: 128 128 neigh_commun = tmp_send[neigh] … … 137 137 full_send[neigh][2].append(0.0) 138 138 139 140 # parallel advection expects numeric arrays 141 for key in full_send: 142 full_send[key][0] = array(full_send[key][0],Int) 143 full_send[key][1] = array(full_send[key][1],Int) 144 full_send[key][2] = array(full_send[key][2],Float) 145 146 for key in ghost_recv: 147 ghost_recv[key][0] = array(ghost_recv[key][0],Int) 148 ghost_recv[key][1] = array(ghost_recv[key][1],Int) 149 ghost_recv[key][2] = array(ghost_recv[key][2],Float) 150 151 139 152 return ghost_recv, full_send 140 153 … … 147 160 # *) Change the nodes global ID's to an integer value, 148 161 # starting from 0. The node numbering in the triangles 149 # must also be updated to take this into accound. 162 # must also be updated to take this into accound. 150 163 # 151 164 # *) The triangle number will also change, which affects … … 163 176 164 177 # combine the full nodes and ghost nodes 165 178 166 179 nodes = submesh["full_nodes"] 167 180 nodes.extend(submesh["ghost_nodes"]) 168 181 169 182 # combine the full triangles and ghost triangles 170 183 171 184 triangles = submesh["full_triangles"] 172 185 triangles.extend(map(lambda t: t[1], submesh["ghost_triangles"])) … … 174 187 # renumber the boundary edges to correspond to the new 175 188 # triangle numbering 176 189 177 190 GAboundary = {} 178 191 for b in submesh["full_boundary"]: … … 180 193 181 194 # make note of the new triangle numbers, including the ghost 182 # triangles 183 195 # triangles 196 184 197 index = {} 185 198 for i in range(lower_t, upper_t): … … 190 203 # change the node numbering (and update the numbering in the 191 204 # triangles) 192 205 193 206 [GAnodes, GAtriangles] = build_local_GA(nodes, triangles) 194 207 195 208 # change the communication pattern into a form needed by 196 209 # the parallel_advection.py file 197 210 198 211 gcommun = submesh["ghost_commun"] 199 212 fcommun = submesh["full_commun"] … … 201 214 202 215 # clean up before exiting 203 216 204 217 del(index) 205 218 206 219 return GAnodes, GAtriangles, GAboundary, ghost_rec, full_send -
inundation/ga/storm_surge/parallel/parallel_advection.py
r1500 r1510 14 14 """ 15 15 16 import logging, logging.config 17 logger = logging.getLogger('parallel') 18 logger.setLevel(logging.WARNING) 19 20 try: 21 logging.config.fileConfig('log.ini') 22 except: 23 pass 24 16 25 from advection import * 17 26 Advection_Domain = Domain … … 41 50 42 51 self.full_send_dict = full_send_dict 52 # for key in self.full_send_dict: 53 # self.full_send_dict[key][0] = array(self.full_send_dict[key][0],Int) 54 # self.full_send_dict[key][2] = array(self.full_send_dict[key][2],Float) 55 56 43 57 self.ghost_recv_dict = ghost_recv_dict 58 # for key in self.ghost_recv_dict: 59 # self.ghost_recv_dict[key][0] = array(self.ghost_recv_dict[key][0],Int) 60 # self.ghost_recv_dict[key][2] = array(self.ghost_recv_dict[key][2],Float) 44 61 45 62 self.communication_time = 0.0 … … 61 78 # Calculate local timestep 62 79 Advection_Domain.update_timestep(self, yieldstep, finaltime) 63 80 64 81 import time 65 82 t0 = time.time() … … 72 89 gtimestep = zeros( 1, Float) # Buffer for results 73 90 74 91 75 92 #LINDA 76 93 pypar.raw_reduce(ltimestep, gtimestep, pypar.MIN, 0) … … 99 116 import time 100 117 t0 = time.time() 101 118 102 119 stage_cv = self.quantities['stage'].centroid_values 103 120 104 121 # update of non-local ghost cells 105 122 for iproc in range(self.numproc): … … 113 130 Idf = self.full_send_dict[send_proc][0] 114 131 Xout = self.full_send_dict[send_proc][2] 115 #Xout = self.full_send_dict[send_proc][1] 132 116 133 N = len(Xout) 117 134 118 # for i in range(N): 119 # Xout[i] = stage_cv[Idf[i]] 120 121 # pypar.send(Xout,send_proc) 122 123 # return 124 125 # """ 126 # ============================== 135 136 #============================== 127 137 # Original python Code 128 138 for i in range(N): 129 139 Xout[i] = stage_cv[Idf[i]] 130 #==============================131 # """ 140 #============================== 141 132 142 133 143 #LINDA: 134 144 #could not get the code below to work, kept on complaining about error: no match for call to `(py::list) (int&)' 135 145 136 #code1 = """137 #for (int i=0; i<N ; i++){138 #Xout(i) = stage_cv(Idf(i));139 #}140 #"""141 #weave.inline(code1, ['stage_cv','Idf','Xout','N'],142 #type_converters = converters.blitz, compiler='gcc');146 code1 = """ 147 for (int i=0; i<N ; i++){ 148 Xout(i) = stage_cv(Idf(i)); 149 } 150 """ 151 #weave.inline(code1, ['stage_cv','Idf','Xout','N'], 152 # type_converters = converters.blitz, compiler='gcc'); 143 153 144 154 pypar.send(Xout,send_proc) … … 148 158 #Receive data from the iproc processor 149 159 if self.ghost_recv_dict.has_key(iproc): 150 160 151 161 # LINDA: 152 # now store ghost as local id, global id, value 162 # now store ghost as local id, global id, value 153 163 Idg = self.ghost_recv_dict[iproc][0] 154 164 X = self.ghost_recv_dict[iproc][2] 155 #X = self.ghost_recv_dict[iproc][1]156 165 157 166 X = pypar.receive(iproc,X) … … 159 168 160 169 #LINDA: had problems getting C code to work 161 162 # """ 163 #===========================170 171 172 #=========================== 164 173 # Origin Python Code 165 174 for i in range(N): 166 175 stage_cv[Idg[i]] = X[i] 167 #===========================168 # """ 169 170 #code2 = """171 #for (int i=0; i<N; i++){172 #stage_cv(Idg(i)) = X(i);173 #}174 #"""176 #=========================== 177 178 179 code2 = """ 180 for (int i=0; i<N; i++){ 181 stage_cv(Idg(i)) = X(i); 182 } 183 """ 175 184 # weave.inline(code2, ['stage_cv','Idg','X','N'], 176 185 # type_converters = converters.blitz, compiler='gcc'); 177 186 178 187 #local update of ghost cells 179 188 iproc = self.processor … … 183 192 # now store full as local id, global id, value 184 193 Idf = self.full_send_dict[iproc][0] 185 194 186 195 # LINDA: 187 196 # now store ghost as local id, global id, value 188 197 Idg = self.ghost_recv_dict[iproc][0] 189 198 190 199 N = len(Idg) 191 200 192 """ 201 193 202 #====================================== 194 203 # Original python loop … … 197 206 stage_cv[Idg[i]] = stage_cv[Idf[i]] 198 207 #====================================== 199 """ 208 200 209 201 210 code3 = """ … … 204 213 } 205 214 """ 206 weave.inline(code3, ['stage_cv','Idg','Idf','N'],207 type_converters = converters.blitz, compiler='gcc');215 #weave.inline(code3, ['stage_cv','Idg','Idf','N'], 216 # type_converters = converters.blitz, compiler='gcc'); 208 217 209 218 self.communication_time += time.time()-t0 … … 346 355 347 356 348 def parallel_rectangular(m, n, len1=1.0, len2=1.0, origin = (0.0, 0.0)):349 350 351 """Setup a rectangular grid of triangles352 with m+1 by n+1 grid points353 and side lengths len1, len2. If side lengths are omitted354 the mesh defaults to the unit square, divided between all the355 processors356 357 len1: x direction (left to right)358 len2: y direction (bottom to top)359 """360 361 from config import epsilon362 from Numeric import zeros, Float, Int363 364 processor = pypar.rank()365 numproc = pypar.size()366 367 368 369 delta1 = float(len1)/m370 delta2 = float(len2)/n371 372 #Calculate number of points373 Np = (m+1)*(n+1)374 375 class VIndex:376 377 def __init__(self, n,m):378 self.n = n379 self.m = m380 381 def __call__(self, i,j):382 return j+i*(self.n+1)383 384 class EIndex:385 386 def __init__(self, n,m):387 self.n = n388 self.m = m389 390 def __call__(self, i,j):391 return 2*(j+i*self.n)392 393 394 I = VIndex(n,m)395 E = EIndex(n,m)396 397 points = zeros( (Np,2), Float)398 399 for i in range(m+1):400 for j in range(n+1):401 402 points[I(i,j),:] = [i*delta1 + origin[0], j*delta2 + origin[1]]403 404 #Construct 2 triangles per rectangular element and assign tags to boundary405 #Calculate number of triangles406 Nt = 2*m*n407 408 409 elements = zeros( (Nt,3), Int)410 boundary = {}411 Idgl = []412 Xgl = []413 Idfl = []414 Xfl = []415 Idgr = []416 Xgr = []417 Idfr = []418 Xfr = []419 420 full_send_dict = {}421 ghost_recv_dict = {}422 nt = -1423 for i in range(m):424 for j in range(n):425 426 i1 = I(i,j+1)427 i2 = I(i,j)428 i3 = I(i+1,j+1)429 i4 = I(i+1,j)430 431 #Lower Element432 nt = E(i,j)433 if i == m-1:434 #print 'nt =',nt435 Idgr.append(nt)436 Idfr.append(E(1,j))437 if i == 0:438 Idgl.append(nt)439 Idfl.append(E(m-2,j))440 441 if i == m-1:442 boundary[nt, 2] = 'right'443 if j == 0:444 boundary[nt, 1] = 'bottom'445 elements[nt,:] = [i4,i3,i2]446 447 #Upper Element448 nt = E(i,j)+1449 if i == m-1:450 Idgr.append(nt)451 Idfr.append(E(1,j)+1)452 if i == 0:453 Idgl.append(nt)454 Idfl.append(E(m-2,j)+1)455 456 if i == 0:457 boundary[nt, 2] = 'left'458 if j == n-1:459 boundary[nt, 1] = 'top'460 elements[nt,:] = [i1,i2,i3]461 462 Idfl = array(Idfl,Int)463 Idgl = array(Idgl,Int)464 Xfl = zeros(Idfl.shape,Float)465 Xgl = zeros(Idgl.shape,Float)466 467 Idfr = array(Idfr,Int)468 Idgr = array(Idgr,Int)469 Xfr = zeros(Idfr.shape,Float)470 Xgr = zeros(Idgr.shape,Float)471 472 #print Idf473 #print Idg474 full_send_dict[(processor-1)%numproc] = [Idfl, Xfl]475 ghost_recv_dict[(processor-1)%numproc] = [Idgl, Xgl]476 full_send_dict[(processor+1)%numproc] = [Idfr, Xfr]477 ghost_recv_dict[(processor+1)%numproc] = [Idgr, Xgr]478 479 return points, elements, boundary, full_send_dict, ghost_recv_dict480 481 482 483 def rectangular_periodic(m, n, len1=1.0, len2=1.0, origin = (0.0, 0.0)):484 485 486 """Setup a rectangular grid of triangles487 with m+1 by n+1 grid points488 and side lengths len1, len2. If side lengths are omitted489 the mesh defaults to the unit square.490 491 len1: x direction (left to right)492 len2: y direction (bottom to top)493 494 Return to lists: points and elements suitable for creating a Mesh or495 FVMesh object, e.g. Mesh(points, elements)496 """497 498 from config import epsilon499 from Numeric import zeros, Float, Int500 501 delta1 = float(len1)/m502 delta2 = float(len2)/n503 504 #Calculate number of points505 Np = (m+1)*(n+1)506 507 class VIndex:508 509 def __init__(self, n,m):510 self.n = n511 self.m = m512 513 def __call__(self, i,j):514 return j+i*(self.n+1)515 516 class EIndex:517 518 def __init__(self, n,m):519 self.n = n520 self.m = m521 522 def __call__(self, i,j):523 return 2*(j+i*self.n)524 525 526 I = VIndex(n,m)527 E = EIndex(n,m)528 529 points = zeros( (Np,2), Float)530 531 for i in range(m+1):532 for j in range(n+1):533 534 points[I(i,j),:] = [i*delta1 + origin[0], j*delta2 + origin[1]]535 536 #Construct 2 triangles per rectangular element and assign tags to boundary537 #Calculate number of triangles538 Nt = 2*m*n539 540 541 elements = zeros( (Nt,3), Int)542 boundary = {}543 ghosts = {}544 nt = -1545 for i in range(m):546 for j in range(n):547 548 i1 = I(i,j+1)549 i2 = I(i,j)550 i3 = I(i+1,j+1)551 i4 = I(i+1,j)552 553 #Lower Element554 nt = E(i,j)555 if i == m-1:556 ghosts[nt] = E(1,j)557 if i == 0:558 ghosts[nt] = E(m-2,j)559 560 if j == n-1:561 ghosts[nt] = E(i,1)562 563 if j == 0:564 ghosts[nt] = E(i,n-2)565 566 if i == m-1:567 boundary[nt, 2] = 'right'568 if j == 0:569 boundary[nt, 1] = 'bottom'570 elements[nt,:] = [i4,i3,i2]571 572 #Upper Element573 nt = E(i,j)+1574 if i == m-1:575 ghosts[nt] = E(1,j)+1576 if i == 0:577 ghosts[nt] = E(m-2,j)+1578 579 if j == n-1:580 ghosts[nt] = E(i,1)+1581 582 if j == 0:583 ghosts[nt] = E(i,n-2)+1584 585 if i == 0:586 boundary[nt, 2] = 'left'587 if j == n-1:588 boundary[nt, 1] = 'top'589 elements[nt,:] = [i1,i2,i3]590 591 #bottom left592 nt = E(0,0)593 nf = E(m-2,n-2)594 ghosts[nt] = nf595 ghosts[nt+1] = nf+1596 597 #bottom right598 nt = E(m-1,0)599 nf = E(1,n-2)600 ghosts[nt] = nf601 ghosts[nt+1] = nf+1602 603 #top left604 nt = E(0,n-1)605 nf = E(m-2,1)606 ghosts[nt] = nf607 ghosts[nt+1] = nf+1608 609 #top right610 nt = E(m-1,n-1)611 nf = E(1,1)612 ghosts[nt] = nf613 ghosts[nt+1] = nf+1614 615 return points, elements, boundary, ghosts616 617 def rectangular_periodic_lr(m, n, len1=1.0, len2=1.0, origin = (0.0, 0.0)):618 619 620 """Setup a rectangular grid of triangles621 with m+1 by n+1 grid points622 and side lengths len1, len2. If side lengths are omitted623 the mesh defaults to the unit square.624 625 len1: x direction (left to right)626 len2: y direction (bottom to top)627 628 Return to lists: points and elements suitable for creating a Mesh or629 Domain object, e.g. Mesh(points, elements)630 """631 632 from config import epsilon633 from Numeric import zeros, Float, Int634 635 delta1 = float(len1)/m636 delta2 = float(len2)/n637 638 #Calculate number of points639 Np = (m+1)*(n+1)640 641 class VIndex:642 643 def __init__(self, n,m):644 self.n = n645 self.m = m646 647 def __call__(self, i,j):648 return j+i*(self.n+1)649 650 class EIndex:651 652 def __init__(self, n,m):653 self.n = n654 self.m = m655 656 def __call__(self, i,j):657 return 2*(j+i*self.n)658 659 660 I = VIndex(n,m)661 E = EIndex(n,m)662 663 points = zeros( (Np,2), Float)664 665 for i in range(m+1):666 for j in range(n+1):667 668 points[I(i,j),:] = [i*delta1 + origin[0], j*delta2 + origin[1]]669 670 #Construct 2 triangles per rectangular element and assign tags to boundary671 #Calculate number of triangles672 Nt = 2*m*n673 674 675 elements = zeros( (Nt,3), Int)676 boundary = {}677 ghosts = {}678 nt = -1679 for i in range(m):680 for j in range(n):681 682 i1 = I(i,j+1)683 i2 = I(i,j)684 i3 = I(i+1,j+1)685 i4 = I(i+1,j)686 687 #Lower Element688 nt = E(i,j)689 if i == m-1:690 ghosts[nt] = E(1,j)691 if i == 0:692 ghosts[nt] = E(m-2,j)693 694 if i == m-1:695 boundary[nt, 2] = 'right'696 if j == 0:697 boundary[nt, 1] = 'bottom'698 elements[nt,:] = [i4,i3,i2]699 700 #Upper Element701 nt = E(i,j)+1702 if i == m-1:703 ghosts[nt] = E(1,j)+1704 if i == 0:705 ghosts[nt] = E(m-2,j)+1706 707 if i == 0:708 boundary[nt, 2] = 'left'709 if j == n-1:710 boundary[nt, 1] = 'top'711 elements[nt,:] = [i1,i2,i3]712 713 714 return points, elements, boundary, ghosts -
inundation/ga/storm_surge/parallel/parallel_meshes.py
r1461 r1510 174 174 Xgr = zeros(Idgr.shape,Float) 175 175 176 full_send_dict[(processor-1)%numproc] = [Idfl, Xfl]177 ghost_recv_dict[(processor-1)%numproc] = [Idgl, Xgl]178 full_send_dict[(processor+1)%numproc] = [Idfr, Xfr]179 ghost_recv_dict[(processor+1)%numproc] = [Idgr, Xgr]176 full_send_dict[(processor-1)%numproc] = [Idfl, Idfl, Xfl] 177 ghost_recv_dict[(processor-1)%numproc] = [Idgl, Idgl, Xgl] 178 full_send_dict[(processor+1)%numproc] = [Idfr, Idfr, Xfr] 179 ghost_recv_dict[(processor+1)%numproc] = [Idgr, Idgr, Xgr] 180 180 181 181 return points, elements, boundary, full_send_dict, ghost_recv_dict -
inundation/ga/storm_surge/parallel/run_parallel_mesh.py
r1500 r1510 1 1 #!/usr/bin/env python 2 2 ######################################################### 3 # 3 # 4 4 # Main file for parallel mesh testing. 5 5 # … … 12 12 # required to build the grid, i.e. a higher number 13 13 # corresponds to a finer grid. The term infront of the c 14 # corresponds to the number of processors. 14 # corresponds to the number of processors. 15 15 # 16 16 # *) The (new) files that have been added to manage the … … 44 44 # 45 45 # 46 # 46 # 47 47 ######################################################### 48 48 … … 99 99 100 100 # read in the test files 101 102 f=open('test_ 5l_4c.out', 'r')101 102 f=open('test_3l_1c.out', 'r') 103 103 [nodes, triangles, boundary, triangles_per_proc] = mg2ga(f) 104 104 105 105 # subdivide the mesh 106 106 107 107 submesh = build_submesh(nodes, triangles, boundary, triangles_per_proc) 108 108 109 109 # send the mesh partition to the appropriate processor 110 110 111 111 for p in range(numprocs): 112 112 send_submesh(submesh, triangles_per_proc, tagmap, p) … … 125 125 # start the initialisation routines 126 126 127 #rect = [ 0.0, 0.0, 1.0, 1.0] 127 128 domain.initialise_visualiser() 128 #domain.visualise= False129 129 #domain.visualise=True 130 130 131 #Boundaries 131 132 … … 155 156 import time 156 157 t0 = time.time() 158 159 157 160 for t in domain.evolve(yieldstep = 0.1, finaltime = 2.0): 158 161 if myid == 0: 159 domain.write_time() 162 domain.write_time() 163 164 160 165 if myid == 0: 161 166 print 'That took %.2f seconds' %(time.time()-t0) … … 163 168 print 'Reduction Communication time %.2f seconds'%domain.communication_reduce_time 164 169 165 170 166 171 print "`````````````````````````````" 167 172 pypar.finalize() -
inundation/ga/storm_surge/pyvolution/netherlands.py
r1404 r1510 117 117 domain.filename, _ = os.path.splitext(base) 118 118 else: 119 domain. visualise = True119 domain.initialise_visualiser(rect=[0.0,0.0,2.0,2.0]) 120 120 domain.visualise_color_stage = False 121 121 domain.visualise_timer = True 122 122 domain.checkpoint = False 123 123 domain.store = False 124 124 125 125 126 -
inundation/ga/storm_surge/pyvolution/realtime_visualisation_new.py
r1471 r1510 9 9 class Visualiser: 10 10 11 def __init__(self,domain,scale_z=1.0 ):11 def __init__(self,domain,scale_z=1.0,rect=None): 12 12 """Create visualisation of domain 13 13 """ … … 29 29 #print self.z_models 30 30 31 self.max_x = max(max(self.vertices[:,0]),max(self.vertices[:,2]),max(self.vertices[:,4])) 32 self.min_x = min(min(self.vertices[:,0]),min(self.vertices[:,2]),min(self.vertices[:,4])) 33 self.max_y = max(max(self.vertices[:,1]),max(self.vertices[:,3]),max(self.vertices[:,5])) 34 self.min_y = min(min(self.vertices[:,1]),min(self.vertices[:,3]),min(self.vertices[:,5])) 35 self.range_x = self.max_x - self.min_x 36 self.range_y = self.max_y - self.min_y 37 self.range_xy = max(self.range_x, self.range_y) 31 if rect is None: 32 self.max_x = max(max(self.vertices[:,0]),max(self.vertices[:,2]),max(self.vertices[:,4])) 33 self.min_x = min(min(self.vertices[:,0]),min(self.vertices[:,2]),min(self.vertices[:,4])) 34 self.max_y = max(max(self.vertices[:,1]),max(self.vertices[:,3]),max(self.vertices[:,5])) 35 self.min_y = min(min(self.vertices[:,1]),min(self.vertices[:,3]),min(self.vertices[:,5])) 36 self.range_x = self.max_x - self.min_x 37 self.range_y = self.max_y - self.min_y 38 self.range_xy = max(self.range_x, self.range_y) 39 else: 40 self.max_x = rect[2] 41 self.min_x = rect[0] 42 self.max_y = rect[3] 43 self.min_y = rect[1] 44 self.range_x = self.max_x - self.min_x 45 self.range_y = self.max_y - self.min_y 46 self.range_xy = max(self.range_x, self.range_y) 47 38 48 39 49 # print 'min_x=',self.min_x … … 211 221 212 222 223 213 224 def update_arrays_color(self,quantity,qcolor,scale_z): 214 225 … … 305 316 306 317 code1 = """ 318 307 319 double s = 1.0; 308 320 -
inundation/ga/storm_surge/pyvolution/shallow_water.py
r1509 r1510 108 108 #self.eta = self.quantities['friction'] 109 109 110 def initialise_visualiser(self,scale_z=1.0 ):110 def initialise_visualiser(self,scale_z=1.0,rect=None): 111 111 #Realtime visualisation 112 112 if self.visualiser is None: 113 from realtime_visualisation_new import Visualiser 114 self.visualiser = Visualiser(self,scale_z )113 from realtime_visualisation_new import Visualiser 114 self.visualiser = Visualiser(self,scale_z,rect) 115 115 self.visualise = True 116 116 … … 204 204 if self.visualise is True and self.time == 0.0: 205 205 import realtime_visualisation_new as visualise 206 #import realtime_visualisation as visualise 206 #import realtime_visualisation as visualise 207 207 visualise.create_surface(self) 208 208 -
inundation/ga/storm_surge/zeus/parallel.zpi
r1472 r1510 74 74 <ReleaseProjectReload>Off</ReleaseProjectReload> 75 75 <file>..\parallel\advection.py</file> 76 <file>..\parallel\build_commun.py</file> 77 <file>..\parallel\build_local.py</file> 78 <file>..\parallel\build_submesh.py</file> 76 79 <file>..\parallel\linda_dummy.py</file> 77 80 <file>..\parallel\mg2ga.py</file> … … 80 83 <file>..\parallel\run_advection.py</file> 81 84 <file>..\parallel\run_parallel_advection.py</file> 85 <file>..\parallel\run_parallel_mesh.py</file> 82 86 <file>..\parallel\test_advection.py</file> 83 87 <folder name="Header Files" />
Note: See TracChangeset
for help on using the changeset viewer.