#!/usr/bin/env python ######################################################### # # Main file for parallel mesh testing. # # This is a modification of the run_parallel_advection.py # file. # # # Authors: Linda Stals, Steve Roberts and Matthew Hardy, # June 2005 # # # ######################################################### import pypar # The Python-MPI interface import time from Numeric import array # pmesh from print_stats import print_test_stats, build_full_flag from anuga.shallow_water import Domain from parallel_shallow_water import Parallel_Domain # mesh partition routines from parallel_meshes import parallel_rectangle ############################### # Read in processor information ############################### numprocs = pypar.size() myid = pypar.rank() processor_name = pypar.Get_processor_name() M = 50 N = M*numprocs if myid == 0: print 'N == %d' %N points, vertices, boundary, full_send_dict, ghost_recv_dict =\ parallel_rectangle(N, M, len1_g=1.0*numprocs, len2_g = 1.0) print "Myid = ", myid, "no points = ", len(points), \ "no vertices = ", len(vertices), "no boundaries = ", len(boundary) ########################################### # Start the computations on each subpartion ########################################### domain = Parallel_Domain(points, vertices, boundary, full_send_dict = full_send_dict, ghost_recv_dict = ghost_recv_dict) #Boundaries from parallel_shallow_water import Transmissive_boundary, Reflective_boundary T = Transmissive_boundary(domain) R = Reflective_boundary(domain) domain.set_boundary( {'left': R, 'right': R, 'bottom': R, 'top': R, 'ghost': None} ) domain.check_integrity() class Set_Stage: """Set an initial condition with constant water height, for xself.x0)&(xself.y0)&(y