Changeset 3612
- Timestamp:
- Sep 15, 2006, 4:17:49 PM (18 years ago)
- Location:
- anuga_core/source
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
r3563 r3612 174 174 self.CFL = CFL 175 175 176 self.boundary_map = None # Will be populated by set_boundary 177 178 176 179 #Model time 177 180 self.time = 0.0 -
anuga_core/source/anuga_parallel/parallel_api.py
r3595 r3612 33 33 if myid == 0: 34 34 domain_name = domain.get_name() 35 domain_dir = domain.get_datadir() 36 # FIXME - what other attributes need to be transferred? 37 35 38 for p in range(1, numprocs): 36 print 'p', p 37 pypar.send(domain_name, p) 39 pypar.send((domain_name, domain_dir), p) 38 40 else: 39 if verbose: print ' Receiving'41 if verbose: print 'P%d: Receiving domain attributes' %(myid) 40 42 41 domain_name = pypar.receive(0) 43 domain_name, domain_dir = pypar.receive(0) 44 45 46 47 # Distribute boundary conditions 48 if myid == 0: 49 boundary_map = domain.boundary_map 50 for p in range(1, numprocs): 51 pypar.send(boundary_map, p) 52 else: 53 if verbose: print 'P%d: Receiving boundary map' %(myid) 54 55 boundary_map = pypar.receive(0) 56 57 42 58 43 59 … … 57 73 # Read in the mesh partition that belongs to this 58 74 # processor 75 if verbose: print 'P%d: Receiving submeshes' %(myid) 59 76 points, vertices, boundary, quantities,\ 60 77 ghost_recv_dict, full_send_dict,\ 61 78 = rec_submesh(0) 62 63 79 64 80 … … 78 94 79 95 #------------------------------------------------------------------------ 96 # Transfer boundary conditions to each subdomain 97 #------------------------------------------------------------------------ 98 boundary_map['ghost'] = None # Add binding to ghost boundary 99 domain.set_boundary(boundary_map) 100 101 102 #------------------------------------------------------------------------ 80 103 # Transfer other attributes to each subdomain 81 104 #------------------------------------------------------------------------ 82 83 # FIXME Do them all 84 domain.set_name(domain_name) 105 domain.set_name(domain_name) 106 domain.set_datadir(domain_dir) 85 107 86 108 #------------------------------------------------------------------------ -
anuga_core/source/anuga_parallel/test_parallel_sw_runup.py
r3595 r3612 7 7 similar to a beach environment 8 8 9 This is a very simple test of the parallel algorithm 9 This is a very simple test of the parallel algorithm using the simplified parallel API 10 10 """ 11 11 … … 23 23 from anuga.shallow_water import Transmissive_boundary 24 24 25 from parallel_api import *25 from parallel_api import distribute, myid 26 26 27 27 … … 32 32 domain = Domain(points, vertices, boundary) # Create domain 33 33 domain.set_name('runup') # Set sww filename 34 domain.set_datadir('.') # Set output dir 34 35 35 36 … … 46 47 47 48 48 #--------------------------------------------------------------------------49 # Create the parallel domain50 #--------------------------------------------------------------------------51 domain = distribute(domain, verbose=True)52 53 print 'P%d: name = %s' %(myid, domain.get_name())54 55 56 # TODO: Communicate all attributes of domain including boundary conditions57 58 # Name and dir, etc currently has to be set here as they are not59 # transferred from the original domain60 #domain.set_name('runup') # Set sww filename61 62 63 64 65 49 #------------------------------------------------------------------------------ 66 # Setup parallelboundary conditions50 # Setup boundary conditions 67 51 #------------------------------------------------------------------------------ 68 52 … … 71 55 72 56 # Associate boundary tags with boundary objects 73 domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom': Br, 74 'ghost': None}) 57 domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom': Br}) 58 59 60 #-------------------------------------------------------------------------- 61 # Create the parallel domain 62 #-------------------------------------------------------------------------- 63 domain = distribute(domain, verbose=True) 75 64 76 65 … … 80 69 81 70 for t in domain.evolve(yieldstep = 0.1, finaltime = 10.0): 82 pass 83 #domain.write_time() 71 domain.write_time() 84 72 85 73
Note: See TracChangeset
for help on using the changeset viewer.