Changeset 4698


Ignore:
Timestamp:
Sep 4, 2007, 10:59:04 AM (17 years ago)
Author:
sexton
Message:

(i) commented matlab script from William (ii) scripts looking at grad data

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/convergence_study/animatesww2d_alt.m

    r4693 r4698  
    33nc2mat(sww_filename,'swwtemp.mat'); %convert .sww to .mat
    44
    5 load('swwtemp.mat');
     5load('swwtemp.mat'); % load the data from the temporary .mat file
    66
    7 spacing=10; % grid interval in metres
    8 
    9 hmax=5;
    10 
    11 figure(1);
     7figure(1); % Create a new figure
    128
    139if nargin > 1
     10    % If we're making an animation then set the figure location and prepare
     11    % the avi file
    1412    figure(1);set(gcf,'Position',[200 400 800 300]);
    1513    mov=avifile(movie_filename,'FPS',5)
    1614end
    1715
    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);
     16i=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.
    2322
    2423if 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.
    2527    range=[min(V_x) max(V_x) min(min(V_stage))-1 max(max(V_stage))+1];
    2628end
    2729
    28 m=V_stage(1,i);
     30m=V_stage(1,i); % m is the vector containing the maximum stage values found
     31                % so far among the points selected with 'i'.
    2932
    3033for t=1:length(V_time)
    3134   
    32     m=max(m,V_stage(t,i));
     35    m=max(m,V_stage(t,i)); % update the vector of maximum values
     36   
    3337    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   
    3540    axis(range)
    36    
     41    % set the range of the axes
    3742
    3843    title(num2str(V_time(t)));drawnow;
    39 
     44    % label with the time
     45   
    4046    if nargin>1
     47        % If we're making an animation then add a new frame
    4148        F=getframe(gcf);
    4249        mov=addframe(mov,F);   
     
    4653
    4754if nargin > 1
     55    % Close the animation file if necessary
    4856    mov=close(mov);
    4957end
  • anuga_work/production/onslow_2006/build_onslow_grad.py

    r4672 r4698  
    102102print 'converting boundary conditions to sww format'
    103103
    104 print 'boundary_dir', project_grad.boundary_dir
    105 print 'project_grad.boundary_name', project_grad.boundary_name
     104print 'boundary_dir', project_grad.boundaries_in_dir
    106105
    107 urs_ungridded2sww(project_grad.boundary_name, verbose=True,
    108                   mint=0, maxt=40000, zscale=1)
     106maxt = 40000
     107urs_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)
    109111
    110112print 'Finished building the %s scenario' %project_grad.scenario_name
  • anuga_work/production/onslow_2006/project_grad.py

    r4683 r4698  
    3939finaltime = 40000
    4040starttime = 3600 # Action starts around 9000
    41 #setup='final'
    42 setup = 'trial'
     41setup='final'
     42#setup = 'trial'
    4343which_data = 'original'
    4444#which_data = 'revised'
     
    8484
    8585dir_comment='_'+setup+'_'+str(tide)+'_'+\
    86              str(user)+'_'+boundary_event+which_data
     86             str(user)+'_'+boundary_event+'_'+which_data
    8787
    8888
     
    148148
    149149# Bounding polygon
    150 #bounding_polygon = read_polygon(join(polygons_dir, 'domain.csv'))
    151 #res_bounding_polygon = 500000*res_factor
     150bounding_polygon = read_polygon(join(polygons_dir, 'domain.csv'))
     151res_bounding_polygon = 500000*res_factor
    152152
    153153# Interior regions
     
    155155    'inner_region': 5000,
    156156    'region_50m': 50000,
    157     'onslow': 500}
     157    'onslow_v2': 500}
    158158
    159159# Domain
    160 boundary_tags = {'back': [1, 2, 3, 4, 5],   
    161                  'side': [0, 6],
    162                  'ocean': [7, 8, 9, 10, 11]}
     160boundary_tags = {'back': [4, 5],   
     161                 'side': [3, 6],
     162                 'ocean': [0, 1, 2]}
    163163
    164164interior_regions = [] # Consider using dictionary for mesh interface.
     
    176176                                  res_bounding_polygon)
    177177
    178 onshore_polygon = read_polygon(join(topographies_in_dir,
     178onshore_polygon = read_polygon(join(home, state, scenario,'elevation_final','points',
    179179                                    'InitialCondition_points.csv'))
  • anuga_work/production/onslow_2006/run_onslow_grad.py

    r4672 r4698  
    4343
    4444# Application specific imports
    45 import project_grad_grad                 # Definition of file names and polygons
     45import project_grad                 # Definition of file names and polygons
    4646
    4747def run_model(**kwargs):
     
    7070    kwargs['output_dir']=project_grad.output_run_time_dir
    7171    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'
    7473#    kwargs['Completed']=''
    7574
     
    188187                        time_thinning=time_thinning,
    189188                        mean_stage=tide,
    190                         momentum_scale=project_grad.momentum_scale,                       
    191189                        use_cache=False,
    192190                        verbose=True)
Note: See TracChangeset for help on using the changeset viewer.