PIVMat Function Reference<< Prev | Next >> 
vec2scal
Converts vector fields into scalar fields

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. 
The resulting scalar field(s) S can be displayed using showf. 
 
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 
   en, ken         kinetic energy, norm^2 / 2 
   curl (or rot)   curl (vorticity field) 
   absrot          absolute value of the curl 
   div             2D divergence (dux/dx + duy/dy) 
   ens             enstrophy (=square of vorticity / 2) 
   rad, deg        velocity angle (tan(angle)=vy/vx), in rad or deg 
   strain          norm of the strain rate, sqrt(s1^2 + s2^2), 
                   where s1 and s2 are the 2D strain eigenvalues. 
   q               Q-criterion, Q = (enstrophy - strain^2)/2 
   eps             squared strain rate, s1^2 + s2^2 
   duxdx, duxdy, duydx, duydy      spatial derivatives  (du_i / dx_j) 
   txx, tyy, txy   3 components of the Reynolds stress tensor (u_i u_j) 
                   (Careful: the average is NOT subtracted, and the 
                   usual minus (-) sign is NOT included here) 
   smin            minimum eigenvalue 
   real, imag      extracts the real part or the imaginary part 
 
Adding '-' (minus sign) before MODE (e.g., '-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 
 
The scalar fields built from derivatives (e.g., rot, div, ens etc.) 
are computed from 2nd-order centered differences. 
Specify 'rot1', 'div1' etc. to use 1st-order finite differences (in 
this case, the resulting field is decreased by 1 unit, and the x and y 
coordinates are interpolated). 
 
S = vec2scal(FILE) is a shortcut for S = vec2scal(loadvec(FILE)). 
 
By default, vectors with a zero component are considered as erroneous, 
and are not used for the computation of the derivative fields (rot, 
div, eps, duxdx, ...). If however you want to keep them in the 
computation, specify  vec2scal(V,MODE,'keepzero'). 
 
vec2scal(...), without output argument, shows the result with showf. 
 
Examples
 
  showf(vec2scal(v,'div')); 
  showf(vec2scal(filterf('*.vc7',2),'rot')); 
  stat_rot = statf(vec2scal(v,'rot')); 
  vec2scal *.vc7 ken 
 
See Also
showf, gradientf, operf. 
 
Published output in the Help browser 
   showdemo vec2scal 

 Previous: vec2matNext: vortex 

2005-2013 PIVMat Toolbox 2.12c