コード例 #1
0
cache = False
verbose = True

# Define Scenario
# the final goal is to define a rainfall scenario
# Here, in order to test, we follow the example to first have a fixed wave scenario
scenario = 'fixed_wave'
name_stem = 'aw_small'
meshname = name_stem + '.msh'

gage_file_name = 'aw_small_gauges.csv'

# bounding polygon for study area
bounding_polygon = anuga.read_polygon('aw_small_extent.csv')
A = anuga.polygon_area(bounding_polygon) / 1000000.0
print 'Area of bounding polygon = %.2f km^2' % A

# Read interior polygons
poly_river = anuga.read_polygon('aw_small_river.csv')

# the greater the base_scale is the less the triangle it will be divided into
just_fitting = False
base_scale = 5000
background_res = 10 * base_scale
river_res = base_scale
city_res = base_scale

interior_regions = [[poly_river, river_res]]

tide = 0.0
コード例 #2
0
name_stem = scenario_name = '${name_stem}'
event_number =  'T' + str(periodT)
rp = 10000

meshname = name_stem + '.msh'

# Filename for locations where timeseries are to be produced
gauge_filename = 'gauges_busselton.csv'

#------------------------------------------------------------------------------
# Domain definitions
#------------------------------------------------------------------------------
# bounding polygon for study area
bounding_polygon = anuga.read_polygon('busselton_extent_edit.csv')

A = anuga.polygon_area(bounding_polygon) / 1000000.0
print 'Area of bounding polygon = %.2f km^2' % A

#------------------------------------------------------------------------------
# Interior region definitions
#------------------------------------------------------------------------------
# Read interior polygons
poly_1 = anuga.read_polygon('busselton_1km.csv')
poly_2 = anuga.read_polygon('bunbury_1km_extend.csv')
poly_3 = anuga.read_polygon('busselton_20m.csv')
#poly_island2 = anuga.read_polygon('islands2.csv')
#poly_island3 = anuga.read_polygon('islands3.csv')
#poly_shallow = anuga.read_polygon('shallow.csv')

# Optionally plot points making up these polygons
#plot_polygons([bounding_polygon, poly_cairns, poly_island0, poly_island1,
コード例 #3
0
    util.printlog("     Gauss amplitude(A/2)   : " + str(eta0 / 2.), log1)
    util.printlog("     Bay toe (x,y_up,y_down): " + str(xi + X0) + "," + str(yi + Y0) + "," + str(yi - Y0), log1)
    util.printlog("Boundaries ;", log1)
    for b in domain.boundary_map:
        util.printlog('   ' + b + '     :   ' + domain.boundary_map[b].__repr__(), log1)
    util.printlog("Timestep           :" + str(timestep1) + "-->" + str(timestep2), log1)
    util.printlog("Simulation time    :" + str(duration1) + "-->" + str(duration2), log1)
    util.printlog("Algorithm          :" + flow_alg, log1)
    util.printlog("Mesh coords;", log1)
    util.printlog(bounding_polygon.__str__(), log1)
    util.printlog("Bay start coords      :" + " (" + str(xi) + " , " + str(yi) + ")", log1)
    util.printlog("Gauss initial x coord :" + str(gauss_x), log1)
    util.printlog("X0/Z0  :" + str(abs(Z0) / X0), log1)
    util.printlog(" Mesh ;", log1)
    util.printlog("   length x width     :" + str(s_x) + " x " + str(s_y), log1)
    util.printlog("   area (km2)         :" + str(anuga.polygon_area(bounding_polygon) / 1000000.0), log1)
    util.printlog("   max triangle base  :" + str(max_tri_area_base), log1)
    util.printlog("   max triangle focus :" + str(max_tri_area_focus), log1)
    util.printlog("   max triangle inund :" + str(max_tri_area_inu), log1)
    util.printlog("   triang. cnt        :" + str(len(domain)), log1)
    util.printlog("   extends            :" + str(domain.get_extent()), log1)
    util.printlog(domain.statistics(), log1)
    log1.close()

    log2 = open(prj_output_dir + os.sep + log2_file, "w+")
    util.printlog(
        "X0;YO;Z0;sigma;eta0;max_tri_area_base;max_tri_area_focus;max_tri_area_inu;timestep2;flow_alg;Area;s_x;s_y;TriangCnt",
        log2)
    util.printlog(str(X0) + ";" + str(Y0) + ";" + str(-Z0) + ";" + str(sigmaG) + ";" + str(eta0 / 2.) + ";" +
                  str(max_tri_area_base) + ";" + str(max_tri_area_focus) + ";" + str(max_tri_area_inu) + ";" + str(
        timestep2) + ";" +