Changeset 1810
- Timestamp:
- Sep 8, 2005, 4:36:43 PM (19 years ago)
- Location:
- inundation/validation/Completed/LWRU2
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
inundation/validation/Completed/LWRU2/Benchmark_2_Bathymetry.txt
r1654 r1810 95892 95892 5.48800e+00 3.38800e+00 -1.2500000e-01 95893 95893 5.48800e+00 3.40200e+00 -1.2500000e-01 95894 95895 95896 -
inundation/validation/Completed/LWRU2/README.txt
r1792 r1810 7 7 http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2 8 8 9 Run the code lwru2.py with the variable read_mesh = False (at the top9 Run the code lwru2.py with the variable use_variable_mesh = False (at the top 10 10 of the code) and then extract_timeseries.py to see the results. 11 11 12 12 If you wish to look at the a more detailed animation, create a mesh 13 using the script create_mesh.py and run lwru2.py again with read_mesh13 using the script create_mesh.py and run lwru2.py again with use_variable_mesh 14 14 = True. The resulting sww file can be viewed with e.g. Swollen. 15 15 -
inundation/validation/Completed/LWRU2/lwru2.py
r1775 r1810 1 """ Example ofshallow water wave equation.1 """Validation of the AnuGA implementation of the shallow water wave equation. 2 2 3 3 This script sets up LWRU2 benchmark with initial condition stated … … 11 11 12 12 13 #read_mesh = True #Use large unstructured mesh generated from create_mesh.py 14 read_mesh = False #Use small structured mesh 13 #use_variable_mesh = True #Use large variable mesh generated by create_mesh.py 14 use_variable_mesh = False #Use small structured mesh 15 16 15 17 16 18 import sys … … 73 75 # Module imports 74 76 from pyvolution.shallow_water import Domain, Reflective_boundary,\ 75 77 File_boundary, Transmissive_Momentum_Set_Stage_boundary 76 78 from pyvolution.mesh_factory import rectangular_cross 77 79 from pyvolution.pmesh2domain import pmesh_to_domain_instance 78 80 from Numeric import array, zeros, Float, allclose 79 import filenames81 import project 80 82 from caching import cache 81 83 82 84 #Preparing time boundary 83 prepare_timeboundary( filenames.boundary_filename)85 prepare_timeboundary(project.boundary_filename) 84 86 85 87 #Preparing points 86 88 from pyvolution.data_manager import xya2pts 87 xya2pts( filenames.bathymetry_filename, verbose = True,89 xya2pts(project.bathymetry_filename, verbose = True, 88 90 z_func = lambda z: -z) 89 91 … … 91 93 ####################### 92 94 # Domain 93 94 if read_mesh is True: 95 print 'Creating domain from', filenames.mesh_filename 96 #domain = pmesh_to_domain_instance(filenames.mesh_filename, Domain) 95 if use_variable_mesh is True: 96 print 'Creating domain from', project.mesh_filename 97 97 98 98 domain = cache(pmesh_to_domain_instance, 99 ( filenames.mesh_filename, Domain),100 dependencies = [ filenames.mesh_filename])99 (project.mesh_filename, Domain), 100 dependencies = [project.mesh_filename]) 101 101 102 102 … … 131 131 132 132 domain.set_quantity('elevation', 133 filename= filenames.bathymetry_filename[:-4] + '.pts',133 filename=project.bathymetry_filename[:-4] + '.pts', 134 134 alpha = 0.0001, 135 135 verbose = True, … … 147 147 Br = Reflective_boundary(domain) 148 148 149 #####################150 # Error with File Boundary. We need to only set151 # stage and let the scheme set the momentum152 149 from pyvolution.util import file_function 153 function = file_function( filenames.boundary_filename[:-4] + '.sww', domain,150 function = file_function(project.boundary_filename[:-4] + '.sww', domain, 154 151 verbose = True) 155 152 Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function) 156 153 157 154 #Set boundary conditions 158 if read_mesh is True:155 if use_variable_mesh is True: 159 156 domain.set_boundary({'wave': Bts, 'wall': Br}) 160 157 else: … … 165 162 import time 166 163 t0 = time.time() 167 #domain.visualise = True168 164 169 165 for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5): 170 166 domain.write_time() 171 #Stage_cv = domain.quantities['stage'].centroid_values172 #print Stage_cv[0]173 #print 'Function value',function(t)174 167 175 168 print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset
for help on using the changeset viewer.