setrun.py Memorandums †特に重要な変数を書き出してみる. clawdata †
amrdata †
# --------------- # AMR parameters: # --------------- amrdata = rundata.amrdata # max number of refinement levels: amrdata.amr_levels_max = 4 # List of refinement ratios at each level (length at least mxnest-1) amrdata.refinement_ratios_x = [3,3,3] amrdata.refinement_ratios_y = [3,3,3] amrdata.refinement_ratios_t = [3,3,3]
# Specify type of each aux variable in amrdata.auxtype. # This must be a list of length maux, each element of which is one of: # 'center', 'capacity', 'xleft', or 'yleft' (see documentation). amrdata.aux_type = ['center','center','yleft'] # if x,y-coordinates #amrdata.aux_type = ['center','capacity','yleft'] # if lonlat
geo_data †
topo_data †
dtopo_data †
region †topo を複数入力してそれぞれの範囲内で解像度の制限をかけたかったら. # --------------- # Regions: # --------------- regions = rundata.regiondata.regions # to specify regions of refinement append lines of the form # [minlevel,maxlevel,t1,t2,x1,x2,y1,y2] ## Level 1 regions.append([1, 1, clawdata.t0, clawdata.tfinal, clawdata.lower[0], clawdata.upper[0], clawdata.lower[1], clawdata.upper[1]]) ## Level 2+ topo_file = topotools.Topography('topofile.asc', topo_type=3) regions.append([1, 2, clawdata.t0, clawdata.tfinal, topo_file.x[0], topo_file.x[-1], topo_file.y[0], topo_file.y[-1]])
gauge †時系列データ出力地点指定. # --------------- # Gauges: # --------------- gauges = rundata.gaugedata.gauges # for gauges append lines of the form [gaugeno, x, y, t1, t2] dat = np.genfromtxt('gaugesetfile.txt', delimiter=',', skip_header=0, dtype='float') [gauges.append(dat[i]) for i in range(0,dat.shape[0])]
fgmax †topo ファイルごとに fgmax (fixed_grid max) を出したければ. fgmax_files = rundata.fgmax_data.fgmax_files # == fgmax.data values == # Domain 1 topo_file = topotools.Topography('topofile.asc', topo_type=3) fg = fgmax_tools.FGmaxGrid() fg.point_style = 2 # uniform rectangular x-y grid fg.dx = topo_file.delta[0] # desired resolution of fgmax grid fg.x1 = topo_file.x[0] fg.x2 = topo_file.x[-1] fg.y1 = topo_file.y[0] fg.y2 = topo_file.y[-1] fg.min_level_check = 1 # which levels to monitor max on fg.arrival_tol = 1.0e-1 fg.tstart_max = 0.0 # just before wave arrives fg.tend_max = 1.e10 # when to stop monitoring max values fg.dt_check = 1.0 # how often to update max values fg.interp_method = 0 # 0 ==> pw const in cells, recommended rundata.fgmax_data.fgmax_grids.append(fg) # written to fgmax_grids.data rundata.fgmax_data.num_fgmax_val = 5
fixed_grids †v5.9.0 からは非推奨になった.
特定の領域だけAMRを使わずに,ずっと同じ解像度で解いてしまおう,というもの. # == setfixedgrids.data values == fixedgrids = rundata.fixed_grid_data.fixedgrids # for fixed grids append lines of the form # [t1,t2,noutput,x1,x2,y1,y2,xpoints,ypoints,\ # ioutarrivaltimes,ioutsurfacemax] topo_file = topotools.Topography(os.path.join(topodir, 'fileA.asc')) fixedgrids.append([0.0, 21600.0, 361, topo_file.x[0], topo_file.x[-1], topo_file.y[0], topo_file.y[-1], topo_file.Z.shape[1], topo_file.Z.shape[0], 0, 0]) topo_file = topotools.Topography(os.path.join(topodir, 'fileB.asc')) fixedgrids.append([0.0, 21600.0, 361, topo_file.x[0], topo_file.x[-1], topo_file.y[0], topo_file.y[-1], topo_file.Z.shape[1], topo_file.Z.shape[0], 0, 0]) この場合では t1,t2,noutput がそれぞれ 0.0, 21600.0,361 となっているので, fgout †topo_file = topotools.Topography(os.path.join(topodir, topofile), topo_type=3) # 何かのtopographyを基準に fgout = fgout_tools.FGoutGrid() fgout.fgno = 3 fgout.output_format = 'ascii' fgout.x1 = topo_file.x[0] fgout.x2 = topo_file.x[-1] fgout.y1 = topo_file.y[0] fgout.y2 = topo_file.y[-1] fgout.nx = topo_file.Z.shape[1] fgout.ny = topo_file.Z.shape[0] fgout.tstart = 3600.0*5.0 fgout.tend = clawdata.tfinal fgout.nout = int((fgout.tend - fgout.tstart)/3600.0) * 60 + 1 fgout_grids.append(fgout) |