*SMAT

*SMAT, Matrix, Type, Method, Val1, Val2, Val3, Val4 , Val5
Creates a sparse matrix.

Valid Products: Pro | Premium | Enterprise | PrepPost | Solver | AS add-on

Argument Descriptions

Matrix

Name used to identify the matrix. Must be specified.

Type

Matrix type:

D -- 

Double precision real values (default).

Z -- 

Complex double precision values.

Method

Method used to create the matrix:

ALLOC -- 

Allocate a new matrix.

COPY -- 

Copy an existing matrix.

IMPORT -- 

Import the matrix from a file.

Val1, Val2, Val3, Val4, Val5

Additional input. The meaning of Val1 through Val5 will vary depending on the specified Method. See details below.

The following Valx fields are used with Method = ALLOC.

Val1

Method used to create the matrix:

DIAG -- 

Allocate a diagonal square matrix. Val2 is used; Val3, Val4, and Val5 are ignored.

Val2

Matrix size.

CSR --

Create a square sparse matrix based on Compressed Sparse Row (CSR) format description vectors. This format requires 3 input vectors specified as Val2, Val3 and Val4.

Val2, Val3, Val4

Names of required row_ptr, col_ind and val vectors. These vectors must be created using the *VEC command.


Note:  row_ptr is a long integer vector (use of L instead of I as the scalar type in the *VEC call); col_ind is an integer vector. Val can be a real of complex values vector, according to the matrix type.


Val5

Specifies whether the matrix is symmetric (TRUE) or unsymmetric (FALSE). Default = TRUE.

The following Valx fields are used with Method = COPY.

Val1

Name of the matrix to copy (can be either a dense or a sparse matrix).

Val2

Method used for copying the matrix:

DIAG -- 

Copy only the diagonal of the matrix. Val3 and Val4 are ignored.

TRANS --

Transpose the original matrix. Val3 and Val4 are ignored.

EXTRACT -- 

Extract a submatrix based on row and column numbers specified by Val3 and Val4.

Val3

Name of integer vector (*VEC) containing row numbers. If no vector is specified, defaults to all rows.

Val4

Name of integer vector (*VEC) containing column numbers. If no vector is specified, defaults to all columns.

The following table describes the Valx fields used with Method = IMPORT.

Method = IMPORT
Val1Val2Val3Val4Val5Description
FULLFile name [a]Matrix type:
STIFF - Stiffness matrix
MASS - Mass matrix
DAMP - Damping matrix
NOD2SOLV - Mapping vector relating the full set of nodal DOFs to the subset that the solver uses
USR2SOLV - Mapping vector relating the full set of external nodal DOFs to the subset that the solver uses
GMAT - Constraint equation matrix
K_RE - Real part of the stiffness matrix
K_IM - Imaginary part of the stiffness matrix
(not used)(not used)Import a matrix from an existing FULL file.
For a complex stiffness matrix, you can use the K_RE or K_IM label to import only the real part or only the imaginary part. The K_RE and K_IM options both create real matrices.
Note that the K_IM matrix is only available for MODOPT,UNSYM and MODOPT,DAMP modal analyses.
HBMATFile name [a]File format:
ASCII
BINARY
(not used)(not used)Import a matrix from an existing Harwell-Boeing format file.
MMFFile name [a](not used)(not used)(not used)Import a matrix from an existing Matrix Market format file.
DMIGFile name [a]File Format:
FREE - Free field format
LARGE - Large field format (default)
Delimeter character (only for FREE field format); defautl is ’,’Matrix name (default is the first matrix of the DMIG file)Import a matrix from an existing NASTRAN DMIG file.
MATFile name [a](not used)(not used)(not used)Restore from a previous *EXPORT (FORMAT = MAT) command..

[a] File name is case-sensitive with a 32-character maximum.

Notes

Use the *DMAT command to create a dense matrix.

For more information on the CSR format, see Creating a Sparse Matrix Using the CSR Format in the Ansys Parametric Design Language Guide.

For more information on the NOD2SOLV and USR2SOLV mapping vectors, see Degree of Freedom Ordering in the Ansys Parametric Design Language Guide.

For more information about .full file contents, see the HBMAT in the Command Reference.

Menu Paths

This command cannot be accessed from a menu.