vec2scal.mBack to Contents<< Prev |  Next >> 

vec2scal
Converts a vector field into a scalar field

Description
S = vec2scal(V) returns scalar field(s) S given by the norm of the 
vector field(s) V. The vector field(s) V can be obtained from loadvec 
or loadset and the scalar field(s) S can be displayed by showscal. 
 
S = vec2scal(V,MODE) specifies the conversion MODE: 
   norm            norm (ux^2 + uy^2)^(1/2); by default. 
   ux, uy          x or y component of the vector field 
   ken             kinetic energy, norm^2 / 2 
   curl (or rot)   curl 
   absrot          absolute value of the rotational 
   div             2D divergence (dux/dx + duy/dy) 
   ens             enstrophy (=square of vorticity) 
   strain          norm of the strain rate, sqrt(s1^2 + s2^2), 
                   where s1 and s2 are the 2D strain eigenvalues. 
   eps             squared strain rate, s1^2 + s2^2 
   duxdx, duxdy, duydx, duydy      spatial derivatives  (du_i / dx_j) 
   angle           velocity angle (tan(angle)=vy/vx) 
Adding '-' (minus sign) before MODE (eg, '-rot') inverts the result. 
 
The resulting scalar field S contains the following fields: 
   x,y:                 vectors containing the X and Y coordinates 
   w:                   matrix of scalar elements 
   namex, unitx, namey, unity: strings for the name and unit of coord 
   namew, unitw:        strings for the name and unit of the matrix w 
   name:                name of the VEC file from which originates V 
   setname:             name of the current directory 
   history:             Remind from which command S has been obtained 
 
Note: for the derivative operators (rot, div etc.), the size of the 
field is decreased by 1 unit. The x and y coordinates are interpolated. 
 
S = vec2scal(FILE) is a shortcut for S = vec2scal(loadvec(FILE)). 
 
vec2scal(...), without output argument, shows the result with showscal. 
 
Examples: 
  showscal(vec2scal(v,'div')); 
  showscal(vec2scal(filterf(loadset,2),'rot')); 
  stat_rot = statf(vec2scal(v,'rot')); 
  vec2scal *.vec 
 
F. Moisy 
Revision: 1.42,  Date: 2005/11/18. 
 
See Also
showvec, showscal, operf. 

 Previous: vec2matNext: vortex 

Help file generated by m2html 1.06