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 |
nnv=input('Enter nnv: '); |
---|
7 |
load(filename); |
---|
8 |
rvt=eval(blank(filename(1:length(filename)-4))); |
---|
9 |
% |
---|
10 |
% Set data arrays |
---|
11 |
% |
---|
12 |
x=rvt(:,2); |
---|
13 |
y=rvt(:,3); |
---|
14 |
rho=rvt(:,4); |
---|
15 |
u=rvt(:,5); |
---|
16 |
v=rvt(:,6); |
---|
17 |
w=rvt(:,7); |
---|
18 |
enz=rvt(:,8); |
---|
19 |
T=rvt(:,9); |
---|
20 |
S=rvt(:,10); |
---|
21 |
% |
---|
22 |
% Create mesh and create boundary |
---|
23 |
% |
---|
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 |
newcont='y'; |
---|
44 |
while newcont == 'y', |
---|
45 |
scalarc=input('Enter variable you desire to contour (rho,u,v,w,enz,T,S): ','s'); |
---|
46 |
scalar=eval(scalarc); |
---|
47 |
scrange(scalar) |
---|
48 |
cint=input('Enter the contour interval: '); |
---|
49 |
cmin=cint*ceil(min(scalar)/cint); |
---|
50 |
cmax=cint*floor(max(scalar)/cint); |
---|
51 |
clear cval |
---|
52 |
i=1; |
---|
53 |
cval(i)=cmin; |
---|
54 |
while cval(i) < cmax |
---|
55 |
i=i+1; |
---|
56 |
cval(i)=cval(i-1)+cint; |
---|
57 |
end |
---|
58 |
cval |
---|
59 |
hc=lcontour2(in,x,y,scalar,cval); |
---|
60 |
title(filename) |
---|
61 |
zoom on |
---|
62 |
newcont=input('New contour interval? (y/n): ','s'); |
---|
63 |
if newcont == 'y', |
---|
64 |
delete(hc); |
---|
65 |
end |
---|
66 |
end |
---|
67 |
newplot=input('New plot? (y/n): ','s'); |
---|
68 |
end |
---|