Changeset 3916
- Timestamp:
- Nov 3, 2006, 5:16:40 PM (18 years ago)
- Location:
- anuga_validation/automated_validation_tests/okushiri_tank_validation
- Files:
-
- 2 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/okushiri_tank_validation/create_okushiri.py
r3825 r3916 8 8 from anuga.pmesh.mesh_interface import create_mesh_from_regions 9 9 from anuga.coordinate_transforms.geo_reference import Geo_reference 10 from anuga.geospatial_data import Geospatial_data 10 11 11 12 import project … … 13 14 14 15 def prepare_timeboundary(filename): 15 """Convert ingbenchmark 2 time series to NetCDF tms file.16 """Convert benchmark 2 time series to NetCDF tms file. 16 17 This is a 'throw-away' code taylor made for files like 17 18 'Benchmark_2_input.txt' from the LWRU2 benchmark 18 19 """ 19 20 20 print 'Preparing time boundary from %s' %filename21 from Scientific.IO.NetCDF import NetCDFFile 21 22 from Numeric import array 22 23 23 fid = open(filename)24 24 25 #Skip first line 25 print 'Creating', filename 26 27 # Read the ascii (.txt) version of this file 28 fid = open(filename[:-4] + '.txt') 29 30 # Skip first line 26 31 line = fid.readline() 27 32 28 # Read remaining lines33 # Read remaining lines 29 34 lines = fid.readlines() 30 35 fid.close() … … 42 47 43 48 44 #Create tms file 45 from Scientific.IO.NetCDF import NetCDFFile 49 # Create tms NetCDF file 46 50 47 outfile = filename[:-4] + '.tms' 48 print 'Writing to', outfile 49 fid = NetCDFFile(outfile, 'w') 50 51 fid = NetCDFFile(filename, 'w') 51 52 fid.institution = 'Geoscience Australia' 52 53 fid.description = 'Input wave for Benchmark 2' … … 71 72 if __name__ == "__main__": 72 73 74 73 75 # Prepare time boundary 74 76 prepare_timeboundary(project.boundary_filename) … … 82 84 #-------------------------------------------------------------------------- 83 85 84 base_resolution = 1085 86 86 # Basic geometry 87 base_resolution = 1 # Use this to coarsen or refine entire mesh. 88 89 # Basic geometry and bounding polygon 87 90 xleft = 0 88 91 xright = 5.448 … … 90 93 ytop = 3.402 91 94 92 # Outline93 95 point_sw = [xleft, ybottom] 94 96 point_se = [xright, ybottom] … … 96 98 point_ne = [xright, ytop] 97 99 98 # Midway points (left) 99 point_mtop = [xleft + (xright-xleft)/3+1, ytop] 100 point_mbottom = [xleft + (xright-xleft)/3+1, ybottom] 100 bounding_polygon = [point_se, 101 point_ne, 102 point_nw, 103 point_sw] 104 101 105 102 # Localised refined area for gulleys106 # Localised refined area for gulleys 103 107 xl = 4.8 104 108 xr = 5.3 … … 109 113 p2 = [xr, yt] 110 114 p3 = [xl, yt] 115 111 116 gulleys = [p0, p1, p2, p3] 117 112 118 113 #Island area 119 120 # Island area and drawdown region 114 121 island_0 = [xleft + 2*(xright-xleft)/3+1.2, ytop-0.5] 115 122 island_1 = [xleft + 2*(xright-xleft)/3+0.5, ybottom + 2*(ytop-ybottom)/3] 116 island_2 = [xleft + (xright-xleft)/2+0. 3, ybottom + 2*(ytop-ybottom)/3-0.3]117 island_3 = [xleft + (xright-xleft)/2+0. 3, ybottom + (ytop-ybottom)/3+0.3]123 island_2 = [xleft + (xright-xleft)/2+0.4, ybottom + 2*(ytop-ybottom)/3-0.3] 124 island_3 = [xleft + (xright-xleft)/2+0.4, ybottom + (ytop-ybottom)/3+0.3] 118 125 island_4 = [xleft + 2*(xright-xleft)/3+0.4, ybottom + (ytop-ybottom)/3-0.3] 119 island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0. 2]120 island_6 = [xl-.01, yb] # OK121 island_7 = [xl-.01, yt] #OK122 126 island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0.8] 127 island_6 = [xl-.01, yb] # Keep right edge just off the gulleys 128 island_7 = [xl-.01, yt] 129 123 130 island = [island_0, island_1, island_2, 124 131 island_3, island_4, island_5, … … 126 133 127 134 128 129 135 130 bounding_polygon = [point_se, 131 point_ne, 132 point_mtop, 133 point_nw, 134 point_sw, 135 point_mbottom] 136 136 # Region spanning half right hand side of domain just inside boundary 137 rhs_nw = [xleft + (xright-xleft)/3+1, ytop-1.4] 138 rhs_sw = [xleft + (xright-xleft)/3+1, ybottom+0.5] 139 rhs_se = [xright-0.1, ybottom+0.2] 140 rhs_ne = [xright-0.1, ytop-0.2] 137 141 138 interior_regions = [[gulleys, 0.00002*base_resolution], 139 [island, 0.00007*base_resolution]] 140 141 142 rhs_region = [rhs_nw, rhs_ne, rhs_se, rhs_sw] 142 143 143 144 144 145 print 'start create mesh from regions' 145 # Interior regions and creation of mesh 146 interior_regions = [[rhs_region, 0.0005], 147 [island, 0.0003*base_resolution], 148 [gulleys, 0.00003*base_resolution]] 146 149 147 150 meshname = project.mesh_filename + '.msh' 148 151 m = create_mesh_from_regions(bounding_polygon, 149 boundary_tags={'wall': [0, 1, 2, 4, 5],150 'wave': [ 3]},152 boundary_tags={'wall': [0, 1, 3], 153 'wave': [2]}, 151 154 maximum_triangle_area=0.1*base_resolution, 152 155 interior_regions=interior_regions, 153 156 filename=project.mesh_filename, 154 use_cache= True,157 use_cache=False, 155 158 verbose=True) 156 159 -
anuga_validation/automated_validation_tests/okushiri_tank_validation/project.py
r3708 r3916 1 """Common filenames for LWRU benchmark project 2 1 """Common filenames for Okushiri Island validation 2 Formats are given as ANUGA native netCDF where applicable. 3 2 4 """ 3 5 4 boundary_filename = 'Benchmark_2_input.txt' 5 bathymetry_filename = 'Benchmark_2_Bathymetry.txt' 6 # Given boundary wave 7 boundary_filename = 'Benchmark_2_input.tms' 8 9 # Observed timeseries 10 validation_filename = 'output_ch5-7-9.txt' 11 12 # Digital Elevation Model 13 bathymetry_filename = 'Benchmark_2_Bathymetry.pts' 14 15 # Triangular mesh 6 16 mesh_filename = 'Benchmark_2.msh' 17 18 # Model output 19 output_filename = 'okushiri_auta_validation.sww' 7 20 8 21
Note: See TracChangeset
for help on using the changeset viewer.