source: anuga_work/development/convergence_okushiri_2008/project_truescale.py @ 5411

Last change on this file since 5411 was 5411, checked in by Leharne, 16 years ago

Updates to okushiri convergence study

File size: 3.4 KB
Line 
1"""Common filenames for truescale Okushiri Island convergence study
2Formats are given as ANUGA native netCDF where applicable.
3
4"""
5from os import sep, environ, getenv, getcwd, umask
6from os.path import expanduser, basename, join
7from anuga.utilities.polygon import read_polygon, plot_polygons, polygon_area, is_inside_polygon, number_mesh_triangles
8import sys
9from anuga.coordinate_transforms.redfearn import degminsec2decimal_degrees
10from time import localtime, strftime, gmtime
11from anuga.utilities.system_tools import get_user_name, get_host_name
12
13home = join(getenv('INUNDATIONHOME'),'data', 'anuga_validation',
14            'convergence_okushiri_2008') # Location of Data
15user = get_user_name()
16host = get_host_name()
17#needed when running using mpirun, mpirun doesn't inherit umask from .bashrc
18umask(002)
19
20#-------------------
21# Input file names
22#-------------------
23
24# Given boundary wave
25boundary_filename = 'okushiri_truescale_input.tms'
26
27# Observed timeseries
28validation_filename = 'okushiri_output_truescale_ch5-7-9.txt'
29
30# Digital Elevation Model
31bathymetry_filename = 'okushiri_truescale_bathymetry.pts'
32
33
34#------------------------------------
35# Output file names and directories
36#------------------------------------
37
38# Model output
39output_filename = 'okushiri_truescale.sww'
40
41# Time stuff
42time = strftime('%Y%m%d_%H%M%S',gmtime()) #gets time for new dir
43run_time = time+'_run'
44
45# Run parameters
46finaltime=450
47setup='original'
48
49if setup =='original':
50    print 'original resolution'
51    base_resolution=1
52    yieldstep=1
53if setup =='double':
54    print 'double original resolution'
55    base_resolution=0.5
56    yieldstep=1
57if setup =='half':
58    print 'half original resolution'
59    base_resolution=2
60    yieldstep=1
61if setup =='no polygons':
62    print 'half original resolution'
63    base_resolution=2
64    yieldstep=1
65 
66   
67# Set anuga directories
68anuga_dir = join(home,'anuga')+sep
69
70dir_comment='_'+setup+'_'+str(user)
71
72mesh_dir = join(anuga_dir, 'meshes')+sep
73mesh_name = join(mesh_dir, 'okushiri_truescale')
74
75polygons_dir = join(anuga_dir, 'polygons')+sep # Created with ArcGIS (csv files)
76
77# Output locations
78output_dir = join(anuga_dir, 'outputs')+sep
79output_run_time_dir = output_dir+run_time+dir_comment+sep
80output_run_time_dir_name = output_run_time_dir + output_filename #Used by post processing
81
82# Gauges
83gauges_dir = join(anuga_dir,'gauges')+sep
84gauge_name = 'gauge_location_okushiri.csv'
85gauges_dir_name = gauges_dir+gauge_name
86
87# Vertex coordinates
88vertex_filename = output_run_time_dir+setup+'vertex_coordinates.txt'
89
90#------------------------------
91# Polygon definitions
92#------------------------------
93
94poly_all = read_polygon(polygons_dir+'bounding_polygon.csv')
95res_poly_all = 16000*base_resolution
96
97#print 'Area of bounding polygon', polygon_area(poly_all)/1000000.0
98
99poly_gulleys = read_polygon(polygons_dir+'gulleys_polygon.csv')
100res_gulleys = 3.2*base_resolution
101
102poly_island = read_polygon(polygons_dir+'island_polygon.csv')
103res_island = 32*base_resolution
104
105poly_rhs = read_polygon(polygons_dir+'rhs_polygon.csv')
106res_rhs = 80*base_resolution
107
108interior_regions = [[poly_gulleys,res_gulleys],[poly_island,res_island],
109                    [poly_rhs,res_rhs]]
110                   
111trigs_min = number_mesh_triangles(interior_regions, poly_all, res_poly_all)
112
113print 'min number triangles', trigs_min
114
115
116
117
118
119
Note: See TracBrowser for help on using the repository browser.