Changeset 4555
- Timestamp:
- Jun 21, 2007, 3:23:11 PM (18 years ago)
- Location:
- anuga_validation/automated_validation_tests/okushiri_tank_validation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/automated_validation_tests/okushiri_tank_validation/compare_timeseries_with_measures.py
r4529 r4555 141 141 # rtol=rtol, atol=atol) 142 142 if plotting is False: 143 assert allclose(reference_value, computed_value, rtol=rtol, atol=atol), msg 143 assert allclose(reference_value, computed_value, 144 rtol=rtol, atol=atol), msg 144 145 145 146 … … 215 216 216 217 218 # Check max runup 219 220 from anuga.shallow_water.data_manager import get_maximum_inundation_elevation 221 from anuga.shallow_water.data_manager import get_maximum_inundation_location 222 from anuga.utilities.polygon import is_inside_polygon 223 224 q = get_maximum_inundation_elevation(sww_filename) 225 loc = get_maximum_inundation_location(sww_filename) 226 227 228 print 'Max runup elevation: ', q 229 print 'Max runup location: ', loc 230 231 232 from create_okushiri import gulleys 233 assert is_inside_polygon(loc, gulleys) 234 235 # FIXME more asserts here 236 237 238 239 #msg = 'We got %f, should have been %f' %(q, q_max) 240 #assert allclose(q, q_max, rtol=1.0/N), msg 241 ##print 'loc', loc, q 242 #assert allclose(-loc[0]/2, q) # From topography formula 243 -
anuga_validation/automated_validation_tests/okushiri_tank_validation/create_okushiri.py
r3916 r4555 11 11 12 12 import project 13 14 15 16 17 #-------------------------------------------------------------------------- 18 # Create the triangular mesh based on overall clipping polygon with a 19 # tagged 20 # boundary and interior regions defined in project.py along with 21 # resolutions (maximal area of per triangle) for each polygon 22 #-------------------------------------------------------------------------- 23 24 25 base_resolution = 1 # Use this to coarsen or refine entire mesh. 26 27 # Basic geometry and bounding polygon 28 xleft = 0 29 xright = 5.448 30 ybottom = 0 31 ytop = 3.402 32 33 point_sw = [xleft, ybottom] 34 point_se = [xright, ybottom] 35 point_nw = [xleft, ytop] 36 point_ne = [xright, ytop] 37 38 bounding_polygon = [point_se, 39 point_ne, 40 point_nw, 41 point_sw] 42 43 44 # Localised refined area for gulleys 45 xl = 4.8 46 xr = 5.3 47 yb = 1.6 48 yt = 2.3 49 p0 = [xl, yb] 50 p1 = [xr, yb] 51 p2 = [xr, yt] 52 p3 = [xl, yt] 53 54 gulleys = [p0, p1, p2, p3] 55 56 57 58 # Island area and drawdown region 59 island_0 = [xleft + 2*(xright-xleft)/3+1.2, ytop-0.5] 60 island_1 = [xleft + 2*(xright-xleft)/3+0.5, ybottom + 2*(ytop-ybottom)/3] 61 island_2 = [xleft + (xright-xleft)/2+0.4, ybottom + 2*(ytop-ybottom)/3-0.3] 62 island_3 = [xleft + (xright-xleft)/2+0.4, ybottom + (ytop-ybottom)/3+0.3] 63 island_4 = [xleft + 2*(xright-xleft)/3+0.4, ybottom + (ytop-ybottom)/3-0.3] 64 island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0.8] 65 island_6 = [xl-.01, yb] # Keep right edge just off the gulleys 66 island_7 = [xl-.01, yt] 67 68 island = [island_0, island_1, island_2, 69 island_3, island_4, island_5, 70 island_6, island_7] 71 72 73 74 # Region spanning half right hand side of domain just inside boundary 75 rhs_nw = [xleft + (xright-xleft)/3+1, ytop-1.4] 76 rhs_sw = [xleft + (xright-xleft)/3+1, ybottom+0.5] 77 rhs_se = [xright-0.1, ybottom+0.2] 78 rhs_ne = [xright-0.1, ytop-0.2] 79 80 rhs_region = [rhs_nw, rhs_ne, rhs_se, rhs_sw] 81 82 83 # Interior regions and creation of mesh 84 interior_regions = [[rhs_region, 0.0005], 85 [island, 0.0003*base_resolution], 86 [gulleys, 0.00003*base_resolution]] 87 88 13 89 14 90 … … 69 145 70 146 147 148 71 149 #------------------------------------------------------------- 72 150 if __name__ == "__main__": … … 77 155 78 156 79 #--------------------------------------------------------------------------80 # Create the triangular mesh based on overall clipping polygon with a81 # tagged82 # boundary and interior regions defined in project.py along with83 # resolutions (maximal area of per triangle) for each polygon84 #--------------------------------------------------------------------------85 86 87 base_resolution = 1 # Use this to coarsen or refine entire mesh.88 89 # Basic geometry and bounding polygon90 xleft = 091 xright = 5.44892 ybottom = 093 ytop = 3.40294 95 point_sw = [xleft, ybottom]96 point_se = [xright, ybottom]97 point_nw = [xleft, ytop]98 point_ne = [xright, ytop]99 100 bounding_polygon = [point_se,101 point_ne,102 point_nw,103 point_sw]104 105 106 # Localised refined area for gulleys107 xl = 4.8108 xr = 5.3109 yb = 1.6110 yt = 2.3111 p0 = [xl, yb]112 p1 = [xr, yb]113 p2 = [xr, yt]114 p3 = [xl, yt]115 116 gulleys = [p0, p1, p2, p3]117 118 119 120 # Island area and drawdown region121 island_0 = [xleft + 2*(xright-xleft)/3+1.2, ytop-0.5]122 island_1 = [xleft + 2*(xright-xleft)/3+0.5, ybottom + 2*(ytop-ybottom)/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]125 island_4 = [xleft + 2*(xright-xleft)/3+0.4, ybottom + (ytop-ybottom)/3-0.3]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 gulleys128 island_7 = [xl-.01, yt]129 130 island = [island_0, island_1, island_2,131 island_3, island_4, island_5,132 island_6, island_7]133 134 135 136 # Region spanning half right hand side of domain just inside boundary137 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]141 142 rhs_region = [rhs_nw, rhs_ne, rhs_se, rhs_sw]143 144 145 # Interior regions and creation of mesh146 interior_regions = [[rhs_region, 0.0005],147 [island, 0.0003*base_resolution],148 [gulleys, 0.00003*base_resolution]]149 157 150 158 meshname = project.mesh_filename + '.msh'
Note: See TracChangeset
for help on using the changeset viewer.