"""Validation study of Merimbula lake using Pyvolution. Example of shallow water wave equation applied to Malpasset dam break simulation. Copyright 2004 Christopher Zoppou, Stephen Roberts Australian National University Specific methods pertaining to the 2D shallow water equation are imported from shallow_water for use with the generic finite volume framework Conserved quantities are h, uh and vh stored as elements 0, 1 and 2 in the numerical vector named conserved_quantities. Existence of file 'Malpasset_26000.tsh' is assumed. """ ############################### # Setup Path and import modules import sys from os import sep, path sys.path.append('..'+sep+'pyvolution') from shallow_water import Domain, Reflective_boundary, File_boundary,\ Dirichlet_boundary, Transmissive_boundary from pmesh2domain import pmesh_to_domain_instance ###################### # Domain filename = 'Malpasset_26000_merged.tsh' yieldstep = 1 finaltime = 1000 print 'Creating domain from', filename domain = pmesh_to_domain_instance(filename, Domain) print "Number of triangles = ", len(domain) domain.default_order = 1 domain.smooth = True #------------------------------ # Boundary Conditions tags = {} tags['external'] = Reflective_boundary(domain) tags['open'] = Dirichlet_boundary([50.0, 0., 0.]) # replacing Transmissive_boundary(domain) domain.set_boundary(tags) #----------------- #Initial condition domain.set_quantity('stage', 0.) #------------------------------------- # Provide file name for storing output domain.store = True domain.format = 'sww' domain.filename = 'Malpasset_second_order' #---------------------------- # Friction domain.set_quantity('friction', 0.033) ###################### #Evolution import time t0 = time.time() for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime): domain.write_time() print 'That took %.2f seconds' %(time.time()-t0)