smat#
- MatrixOperations.smat(matrix='', type_='', method='', val1='', val2='', val3='', val4='', val5='', **kwargs)#
Creates a sparse matrix.
Mechanical APDL Command: *SMAT
- Parameters:
- matrix
str Name used to identify the matrix. Must be specified.
- type_
str Matrix type:
D- Double precision real values (default).Z- Complex double precision values.
- method
str Method used to create the matrix:
ALLOC- Allocate a new matrix.COPY- Copy an existing matrix.IMPORT- Import the matrix from a file.
- val1
str Name of the matrix to copy (can be either a dense or a sparse matrix).
- val2
str Method used for copying the matrix:
DIAG- Copy only the diagonal of the matrix.Val3andVal4are ignored.TRANS- Transpose the original matrix.Val3andVal4are ignored.EXTRACT- Extract a submatrix based on row and column numbers specified byVal3andVal4.
- val3
str Name of integer vector ( vec ) containing row numbers. If no vector is specified, defaults to all rows.
- val4
str Name of integer vector ( vec ) containing column numbers. If no vector is specified, defaults to all columns.
- val5
str Additional input. The meaning of
Val1throughVal5will vary depending on the specifiedMethod. See details below.
- matrix
Notes
Warning
This function contains specificities regarding the argument definitions. Please refer to the command documentation for further explanations.
Argument Descriptions
matrix : str- Name used to identify the matrix. Must be specified.type_ : str- Matrix type:D- Double precision real values (default).Z- Complex double precision values.
method : str- 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 : str- Additional input. The meaning ofVal1throughVal5will vary depending on the specifiedMethod. See details below.
The following
Valxfields are used withMethod= ALLOC.val1 : str- Method used to create the matrix:DIAG- Allocate a diagonal square matrix.Val2is used;Val3,Val4, andVal5are 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 asVal2,Val3andVal4.Val2, Val3, Val4- Names of required row_ptr, col_ind and val vectors. These vectors must be created using the vec command.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
Valxfields are used withMethod= COPY.val1 : str- Name of the matrix to copy (can be either a dense or a sparse matrix).val2 : str- Method used for copying the matrix:DIAG- Copy only the diagonal of the matrix.Val3andVal4are ignored.TRANS- Transpose the original matrix.Val3andVal4are ignored.EXTRACT- Extract a submatrix based on row and column numbers specified byVal3andVal4.
val3 : str- Name of integer vector ( vec ) containing row numbers. If no vector is specified, defaults to all rows.val4 : str- Name of integer vector ( vec ) containing column numbers. If no vector is specified, defaults to all columns.
The following table describes the
Valxfields used withMethod= IMPORT.This command contains some tables and extra information which can be inspected in the original documentation pointed above.
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
For more information on the NOD2SOLV and USR2SOLV mapping vectors, see.
For more information about
.FULLfile contents, see the hbmat in the Command Reference.