Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
% |
---|
2 |
% Load data from files |
---|
3 |
% |
---|
4 |
ls *.rvt |
---|
5 |
filename=input('Enter the name of .rvt file: ','s'); |
---|
6 |
load(filename); |
---|
7 |
rvt=eval(blank(filename(1:length(filename)-4))); |
---|
8 |
% |
---|
9 |
% Set data arrays |
---|
10 |
% |
---|
11 |
x=rvt(:,2); |
---|
12 |
y=rvt(:,3); |
---|
13 |
rho=rvt(:,4); |
---|
14 |
u=rvt(:,5); |
---|
15 |
v=rvt(:,6); |
---|
16 |
w=rvt(:,7); |
---|
17 |
enz=rvt(:,8); |
---|
18 |
T=rvt(:,9); |
---|
19 |
S=rvt(:,10); |
---|
20 |
% |
---|
21 |
% Create mesh and create boundary |
---|
22 |
% |
---|
23 |
nnv=21; |
---|
24 |
size(x); |
---|
25 |
nn=ans(1); |
---|
26 |
nseg=nn/nnv-1; |
---|
27 |
femgen |
---|
28 |
bnd=detbndy(in); |
---|
29 |
% |
---|
30 |
% Plot boundary |
---|
31 |
% |
---|
32 |
newplot='y'; |
---|
33 |
while newplot == 'y', |
---|
34 |
figure |
---|
35 |
whitebg('w') |
---|
36 |
hold on |
---|
37 |
bndo=plotbnd(x,y,bnd); |
---|
38 |
set(bndo,'Color','k') |
---|
39 |
axis('off') |
---|
40 |
% |
---|
41 |
% Set contour levels and make plot |
---|
42 |
% |
---|
43 |
scalarc=input('Enter variable you desire to contour (rho,u,v,w,enz,T,S): ','s'); |
---|
44 |
scalar=eval(scalarc); |
---|
45 |
scrange(scalar) |
---|
46 |
cint=input('Enter the contour interval: '); |
---|
47 |
cmin=cint*ceil(min(scalar)/cint); |
---|
48 |
cmax=cint*floor(max(scalar)/cint); |
---|
49 |
clear cval |
---|
50 |
i=1; |
---|
51 |
cval(i)=cmin; |
---|
52 |
while cval(i) < cmax |
---|
53 |
i=i+1; |
---|
54 |
cval(i)=cval(i-1)+cint; |
---|
55 |
end |
---|
56 |
cval |
---|
57 |
[cs,h]=lcontour3(in,x,y,scalar,cval); |
---|
58 |
hlabel=extclabel(cs); |
---|
59 |
delete(h) |
---|
60 |
title(filename) |
---|
61 |
zoom on |
---|
62 |
newplot=input('New plot? (y/n): ','s'); |
---|
63 |
end |
---|