Revision 495
(checked in by cbc, 11 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
% |
---|
2 |
% Load data from files |
---|
3 |
% |
---|
4 |
gridname=input('Enter the name of the grid: ','s'); |
---|
5 |
gridname=blank(gridname); |
---|
6 |
[in,x,y,z,bnd]=loadgrid(gridname); |
---|
7 |
% |
---|
8 |
% Calculate nodal and elemental areas and deltax's |
---|
9 |
% |
---|
10 |
area |
---|
11 |
% |
---|
12 |
% Compute node-based time for gravity waves cross elements |
---|
13 |
% |
---|
14 |
scrange(z) |
---|
15 |
zmin=input('Enter the minimum depth (in m): '); |
---|
16 |
z=max(z,zmin); |
---|
17 |
tgwave=dxnod./sqrt(9.81*z); |
---|
18 |
scalar=tgwave; |
---|
19 |
fid=fopen([gridname,'_tgwave.s2r'],'w'); |
---|
20 |
fprintf(fid,'%c',gridname); |
---|
21 |
fprintf(fid,'\nnode-based time for gravity wave to cross elements\n'); |
---|
22 |
for i=1:nn |
---|
23 |
fprintf(fid,'%6.0f %10.2f\n',i,tgwave(i)); |
---|
24 |
end |
---|
25 |
% |
---|
26 |
% Plot results |
---|
27 |
% |
---|
28 |
newplot='y'; |
---|
29 |
while newplot == 'y', |
---|
30 |
tallfigure |
---|
31 |
whitebg('w') |
---|
32 |
hold on |
---|
33 |
bndo=plotbnd(x,y,bnd); |
---|
34 |
set(bndo,'Color','k') |
---|
35 |
[smin,smax,ibw]=colorband_fe_cb(in,x,y,bnd,scalar,1); |
---|
36 |
newplot=input('New plot? (y/n): ','s'); |
---|
37 |
end |
---|