Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
% |
---|
2 |
% CURL - Compute the CURL of a FEM 2-D vector field |
---|
3 |
% |
---|
4 |
% CURL(fem_grid_struct,u,v) computes the curl of a 2-D |
---|
5 |
% vector field (u,v) (curl X (u,v)) over the FEM domain |
---|
6 |
% specified by fem_grid_struct. The result is a 2-D |
---|
7 |
% scalar field containing the curl, returned to the workspace. |
---|
8 |
% |
---|
9 |
% The computed quantity is: crl=dv/dx - du/dy |
---|
10 |
% |
---|
11 |
% INPUT : fem_grid_struct (from LOADGRID, see FEM_GRID_STRUCT) |
---|
12 |
% u,v - u,v vector field |
---|
13 |
% |
---|
14 |
% OUTPUT : crl - curl X (u,v) |
---|
15 |
% |
---|
16 |
% CALL : crl=curl(fem_grid_struct,u,v); |
---|
17 |
% |
---|
18 |
% ALL ARGUMENTS ARE REQUIRED. |
---|
19 |
% |
---|
20 |
% Written by : Brian O. Blanton |
---|
21 |
% Spring 1998 |
---|
22 |
% |
---|
23 |
function crl=curl(fem_grid_struct,u,v) |
---|
24 |
|
---|
25 |
if nargin ~=3 |
---|
26 |
error(' CURL MUST (ONLY) HAVE 3 INPUT ARGUMENTS.'); |
---|
27 |
end |
---|
28 |
|
---|
29 |
if nargout~=1 |
---|
30 |
error(' CURL must have 1 (and only 1) output argument.') |
---|
31 |
end |
---|
32 |
|
---|
33 |
if ~is_valid_struct(fem_grid_struct) |
---|
34 |
error(' First argument to CURL must be a valid fem_grid_struct.') |
---|
35 |
end |
---|
36 |
|
---|
37 |
crl=curlmex5(fem_grid_struct.x,... |
---|
38 |
fem_grid_struct.y,... |
---|
39 |
fem_grid_struct.e,... |
---|
40 |
u,v); |
---|
41 |
% |
---|
42 |
% Written by: |
---|
43 |
% Brian O. Blanton |
---|
44 |
% Dept. of Marine Sciences |
---|
45 |
% 15-1A Venable Hall |
---|
46 |
% CB# 3300 |
---|
47 |
% Uni. of North Carolina |
---|
48 |
% Chapel Hill, NC |
---|
49 |
% 27599-3300 |
---|
50 |
% |
---|
51 |
% 919-962-4466 |
---|
52 |
% blanton@marine.unc.edu |
---|