Changeset 4555


Ignore:
Timestamp:
Jun 21, 2007, 3:23:11 PM (18 years ago)
Author:
ole
Message:

Computed maximal runup height and location in automated okushiri validation and
added one simple assertion. More could be done here.

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  
    141141    #                            rtol=rtol, atol=atol)
    142142    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
    144145   
    145146
     
    215216
    216217
     218# Check max runup
     219
     220from anuga.shallow_water.data_manager import get_maximum_inundation_elevation
     221from anuga.shallow_water.data_manager import get_maximum_inundation_location
     222from anuga.utilities.polygon import is_inside_polygon
     223
     224q = get_maximum_inundation_elevation(sww_filename)
     225loc = get_maximum_inundation_location(sww_filename)
     226
     227
     228print 'Max runup elevation: ', q
     229print 'Max runup location:  ', loc
     230
     231
     232from create_okushiri import gulleys
     233assert 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  
    1111
    1212import 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
     25base_resolution = 1 # Use this to coarsen or refine entire mesh.
     26
     27# Basic geometry and bounding polygon
     28xleft   = 0
     29xright  = 5.448
     30ybottom = 0
     31ytop    = 3.402
     32
     33point_sw = [xleft, ybottom]
     34point_se = [xright, ybottom]
     35point_nw = [xleft, ytop]   
     36point_ne = [xright, ytop]
     37
     38bounding_polygon = [point_se,
     39                    point_ne,
     40                    point_nw,
     41                    point_sw]
     42
     43
     44# Localised refined area for gulleys
     45xl = 4.8
     46xr = 5.3
     47yb = 1.6
     48yt = 2.3
     49p0 = [xl, yb]
     50p1 = [xr, yb]
     51p2 = [xr, yt]
     52p3 = [xl, yt]
     53
     54gulleys = [p0, p1, p2, p3]
     55
     56
     57
     58# Island area and drawdown region
     59island_0 = [xleft + 2*(xright-xleft)/3+1.2, ytop-0.5]
     60island_1 = [xleft + 2*(xright-xleft)/3+0.5, ybottom + 2*(ytop-ybottom)/3]
     61island_2 = [xleft + (xright-xleft)/2+0.4, ybottom + 2*(ytop-ybottom)/3-0.3]
     62island_3 = [xleft + (xright-xleft)/2+0.4, ybottom + (ytop-ybottom)/3+0.3]
     63island_4 = [xleft + 2*(xright-xleft)/3+0.4, ybottom + (ytop-ybottom)/3-0.3]
     64island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0.8]
     65island_6 = [xl-.01, yb]  # Keep right edge just off the gulleys
     66island_7 = [xl-.01, yt]
     67
     68island = [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
     75rhs_nw = [xleft + (xright-xleft)/3+1, ytop-1.4]
     76rhs_sw = [xleft + (xright-xleft)/3+1, ybottom+0.5]
     77rhs_se = [xright-0.1, ybottom+0.2]
     78rhs_ne = [xright-0.1, ytop-0.2]       
     79
     80rhs_region = [rhs_nw, rhs_ne, rhs_se, rhs_sw]
     81
     82
     83# Interior regions and creation of mesh
     84interior_regions = [[rhs_region, 0.0005],
     85                    [island, 0.0003*base_resolution],
     86                    [gulleys, 0.00003*base_resolution]]   
     87
     88
    1389
    1490
     
    69145
    70146
     147
     148
    71149#-------------------------------------------------------------
    72150if __name__ == "__main__":
     
    77155
    78156
    79     #--------------------------------------------------------------------------
    80     # Create the triangular mesh based on overall clipping polygon with a
    81     # tagged
    82     # boundary and interior regions defined in project.py along with
    83     # resolutions (maximal area of per triangle) for each polygon
    84     #--------------------------------------------------------------------------
    85 
    86 
    87     base_resolution = 1 # Use this to coarsen or refine entire mesh.
    88 
    89     # Basic geometry and bounding polygon
    90     xleft   = 0
    91     xright  = 5.448
    92     ybottom = 0
    93     ytop    = 3.402
    94 
    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 gulleys
    107     xl = 4.8
    108     xr = 5.3
    109     yb = 1.6
    110     yt = 2.3
    111     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 region
    121     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 gulleys
    128     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 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]       
    141 
    142     rhs_region = [rhs_nw, rhs_ne, rhs_se, rhs_sw]
    143 
    144    
    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]]   
    149157
    150158    meshname = project.mesh_filename + '.msh'
Note: See TracChangeset for help on using the changeset viewer.