4.3. Vector Functions

4.3.1. Function vdot (Computing the Dot Product of Two Vectors)

*deck,vdot
      function  vdot (v1,v2,n)
c *** primary function: compute dot product of vectors v1 and v2

c *** Notice - This file contains ANSYS Confidential information ***

c  input arguments:
c     v1       (dp,ar(n),in)     - vector v1
c     v2       (dp,ar(n),in)     - vector v2
c     n        (int,sc,in)       - length of vectors v1 and v2

c  output arguments:
c     vdot     (dp,sc,out)       - dot product of v1 and v2

c

4.3.2. Function vidot (Computing the Dot Product of Two Vectors with Increments)

*deck,vidot
      function vidot (v1,inc1,v2,inc2,n)
c *** primary function: compute the dot product of vectors v1 and v2
c *** Notice - This file contains ANSYS Confidential information ***
c     
c     ---- inc1 and inc2 must be positive!
c

4.3.3. Function vsum (Summing Vector Components)

*deck,vsum
      function vsum (va,n)
c *** primary function: sum the components of a vector

c *** Notice - This file contains ANSYS Confidential information ***

c  input arguments:
c     va       (dp,ar(n),in)     - vector va
c     n        (int,sc,in)       - length of vector va

c  output arguments:
c     vsum     (dp,sc,out)       - vector sum


4.3.4. Function vmax (Retrieving the Maximum Vector Value at a Given Location)

*deck,vmax
      function vmax (v,n,locmax)
c *** primary function: get the biggest value and location in v
c *** Notice - This file contains ANSYS Confidential information ***

4.3.5. Function lastv (Retrieving the Position of the Last Nonzero Term in a Double Precision Vector)

*deck,lastv
      function lastv (v,n)
c ********* find position of last non-zero term in a d.p. vector *********
c *** Notice - This file contains ANSYS Confidential information ***
c
c  input arguments:
c     v     (dp,ar(*),in)           - input vector
c     n      (int,sc,in)           - length of vector
c  output arguments:
c     lastv     (int,func,out)       - position of last non-zero term

4.3.6. Function izero (Setting an Integer Vector to Zero)

*deck,IZERO
      subroutine IZERO (ivect,n)
c **********  set an integer vector to zero  **********

4.3.7. Function imove (Assigning Equal Values to Two Integer Vectors)

*deck,imove
      subroutine imove (i1,i2,n)
c **********  move a vector from one to another  **********

4.3.8. Subroutine vzero (Initializing a Vector to Zero)

*deck,vzero
      subroutine vzero (v,n)
c *** primary function:    initialize a vector to zero
c *** Notice - This file contains ANSYS Confidential information ***

4.3.9. Subroutine vmove (Moving One Vector into Another)

*deck,vmove
      subroutine vmove (v1,v2,n)
c *** primary function: copy v1 vector into another vector
c *** Notice - This file contains ANSYS Confidential information ***

4.3.10. Subroutine vimove (Moving One Vector into Another Incrementally)

*deck,vimove
      subroutine vimove (v1,inc1,v2,inc2,n)
c *** primary function: move one vector into another
c *** Notice - This file contains ANSYS Confidential information ***

4.3.11. Subroutine vinit (Assigning a Scalar Constant to a Vector)

*deck,vinit
      subroutine vinit (v,n,const)
c *** primary function: initialize a vector to a constant
c *** Notice - This file contains ANSYS Confidential information ***

4.3.12. Subroutine viinit (Assigning a Scalar Constant to a Vector Incrementally)

*deck,viinit
      subroutine viinit (v,inc,n,const)
c *** primary function: set the components of vector v to const by increments
c *** Notice - This file contains ANSYS Confidential information ***

4.3.13. Subroutine vapb (Setting a Vector to Sum of Two vectors)

*deck,vapb
      subroutine vapb (a,b,c,n)
c *** primary function: add vector a to vector b to get vector c
c *** Notice - This file contains ANSYS Confidential information ***

4.3.14. Subroutine vapb1 (Combining Two Vectors in One)

*deck,vapb1
      subroutine vapb1 (a,b,n)
c *** primary function: add vector b to vector a and store in vector a

4.3.15. Subroutine vapcb1 (Multiplying a Vector to a Constant)

