Changeset 4698
- Timestamp:
- Sep 4, 2007, 10:59:04 AM (17 years ago)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/convergence_study/animatesww2d_alt.m
r4693 r4698 3 3 nc2mat(sww_filename,'swwtemp.mat'); %convert .sww to .mat 4 4 5 load('swwtemp.mat'); 5 load('swwtemp.mat'); % load the data from the temporary .mat file 6 6 7 spacing=10; % grid interval in metres 8 9 hmax=5; 10 11 figure(1); 7 figure(1); % Create a new figure 12 8 13 9 if nargin > 1 10 % If we're making an animation then set the figure location and prepare 11 % the avi file 14 12 figure(1);set(gcf,'Position',[200 400 800 300]); 15 13 mov=avifile(movie_filename,'FPS',5) 16 14 end 17 15 18 i=find(V_y==0); 19 20 [xi,yi]=meshgrid(min(V_x):spacing:max(V_x),min(V_y):spacing:max(V_y)); 21 22 elev=griddata(V_x,V_y,V_elevation,xi,yi); 16 i=find(V_y==0); % Find all the points which lie along the x-axis 17 % This could be made more general, or done in a way that is 18 % safer against rounding-off errors. 19 % 20 % 'i' becomes a vector containing the indices of those points 21 % which are on the x-axis. 23 22 24 23 if nargin < 3 24 % If we don't specify the range to plot on the axes, then set it 25 % here. X-axis covers the range in V_x, and the y-axis is 1 metre 26 % outside the range of values in V_stage. 25 27 range=[min(V_x) max(V_x) min(min(V_stage))-1 max(max(V_stage))+1]; 26 28 end 27 29 28 m=V_stage(1,i); 30 m=V_stage(1,i); % m is the vector containing the maximum stage values found 31 % so far among the points selected with 'i'. 29 32 30 33 for t=1:length(V_time) 31 34 32 m=max(m,V_stage(t,i)); 35 m=max(m,V_stage(t,i)); % update the vector of maximum values 36 33 37 plot(V_x(i),V_stage(t,i),V_x(i),V_elevation(i),V_x(i),m,'.'); 34 38 % Plot the stage of the points that are selected using the vector 'i' 39 35 40 axis(range) 36 41 % set the range of the axes 37 42 38 43 title(num2str(V_time(t)));drawnow; 39 44 % label with the time 45 40 46 if nargin>1 47 % If we're making an animation then add a new frame 41 48 F=getframe(gcf); 42 49 mov=addframe(mov,F); … … 46 53 47 54 if nargin > 1 55 % Close the animation file if necessary 48 56 mov=close(mov); 49 57 end -
anuga_work/production/onslow_2006/build_onslow_grad.py
r4672 r4698 102 102 print 'converting boundary conditions to sww format' 103 103 104 print 'boundary_dir', project_grad.boundary_dir 105 print 'project_grad.boundary_name', project_grad.boundary_name 104 print 'boundary_dir', project_grad.boundaries_in_dir 106 105 107 urs_ungridded2sww(project_grad.boundary_name, verbose=True, 108 mint=0, maxt=40000, zscale=1) 106 maxt = 40000 107 urs_ungridded2sww(project_grad.boundaries_in_dir+sep+project_grad.boundaries_name, 108 project_grad.boundaries_in_dir+sep+project_grad.boundaries_name+'_'+ str(maxt), 109 verbose=True, 110 mint=0, maxt=maxt, zscale=1) 109 111 110 112 print 'Finished building the %s scenario' %project_grad.scenario_name -
anuga_work/production/onslow_2006/project_grad.py
r4683 r4698 39 39 finaltime = 40000 40 40 starttime = 3600 # Action starts around 9000 41 #setup='final'42 setup = 'trial'41 setup='final' 42 #setup = 'trial' 43 43 which_data = 'original' 44 44 #which_data = 'revised' … … 84 84 85 85 dir_comment='_'+setup+'_'+str(tide)+'_'+\ 86 str(user)+'_'+boundary_event+ which_data86 str(user)+'_'+boundary_event+'_'+which_data 87 87 88 88 … … 148 148 149 149 # Bounding polygon 150 #bounding_polygon = read_polygon(join(polygons_dir, 'domain.csv'))151 #res_bounding_polygon = 500000*res_factor150 bounding_polygon = read_polygon(join(polygons_dir, 'domain.csv')) 151 res_bounding_polygon = 500000*res_factor 152 152 153 153 # Interior regions … … 155 155 'inner_region': 5000, 156 156 'region_50m': 50000, 157 'onslow ': 500}157 'onslow_v2': 500} 158 158 159 159 # Domain 160 boundary_tags = {'back': [ 1, 2, 3,4, 5],161 'side': [ 0, 6],162 'ocean': [ 7, 8, 9, 10, 11]}160 boundary_tags = {'back': [4, 5], 161 'side': [3, 6], 162 'ocean': [0, 1, 2]} 163 163 164 164 interior_regions = [] # Consider using dictionary for mesh interface. … … 176 176 res_bounding_polygon) 177 177 178 onshore_polygon = read_polygon(join( topographies_in_dir,178 onshore_polygon = read_polygon(join(home, state, scenario,'elevation_final','points', 179 179 'InitialCondition_points.csv')) -
anuga_work/production/onslow_2006/run_onslow_grad.py
r4672 r4698 43 43 44 44 # Application specific imports 45 import project_grad _grad# Definition of file names and polygons45 import project_grad # Definition of file names and polygons 46 46 47 47 def run_model(**kwargs): … … 70 70 kwargs['output_dir']=project_grad.output_run_time_dir 71 71 kwargs['bathy_file']=project_grad.combined_dir_name + '.pts' 72 # kwargs['bathy_file']=project_grad.combined_small_dir_name + '.pts' 73 kwargs['boundary_file']=project_grad.boundary_name + '.sww' 72 kwargs['boundary_file']=project_grad.boundaries_in_dir+sep+project_grad.boundaries_name+'_40000.sww' 74 73 # kwargs['Completed']='' 75 74 … … 188 187 time_thinning=time_thinning, 189 188 mean_stage=tide, 190 momentum_scale=project_grad.momentum_scale,191 189 use_cache=False, 192 190 verbose=True)
Note: See TracChangeset
for help on using the changeset viewer.