NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/gliderproc/trunk/MATLAB/opnml/FEM/plotbnd.m

Revision 495 (checked in by cbc, 12 years ago)

Initial import of Stark code.

Line 
1 % PLOTBND - plot boundary of FEM mesh
2 %   PLOTBND(fem_grid_struct) draws the boundary of
3 %   an input FEM domain. 
4 %
5 %   PLOTBND can also be used to draw the boundary of a transect.
6 %   The boundary list can be generated by passing DETBNDY
7 %   the transect node coordinates and the element list for
8 %   the transect.  Then, pass PLOTBND the same node coordinates
9 %   and the boundary list returned from DETBNDY.
10
11 %   INPUT : fem_grid_struct (from LOADGRID, see FEM_GRID_STRUCT)
12 %
13 %  OUTPUT : hboun - handle to boundary object drawn
14 %
15 %    CALL : hboun=plotbnd(fem_grid_struct)
16 %
17 % Written by : Brian O. Blanton
18 % Summer 1997
19 %
20 function retval=plotbnd(fem_grid_struct)
21
22 if nargin ~=1
23    error('    Incorrect number of input arguments to PLOTBND');
24 end
25
26 if ~is_valid_struct(fem_grid_struct)
27    error('    Argument to PLOTBND must be a valid fem_grid_struct.')
28 end
29
30 % Extract grid fields from fem_grid_struct
31 %
32 bnd=fem_grid_struct.bnd;
33 x=fem_grid_struct.x;
34 y=fem_grid_struct.y;
35
36 ns=bnd(:,1);
37 ne=bnd(:,2);
38 X=[x(ns) x(ne) NaN*ones(size(ns))]';
39 Y=[y(ns) y(ne) NaN*ones(size(ns))]';
40 X=X(:);
41 Y=Y(:);
42 hboun=line(X,Y,...
43            'Color','k',...
44            'Linestyle','-',...
45            'LineWidth',1,...
46            'Tag','boundary');
47            
48 if nargout==1,retval=hboun;,end
49 %
50 %        Brian O. Blanton
51 %        Department of Marine Sciences
52 %        15-1A Venable Hall
53 %        CB# 3300
54 %        Uni. of North Carolina
55 %        Chapel Hill, NC
56 %                 27599-3300
57 %
58 %        919-962-4466
59 %        blanton@marine.unc.edu
60 %
61 %        Summer 1997
62 %
Note: See TracBrowser for help on using the browser.