Changeset 1703
- Timestamp:
- Aug 10, 2005, 4:56:41 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/validation/LWRU2
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/validation/LWRU2/lwru2.py
r1697 r1703 59 59 60 60 fid.createVariable('xmomentum', Float, ('number_of_timesteps',)) 61 #fid.variables['xmomentum'][:] = 0.00562 #fid.variables['xmomentum'][:-1] = Q[1:]-Q[:-1]/0.05 #Too high63 #fid.variables['xmomentum'][:-1] = Q[1:]-Q[:-1]/0.5 #Too low64 #fid.variables['xmomentum'][:-1] = Q[1:]-Q[:-1]/0.1 #Too high65 #fid.variables['xmomentum'][:-1] = Q[1:]-Q[:-1]/0.25 #Too high66 #fid.variables['xmomentum'][:-1] = Q[1:]-Q[:-1]/0.35 #Too low67 #fid.variables['xmomentum'][:-1] = Q[1:]-Q[:-1]/0.3 #Too low68 #fid.variables['xmomentum'][-1] = 0.069 70 71 #fid.variables['xmomentum'][:] = 0.00372 61 fid.variables['xmomentum'][:] = 0.0 73 62 … … 82 71 File_boundary, Transmissive_Momentum_Set_Stage_boundary 83 72 from pyvolution.mesh_factory import rectangular 73 from pyvolution.pmesh2domain import pmesh_to_domain_instance 84 74 from Numeric import array, zeros, Float, allclose 75 import filenames 85 76 86 77 picklefile = 'domain.pck' 87 78 from cPickle import dump, load 88 79 89 90 boundary_file_name = 'Benchmark_2_input.txt' 91 bathymetry_file_name = 'Benchmark_2_Bathymetry.txt' 92 N = 100 80 N = 50 93 81 94 82 try: 95 #raise Exception83 raise Exception 96 84 fid = open(picklefile) 97 85 print 'Read pickled domain' … … 101 89 102 90 #Preparing time boundary 103 prepare_timeboundary( boundary_file_name)91 prepare_timeboundary(filenames.boundary_filename) 104 92 105 93 #Preparing points 106 94 from pyvolution.data_manager import xya2pts 107 xya2pts( bathymetry_file_name, verbose = True,95 xya2pts(filenames.bathymetry_filename, verbose = True, 108 96 z_func = lambda z: -z) 109 97 … … 111 99 ####################### 112 100 # Domain 113 print 'Creating domain' 114 points, vertices, boundary = rectangular(N, N/5*3, 115 len1=5.448, len2=3.402) 116 domain = Domain(points, vertices, boundary) 101 #print 'Creating domain' 102 #points, vertices, boundary = rectangular(N, N/5*3, 103 # len1=5.448, len2=3.402) 104 #domain = Domain(points, vertices, boundary) 105 106 print 'Creating domain from', filenames.mesh_filename 107 domain = pmesh_to_domain_instance(filenames.mesh_filename, Domain) 108 109 print "Number of triangles = ", len(domain) 110 print 'The extent is ', domain.get_extent() 111 117 112 118 113 domain.check_integrity() … … 128 123 #LS code to be included in set_quantity 129 124 from pyvolution import util, least_squares 130 points, attributes = util.read_xya( bathymetry_file_name[:-4] + '.pts')125 points, attributes = util.read_xya(filenames.bathymetry_filename[:-4] + '.pts') 131 126 132 127 #Fit attributes to mesh … … 140 135 print 'Initial values' 141 136 domain.set_quantity('elevation', vertex_attributes) 142 #domain.set_quantity('elevation', bathymetry_file_name[:-4] + '.pts')143 137 domain.set_quantity('friction', 0.0) 144 138 domain.set_quantity('stage', 0.0) … … 155 149 print 'Boundaries' 156 150 Br = Reflective_boundary(domain) 157 #Bf = File_boundary(boundary_file_name[:-4] + '.sww', domain, verbose=True)158 151 159 152 ##################### … … 161 154 # stage and let the scheme set the momentum 162 155 from pyvolution.util import file_function 163 function = file_function(boundary_file_name[:-4] + '.sww', domain,verbose = True) 156 function = file_function(filenames.boundary_filename[:-4] + '.sww', domain, 157 verbose = True) 164 158 Bts = Transmissive_Momentum_Set_Stage_boundary(domain,function) 165 159
Note: See TracChangeset
for help on using the changeset viewer.