3.4.3. The NV Macros

The NV macros have the same purpose as ND macros, but they operate on vectors (that is, arrays of length ND_ND) instead of separate components.

3.4.3.1. NV_V

The utility NV_V performs an operation on two vectors.

 NV_V(a, =, x);
  a[0] = x[0]; a[1] = x[1]; etc. 

Note that if you use + = instead of = in the above equation, then you get

   a[0]+=x[0]; etc. 

See DEFINE_GRID_MOTION for an example UDF that utilizes NV_V.

3.4.3.2. NV_VV

The utility NV_VV performs operations on vector elements. The operation that is performed on the elements depends upon what symbol (-,/,*) is used as an argument in place of the + signs in the following macro call.

 NV_VV(a, =, x, +, y)
  2D: a[0] = x[0] + y[0], a[1] = x[1] + y[1]; 

See DEFINE_GRID_MOTION for an example UDF that utilizes NV_VV.

3.4.3.3. NV_V_VS

The utility NV_V_VS adds a vector to another vector which is multiplied by a scalar.

 NV_V_VS(a, =, x, +, y, *, 0.5);
  2D: a[0] = x[0] + (y[0]*0.5), a[1] = x[1] +(y[1]*0.5);

Note that the + sign can be replaced by -, /, or *, and the * sign can be replaced by /.

3.4.3.4. NV_VS_VS

The utility NV_VS_VS adds a vector to another vector which are each multiplied by a scalar.

 NV_VS_VS(a, =, x, *, 2.0, +, y, *, 0.5);
  2D: a[0] = (x[0]*2.0) + (y[0]*0.5), a[1] = (x[1]*2.0) + (y[1]*0.5); 

Note that the + sign can be used in place of -, *, or /, and the * sign can be replaced by /.


Release 18.2 - © ANSYS, Inc. All rights reserved.