Changeset 3591
- Timestamp:
- Sep 14, 2006, 1:26:57 PM (19 years ago)
- Location:
- anuga_core/source/anuga_parallel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga_parallel/build_submesh.py
r3579 r3591 136 136 trianglemap = zeros(ntriangles, 'i') 137 137 for t in range(tlower, tupper): 138 138 139 n = mesh.neighbours[t, 0] 139 if n > 0:140 if n >= 0: 140 141 if n < tlower or n >= tupper: 141 142 trianglemap[n] = 1 142 143 n = mesh.neighbours[t, 1] 143 if n > 0:144 if n >= 0: 144 145 if n < tlower or n >= tupper: 145 146 trianglemap[n] = 1 146 147 n = mesh.neighbours[t, 2] 147 if n > 0:148 if n >= 0: 148 149 if n < tlower or n >= tupper: 149 150 trianglemap[n] = 1 … … 154 155 if trianglemap[t]==1: 155 156 n = mesh.neighbours[t, 0] 156 if n > 0:157 if n >= 0: 157 158 if (n < tlower or n >= tupper) and trianglemap[n] == 0: 158 trianglemap[n] = 1159 trianglemap[n] = 2 159 160 n = mesh.neighbours[t, 1] 160 if n > 0:161 if n >= 0: 161 162 if (n < tlower or n >= tupper) and trianglemap[n] == 0: 162 trianglemap[n] = 1163 trianglemap[n] = 2 163 164 n = mesh.neighbours[t, 2] 164 if n > 0:165 if n >= 0: 165 166 if (n < tlower or n >= tupper) and trianglemap[n] == 0: 166 trianglemap[n] = 1167 trianglemap[n] = 2 167 168 168 169 # Build the triangle list and make note of the vertices … … 173 174 subtriangles = [] 174 175 for i in range(len(trianglemap)): 175 if trianglemap[i] == 1:176 if trianglemap[i] != 0: 176 177 t = list(mesh.triangles[i]) 177 178 nodemap[t[0]] = 1 … … 233 234 ######################################################### 234 235 def is_in_processor(ghost_list, tlower, tupper, n): 235 return (n in ghost_list) or (tlower <= n and tupper > =n)236 return (n in ghost_list) or (tlower <= n and tupper > n) 236 237 237 238 def ghost_bnd_layer(ghosttri, tlower, tupper, mesh, p): … … 242 243 for t in ghosttri: 243 244 ghost_list.append(t[0]) 244 245 245 246 for t in ghosttri: 246 247 n = mesh.neighbours[t[0], 0] … … 255 256 if not is_in_processor(ghost_list, tlower, tupper, n): 256 257 subboundary[t[0], 2] = 'ghost' 257 258 258 259 return subboundary 259 260 … … 411 412 # Find the boundary layer formed by the ghost triangles 412 413 413 subbnd = ghost_bnd_layer(subtri, t upper, tlower, mesh, p)414 subbnd = ghost_bnd_layer(subtri, tlower, tupper, mesh, p) 414 415 ghost_bnd.append(subbnd) 415 416 … … 423 424 424 425 tlower = tupper 426 425 427 426 428 # Record the ghost layer and communication pattern … … 526 528 submeshf = submesh_full(nodes, triangles, edges, \ 527 529 triangles_per_proc) 528 530 529 531 # Add any extra ghost boundary layer information 530 532 -
anuga_core/source/anuga_parallel/pmesh_divide.py
r3460 r3591 190 190 for i in range(len(triangles)): 191 191 ttriangles[i] = triangles[i] 192 192 193 193 return nodes, ttriangles, boundary, triangles_per_proc, quantities -
anuga_core/source/anuga_parallel/run_parallel_merimbula_test.py
r3579 r3591 29 29 import time 30 30 31 from sys import path 32 33 print path 34 31 35 # Numeric arrays 32 36 from Numeric import array, zeros, Float … … 48 52 from build_local import build_local_mesh 49 53 from build_commun import send_submesh, rec_submesh, extract_hostmesh 54 50 55 51 56 -
anuga_core/source/anuga_parallel/test_parallel_sw_runup.py
r3590 r3591 1 #!/usr/bin/env python 2 3 1 4 """Simple water flow example using ANUGA 2 5 … … 41 44 #-------------------------------------------------------------------------- 42 45 43 44 46 points, vertices, boundary = rectangular_cross(10, 10) # Basic mesh 47 45 48 domain = Domain(points, vertices, boundary) # Create domain 46 49 … … 95 98 send_submesh(submesh, triangles_per_proc, p) 96 99 100 97 101 # Build the local mesh for processor 0 98 102 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = \ … … 100 104 101 105 print 'Communication done' 106 102 107 103 108 else: … … 109 114 = rec_submesh(0) 110 115 111 112 113 116 #------------------------------------------------------------------------------ 114 117 # Start the computations on each subpartion … … 119 122 full_send_dict = full_send_dict, 120 123 ghost_recv_dict = ghost_recv_dict) 121 122 124 123 125 # Name and dir, etc currently has to be set here as they are not … … 142 144 143 145 # Associate boundary tags with boundary objects 146 #domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom': Br, 147 # 'ghost': None, 'exterior': Bd}) 144 148 domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom': Br, 145 'ghost': None, 'exterior': Bd}) 146 149 'ghost': None}) 147 150 148 151 … … 155 158 156 159 157
Note: See TracChangeset
for help on using the changeset viewer.