| 1 |
|
| 2 |
function flowMovie(name, type, T, xlimit, ylimit) |
| 3 |
%% Parse data from input files |
| 4 |
tic |
| 5 |
fprintf('Parsing input data.\n') |
| 6 |
[Ux, Uy, P, adj, nodes] = parseData(name); |
| 7 |
toc |
| 8 |
%% Compute quantity to plot |
| 9 |
tic |
| 10 |
fprintf('Computing quantity for plotting.\n') |
| 11 |
if (strcmp(type,'mag')) |
| 12 |
data = sqrt(Ux.^2 + Uy.^2); |
| 13 |
elseif (strcmp(type,'vort')) |
| 14 |
data = vorticity(nodes, Ux, Uy); |
| 15 |
elseif (strcmp(type,'velx')) |
| 16 |
data = Ux; |
| 17 |
elseif (strcmp(type,'vely')) |
| 18 |
data = Uy; |
| 19 |
elseif (strcmp(type,'pres')) |
| 20 |
data = P; |
| 21 |
else |
| 22 |
fprintf('Unknown type %s -- Terminating.\n', type); |
| 23 |
return; |
| 24 |
end |
| 25 |
toc |
| 26 |
%% Capture movie |
| 27 |
tic |
| 28 |
fprintf('Capturing movie.\n') |
| 29 |
trisurfMovie(adj, nodes, data, [name,'_',type], T, xlimit, ylimit); |
| 30 |
toc |