Changeset 3421


Ignore:
Timestamp:
Jul 25, 2006, 4:17:37 PM (18 years ago)
Author:
duncan
Message:

sync scenario files

Location:
development/dam_2006
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • development/dam_2006/create_mesh.py

    r3420 r3421  
    99from coordinate_transforms.geo_reference import Geo_reference
    1010
    11 import project
    12 def generate(gate_position, is_course = False):
     11
     12def generate(mesh_filename, gate_position, is_course = False):
    1313    #Basic geometry
    1414   
    15     xleft   = - gate_position
     15    xedge   = - gate_position
    1616    xright  = 3.0 - gate_position
    1717    ybottom = 0
    1818    ytop    = 0.4
    19     xdam = 0.0
     19    xdam = 0.0
     20    xleft = -5.0
    2021
    2122    #Outline
     
    2930    point_dam_bottom = [xdam, ybottom]
    3031
     32    # Catchment seperation
     33    point_edge_top = [xedge, ytop]   
     34    point_edge_bottom = [xedge, ybottom]
     35   
    3136
    3237    m = Mesh()
     
    3843                      point_ne,
    3944                      point_dam_top,
     45                      point_edge_top,
    4046                      point_nw,
    4147                      point_sw,
     48                      point_edge_bottom,
    4249                      point_dam_bottom]
    4350
    4451    dict['segments'] = [[0,1], [1,2], [2,3], [3,4],
    45                         [4,5], [5,0],  #The outer border
    46                         [2,5]]         #Separator
     52                        [4,5], [5,6], [6,7 ],[7,0],  #The outer border
     53                        [2,7],         #dam Separator
     54                        [3,6]]         #edge Separator
    4755   
    4856    dict['segment_tags'] = ['wall',
     
    5260                            'wall',
    5361                            'wall',
     62                            'wall',
     63                            'wall',
     64                            '',
    5465                            '']           #Interior
    5566
     
    5970    dam = m.add_region(0.0000001,(ytop - ybottom)/2)
    6071    # this is the location of the region.
     72    dam.setTag("dam")
    6173
    62     dam.setTag("dam")
     74   
     75    dam = m.add_region(- gate_position - 0.0000001,(ytop - ybottom)/2)
     76    # this is the location of the region.
     77    dam.setTag("catchment")
     78
     79   
    6380    if is_course:
    6481        m.generate_mesh(maximum_triangle_area=0.01)
     
    6683        m.generate_mesh(maximum_triangle_area=0.0001)
    6784
    68     m.export_mesh_file(project.mesh_filename)
     85    m.export_mesh_file(mesh_filename)
    6986    print "mesh created"
    7087
    7188#-------------------------------------------------------------
    7289if __name__ == "__main__":
    73     pass
     90    generate("aa.tsh", 0.75, is_course = True)
  • development/dam_2006/project.py

    r3321 r3421  
    3838#community_scenario = gaugedir + 'community_onslow.csv'
    3939#gaugetimeseries = gaugedir + 'onslow'
     40depth_filename =
    4041
    4142
  • development/dam_2006/run_dam.py

    r3420 r3421  
    5151    #-------------------------------------------------------------------------
    5252
    53     create_mesh.generate(0.75, is_course=False) # this creates the mesh
     53    create_mesh.generate(project.mesh_filename,
     54                         0.75,
     55                         is_course=True) # this creates the mesh
     56                         #is_course=False) # this creates the mesh
    5457
    5558    head,tail = path.split(project.mesh_filename)
     
    8790
    8891    domain.set_region(Set_region('dam','stage',0.2,
     92                                 location = 'unique vertices'))   
     93    domain.set_region(Set_region('catchment','elevation',-1,
     94                                 location = 'unique vertices'))   
     95    domain.set_region(Set_region('catchment','stage',-1,
    8996                                 location = 'unique vertices'))
    9097
     
    105112        print 'finished'
    106113
     114    points = [[-0.1,0.2],
     115              [-0.2,0.2],
     116              [-0.3,0.2],
     117              [-0.4,0.2],
     118              [-0.5,0.2],
     119              ]
     120
     121    #-------------------------------------------------------------------------
     122    # Calc gauge info
     123    #-------------------------------------------------------------------------
     124    #interpolate_sww2csv(project.basename +".sww",
     125    #                    points,
     126    #                    "depth.csv",
     127    #                    "velocity.csv")
     128
    107129#-------------------------------------------------------------
    108130if __name__ == "__main__":
Note: See TracChangeset for help on using the changeset viewer.