"""Example of shallow water wave equation. Generate slope """ ###################### # Module imports # from mesh_factory import rectangular from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\ Constant_height, wind_Stress from Numeric import array #Create basic mesh N = 150 points, vertices, boundary = rectangular(N, N, 1000, 1000) #Create shallow water domain domain = Domain(points, vertices, boundary) domain.smooth = True domain.visualise = False domain.store = True domain.default_order=1 #Set driving forces manning = 0.07 manning = 0.0 inflow_level = 10.0 domain.set_quantity('friction', manning) ###################### # Boundary conditions Br = Reflective_boundary(domain) Bd = Dirichlet_boundary([inflow_level,0.,0.]) domain.set_boundary({'left': Bd, 'right': Br, 'top': Br, 'bottom': Br}) domain.check_integrity() ###################### #Evolution for t in domain.evolve(yieldstep = 10, finaltime = 500): domain.write_time() print 'Done'