#!/usr/bin/env/python ######################################################### # # Shows problem of conservation of mass. Due to material being # removed if too shallow. Can lead to problems if timestep # set very small. # # # # Authors: Linda Stals, Steve Roberts, Matthew Hardy, Ole Nielsen # July 2005 # # ######################################################### ############################################## # Change min_depth and see how larger values aggravate the problem yieldstep = 0.1 finaltime = 10.0 #min_depth = 1.0e-4 min_depth = 1.0e-2 import sys from os import sep; sys.path.append('..'+sep+'pyvolution') from mesh_factory import rectangular from shallow_water import Domain, Reflective_boundary #Create shallow water domain points, vertices, boundary = rectangular(50, 50, len1=500, len2=500) domain = Domain(points, vertices, boundary) domain.smooth = False domain.visualise = True domain.default_order = 1 domain.minimum_allowed_height = min_depth print 'Extent', domain.get_extent() # Set initial condition class Set_IC: """Set an initial condition with a constant value, for x0self.x0)&(x