Chapter 4: APDL Math

APDL Math extends the APDL scripting environment of Mechanical APDL to give you access to the powerful matrix manipulation routines in the Mechanical APDL product, including its fast and efficient solvers. APDL Math provides access to matrices and vectors on the .full, .emat, .mode and .sub files, as well as other sources, so that you can read them in, manipulate them, and write them back out or solve them directly. This functionality augments the vector and matrix operations (such as *VOPER and *MOPER), in the standard APDL scripting environment. Both dense matrices and sparse matrices can be manipulated using APDL Math.

Differences Between Standard APDL and APDL Math  —  APDL Math works in its own workspace independent of the APDL environment. However, APDL arrays (vectors or matrices) may be imported into this workspace for manipulation, and also may be exported from this workspace into the standard APDL environment.

The following is a summary of the APDL Math commands:

Commands to create and delete matrices and vectors
*DMAT Creates a dense matrix.
*SMAT Creates a sparse matrix.
*VEC Creates a vector.
*FREE Deletes a matrix or a solver object and frees its memory allocation.
Commands to manipulate matrices
*AXPY Performs the matrix operation M2= v*M1 + w*M2.
*COMP Compresses the columns of a matrix using a specified algorithm.
*DOT Computes the dot (or inner) product of two vectors.
*FFT Computes the fast Fourier transformation of the specified matrix or vector.
*HPRODPerforms a Hadamard vector product (C = A∘B).
*INIT Initializes a vector or matrix.
*KRONComputes the Kronecker product of two matrices/vectors,
*MERGE Merges two dense matrices or vectors into one.
*MULT Performs the matrix multiplication M3 = M1(T1)*M2(T2).
*NRM Computes the norm of the specified vector or matrix.
*REMOVE Suppresses rows or columns of a dense matrix or a vector.
*RENAME Renames an existing vector or matrix.
*SCAL Scales a vector or matrix by a constant or a vector.
*SORT Sorts the values of the specified vector.
Commands to perform solutions
*LSENGINE Creates a linear solver engine.
*LSFACTOR Performs the numerical factorization of a linear solver system.
*LSBAC Performs the solve (forward/backward substitution) of a factorized linear system.
*ITENGINE Performs a solution using an iterative solver.
*EIGEN Performs a modal solution with unsymmetric or damping matrices.
Commands to output matrices
*EXPORT Exports a matrix to a file in the specified format.
*PRINT Prints the matrix values to a file.
Other useful commands
*INQUIRERetrieves properties of an existing APDL Math object.