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

root/gliderproc/trunk/MATLAB/opnml/html/3.FEM/sample_field_2d.html

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

Initial import of Stark code.

Line 
1 <TITLE>/</TITLE>
2 <BODY>
3 <A HREF = "index.html">[Index for ./FEM]</A>
4 <A HREF = "../index.html">[Return to Master Index]</A>
5 <H1>sample_field_2d</H1>
6 <H2>(./FEM/sample_field_2d.m)</H2>
7 <HR><H3>Function Synopsis</H3>
8 <pre>outmat=sample_field_2d(fem_grid_struct,nx,ny,Q,box_coords)</pre>
9 <HR><H3>Help text</H3>
10 <pre>
11 SAMPLE_FIELD_2D Mouse-driven 2-D FEM Field Sampler
12    SAMPLE_FIELD_2D is a mouse-driven 2-D field sampler prompts
13    the user to draw a box on the current figure, and
14    returns an array of coordinates and interpolated
15    field values.  The input field array can be any number
16    of columns wide (scalar, vector, etc.) but must be as
17    long as the node coordinate lists in <A HREF = "../3.FEM/fem_grid_struct.html">fem_grid_struct</A>.
18    I.e., the fields to interpolate will usually come from
19    the FEM domain itself.
20
21   INPUT:  <A HREF = "../3.FEM/fem_grid_struct.html">fem_grid_struct</A> - FEM domain structure on which the field
22                    to sample is related (from <A HREF = "../3.FEM/loadgrid.html">LOADGRID</A>, see <A HREF = "../3.FEM/fem_grid_struct.html">FEM_GRID_STRUCT</A>).
23           nx,ny  - number of points in the x and y direction at which to
24                    sample the fields Q.  (REQUIRED, INTEGERS)
25           Q      - the fields to sample. This array must be the same length as
26                    the node coordinate arrays in the valid <A HREF = "../3.FEM/fem_grid_struct.html">fem_grid_struct</A>
27                    passed in, but the number of columns is arbitrary.
28
29           box_coords - optional 4x1 vector defining the sample region. 
30                        The 4 values are [X1 Y1 X2 Y2], and if defined
31                        they take precedence over the mouse-driven facility.
32
33  OUTPUT:  S      - an array containing the sample points and sample values.
34                    If nx or ny==1, then S contains the sample points and
35                    sample values in columns.  Otherwise, S is an
36                    [nx X ny X ncol] array, where ncol is the number of
37                    columns in the input array Q and the first 2 levels of
38                    S are the X and Y coordinates (X=S(:,:,1), Y=S(:,:,2)).
39                    Points not located within FEM domain are assigned NaN's
40                    as field values.
41  
42                    To contour the results in the case where nx and ny &gt; 1,
43                    call MATLAB's contourf routine with S appropriately
44                    sampled.  For example:
45                    &gt;&gt; contourf(S(:,:,1),S(:,:,2),S(:,:,3))
46            
47    CALL: S=sample_field_2d(<A HREF = "../3.FEM/fem_grid_struct.html">fem_grid_struct</A>,nx,ny,Q)
48
49  Written by Brian O. Blanton
50  Summer 1998
51
52 </pre>
53 <HR><H3>Cross-Reference Information</H3>This function calls
54 <pre><UL>
55 <LI><A HREF = "../3.FEM/is_valid_struct.html">is_valid_struct</A>./FEM/is_valid_struct.m</LI>
56 </UL></pre>
57 <HR>
58 Produced by <A HREF="http://www.nd.edu/Courses/kantor/matlab/mat2html">mat2html</A> on Tue Feb  2 16:15:45 EST 1999
59 <BR>
60 Cross-Directory links are: OFF<BR>
61 </BODY>
Note: See TracBrowser for help on using the browser.