*deck,vapcb1
      subroutine vapcb1 (a,b,n,const)
c *** primary function: multiply vector b to constant, add to vector a,
c                       and store in vector a

4.3.16. Subroutine vamb (Gets a Third Vector by Subtracting One Vector from Another)

*deck,vamb
      subroutine vamb (a,b,c,n)
c *** primary function: subtract vector b from vector a to get vector c
c *** Notice - This file contains ANSYS Confidential information ***

4.3.17. Subroutine vamb1 (Subtracting One Vector from Another)

*deck,vamb1
      subroutine vamb1 (a,b,n)
c *** primary function: subtract vector b from vector a and save in vector a
c *** Notice - This file contains ANSYS Confidential information ***

4.3.18. Subroutine vmult (Multiplying a Vector by a Constant)

*deck,vmult
      subroutine vmult (v1,v2,n,const)
c *** primary function: multiply a vector by a constant
c *** Notice - This file contains ANSYS Confidential information ***

4.3.19. Subroutine vmult1 (Multiplying a Vector by a Constant)

*deck,vmult1
      subroutine vmult1 (v1,n,const)
c *** primary function:  multiply a vector by a constant
c *** Notice - This file contains ANSYS Confidential information ***

4.3.20. Subroutine vcross (Defining a Vector via a Cross Product)

*deck,vcross
      subroutine vcross (a,b,c)

c primary function: calculate c = a x b 

c *** Notice - This file contains ANSYS Confidential information ***
                                                                     
c     typ=int,dp,log,chr,dcp   siz=sc,ar(n)   intent=in,out,inout
                                                                 
c  input arguments:
c     a        (dp,ar(3),in)     - first vector to be cross-multiplied
c     b        (dp,ar(3),in)     - second vector to be cross-multiplied
                                             
c  output arguments:
c     c        (dp,ar(3),out)    - resulting vector
c
c

4.3.21. Subroutine vnorme (Normalizing a Three-Component Vector)

*deck,vnorme
      subroutine vnorme (iel,v)
c primary function:  normalize a vector to unit length
c  this routine is to be called only from the elements.   it is only
c  for a three component vector(i.e. processing geometry).
c  this routine also differs from vnorm in that an error message is called
c  if the vector length is zero.


c *** Notice - This file contains ANSYS Confidential information ***

c  input arguments:
c     iel      (int,sc,inout)    - element number
c     v        (dp,ar(3),inout)  - vector to be normalized

c  output arguments:
c     iel      (int,sc,inout)    - if 0, vector has zero length
c     v        (dp,ar(3),inout)  - normalized vector


4.3.22. Subroutine vnorm (Normalizing a Vector to Unit Length)

*deck,vnorm
      subroutine vnorm (v,n)
c *** primary function: normalize a vector to unit length

c *** Notice - This file contains ANSYS Confidential information ***

c  input arguments:
c     v        (dp,ar(n),inout)  - vector v
c     n        (int,sc,inout)    - dimension length of vector v

c  output arguments:
c     v        (dp,ar(n),inout)  - normalized vector v
c     n        (int,sc,inout)    - n = 0 if error in operation


4.3.23. Function ndgxyz (Getting the X,Y,Z Vector for a Node)

*deck,ndgxyz
      function ndgxyz (node,xyz)
c *** primary function:    get x,y,z vector for a node.

c *** Notice - This file contains ANSYS Confidential information ***

c     input arguments:
c        node     (int,sc,in)       - node number for operation.

c     output arguments:
c        ndgxyz   (int,sc,out)      - status of node.
c                                       0=node is undefined.
c                                      -1=node is unselected.
c                                       1=node is selected.
c        xyz      (dp,ar(3),out)    - vector containing x,y,z


4.3.24. Subroutine ndpxyz (Storing X,Y,Z for a Node)

*deck,ndpxyz
      subroutine ndpxyz (node,xyz)
c *** primary function:    store x,y,z vector for a node.

c *** Notice - This file contains ANSYS Confidential information ***

c     input arguments:
c        node     (int,sc,in)       - node number for operation.
c        xyz      (dp,ar(3),in)     - vector containing x,y,z
c                                     (vector should be in global system)

c     output arguments:  none