Changeset 3591

Ignore:
Timestamp:
Sep 14, 2006, 1:26:57 PM (17 years ago)
Message:

Fixed some bugs in build_submesh

Location:
anuga_core/source/anuga_parallel
Files:
4 edited

Unmodified
Removed
• anuga_core/source/anuga_parallel/build_submesh.py

 r3579 trianglemap = zeros(ntriangles, 'i') for t in range(tlower, tupper): n = mesh.neighbours[t, 0] if n > 0: if n >= 0: if n < tlower or n >= tupper: trianglemap[n] = 1 n = mesh.neighbours[t, 1] if n > 0: if n >= 0: if n < tlower or n >= tupper: trianglemap[n] = 1 n = mesh.neighbours[t, 2] if n > 0: if n >= 0: if n < tlower or n >= tupper: trianglemap[n] = 1 if trianglemap[t]==1: n = mesh.neighbours[t, 0] if n > 0: if n >= 0: if (n < tlower or n >= tupper) and trianglemap[n] == 0: trianglemap[n] = 1 trianglemap[n] = 2 n = mesh.neighbours[t, 1] if n > 0: if n >= 0: if (n < tlower or n >= tupper) and trianglemap[n] == 0: trianglemap[n] = 1 trianglemap[n] = 2 n = mesh.neighbours[t, 2] if n > 0: if n >= 0: if (n < tlower or n >= tupper) and trianglemap[n] == 0: trianglemap[n] = 1 trianglemap[n] = 2 # Build the triangle list and make note of the vertices subtriangles = [] for i in range(len(trianglemap)): if trianglemap[i] == 1: if trianglemap[i] != 0: t = list(mesh.triangles[i]) nodemap[t[0]] = 1 ######################################################### def is_in_processor(ghost_list, tlower, tupper, n): return (n in ghost_list) or (tlower <= n and tupper >= n) return (n in ghost_list) or (tlower <= n and tupper > n) def ghost_bnd_layer(ghosttri, tlower, tupper, mesh, p): for t in ghosttri: ghost_list.append(t[0]) for t in ghosttri: n = mesh.neighbours[t[0], 0] if not is_in_processor(ghost_list, tlower, tupper, n): subboundary[t[0], 2] = 'ghost' return subboundary # Find the boundary layer formed by the ghost triangles subbnd = ghost_bnd_layer(subtri, tupper, tlower, mesh, p) subbnd = ghost_bnd_layer(subtri, tlower, tupper, mesh, p) ghost_bnd.append(subbnd) tlower = tupper # Record the ghost layer and communication pattern submeshf = submesh_full(nodes, triangles, edges, \ triangles_per_proc) # Add any extra ghost boundary layer information
• anuga_core/source/anuga_parallel/pmesh_divide.py

 r3460 for i in range(len(triangles)): ttriangles[i] = triangles[i] return nodes, ttriangles, boundary, triangles_per_proc, quantities
• anuga_core/source/anuga_parallel/run_parallel_merimbula_test.py

 r3579 import time from sys import path print path # Numeric arrays from Numeric import array, zeros, Float from build_local   import build_local_mesh from build_commun  import send_submesh, rec_submesh, extract_hostmesh
• anuga_core/source/anuga_parallel/test_parallel_sw_runup.py

 r3590 #!/usr/bin/env python """Simple water flow example using ANUGA #-------------------------------------------------------------------------- points, vertices, boundary = rectangular_cross(10, 10) # Basic mesh domain = Domain(points, vertices, boundary) # Create domain send_submesh(submesh, triangles_per_proc, p) # Build the local mesh for processor 0 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = \ print 'Communication done' else: = rec_submesh(0) #------------------------------------------------------------------------------ # Start the computations on each subpartion full_send_dict  = full_send_dict, ghost_recv_dict = ghost_recv_dict) # Name and dir, etc currently has to be set here as they are not # Associate boundary tags with boundary objects #domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom': Br, #                     'ghost': None, 'exterior': Bd}) domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom': Br, 'ghost': None, 'exterior': Bd}) 'ghost': None})
Note: See TracChangeset for help on using the changeset viewer.