Ignore:
Timestamp:
Aug 23, 2005, 2:56:21 PM (20 years ago)
Author:
ole
Message:

Recovered validation stuff from 18 August + wrapping up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/validation/LWRU2/create_mesh.py

    r1734 r1742  
    1414
    1515    #Basic geometry
    16 
     16   
    1717    xleft   = 0
    1818    xright  = 5.448
     
    2020    ytop    = 3.402
    2121
    22     #Outline
     22    #Outline 
    2323    point_sw = [xleft, ybottom]
    2424    point_se = [xright, ybottom]
    25     point_nw = [xleft, ytop]
     25    point_nw = [xleft, ytop]   
    2626    point_ne = [xright, ytop]
    2727
    2828    #Midway points (left)
    29     point_ml1 = [xleft + (xright-xleft)/3+1, ytop]
    30     point_ml2 = [xleft + (xright-xleft)/3+1, ybottom]
    31 
    32     #Midway points (right)
    33     point_mr1 = [xleft + 2*(xright-xleft)/3+0.5, ytop]
    34     point_mr2 = [xleft + 2*(xright-xleft)/3+0.5, ybottom]
     29    point_mtop = [xleft + (xright-xleft)/3+1, ytop]
     30    point_mbottom = [xleft + (xright-xleft)/3+1, ybottom]
    3531
    3632
    3733    geo = Geo_reference(xllcorner = xleft,
    3834                        yllcorner = ybottom)
    39 
    40 
     35   
     36                       
    4137    print "***********************"
    4238    print "geo ref", geo
    4339    print "***********************"
    44 
     40   
    4541    m = Mesh(geo_reference=geo)
    4642
     
    4945    dict['points'] = [point_se,   #se
    5046                      point_ne,
    51                       point_mr1,
    52                       point_ml1,
     47                      point_mtop,
    5348                      point_nw,
    5449                      point_sw,
    55                       point_ml2,
    56                       point_mr2]
     50                      point_mbottom]
    5751
    58 
     52   
    5953    dict['segments'] = [[0,1], [1,2], [2,3], [3,4],
    60                         [4,5], [5,6], [6,7], [7,0], #The outer border
    61                         [2,7], [3,6]]               #Separators
    62 
     54                        [4,5], [5,0], #The outer border
     55                        [2,5]]         #Separator
     56   
    6357    dict['segment_tags'] = ['wall',
    64                             'wall',
    6558                            'wall',
    6659                            'wall',
     
    6861                            'wall',
    6962                            'wall',
    70                             'wall',
    71                             '',           #Interior
    7263                            '']           #Interior
    7364
     65       
     66    m.addVertsSegs(dict)
    7467
    75     m.addVertsSegs(dict)
     68
    7669
    7770
     
    8780    p2 = [xr, yt]
    8881    p3 = [xl, yt]
     82   
     83    dict['points'] = [p0, p1, p2, p3]
     84    dict['segments'] = [[0,1], [1,2], [2,3], [3,0]]
     85    dict['segment_tags'] = ['', '', '', '']
     86    m.addVertsSegs(dict)   
    8987
    90     dict['points'] = [p0, p1, p2, p3]
     88    #Island area
     89    island_0 = [xleft + 2*(xright-xleft)/3+1.2, ytop-0.5]
     90    island_1 = [xleft + 2*(xright-xleft)/3+0.5, ybottom + 2*(ytop-ybottom)/3]
     91    island_2 = [xleft + (xright-xleft)/2+0.3, ybottom + 2*(ytop-ybottom)/3-0.3]
     92    island_3 = [xleft + (xright-xleft)/2+0.3, ybottom + (ytop-ybottom)/3+0.3]
     93    island_4 = [xleft + 2*(xright-xleft)/3+0.4, ybottom + (ytop-ybottom)/3-0.3]
     94    island_5 = [xleft + 2*(xright-xleft)/3+1.2, ybottom+0.2]
     95    island_6 = [xl-.01, yb]  #OK
     96    island_7 = [xl-.01, yt]  #OK     
     97   
     98
     99    dict['points'] = [island_0, island_1, island_2,
     100                      island_3, island_4, island_5,
     101                      #p0, p3]                     
     102                      island_6, island_7]
     103
     104                     
     105    dict['segments'] = [[0,1], [1,2], [2,3], [3,4],
     106                        [4,5], [5,6], [6,7], [7,0]]
     107                       
     108    dict['segment_tags'] = ['', '', '', '', '', '', '', '']
    91109
    92110
    93     dict['segments'] = [[0,1], [1,2], [2,3], [3,0]]
    94     dict['segment_tags'] = ['', '', '', '']
    95     m.addVertsSegs(dict)
     111    m.addVertsSegs(dict)   
    96112
     113   
     114#
     115   
     116    base_resolution = 1
    97117
    98     base_resolution = 100
     118    ocean = m.addRegionEN(xleft+.1, ybottom+.1)
     119    ocean.setMaxArea(0.1*base_resolution)
    99120
    100     ocean = m.addRegionEN(xleft+1, ybottom+1)
    101     ocean.setMaxArea(0.01*base_resolution)
     121    mid = m.addRegionEN(point_mbottom[0]+.1, ybottom+.1)
     122    mid.setMaxArea(0.0005*base_resolution)
     123   
    102124
    103     mid = m.addRegionEN(point_ml2[0]+1, ybottom+1)
    104     mid.setMaxArea(0.001*base_resolution)
    105 
    106 
    107     inner = m.addRegionEN(point_mr2[0]+1, ybottom+1)
    108     inner.setMaxArea(0.0001*base_resolution)
     125    inner = m.addRegionEN(island_3[0]+.1, island_3[1]+.1)
     126    inner.setMaxArea(0.00007*base_resolution)
    109127
    110128
    111129    gulleys = m.addRegionEN(p0[0]+0.1, p0[1]+0.1)
    112     gulleys.setMaxArea(0.00001*base_resolution)
    113 
    114 
     130    gulleys.setMaxArea(0.00002*base_resolution)   
     131   
     132   
    115133    m.generateMesh('pzq28.0za1000000a')
    116134
    117135    import filenames
    118136    m.export_mesh_file(filenames.mesh_filename)
     137   
Note: See TracChangeset for help on using the changeset viewer.