Chandra Sekaran
Ansys Employee

Take a look at the APDL Math commands and examples like below ( https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v241/en/ans_apdl/apdlmathex.html?q=%5C*dmat ) . This example below shows how to read the stiffness matrix and the load vector (RHS).

Example 4.2: Read a Matrix and a Load Vector from a FULL File and Solve

! READ THE STIFFNESS MATRIX FROM THE FULL FILE
*SMAT,MatK,D,IMPORT,FULL,file.full,STIFF

! READ THE MAPPING TABLE: INTERNAL -> SOLV
*SMAT,Nod2Solv,D,IMPORT,FULL,file.full,NOD2SOLV

! READ THE LOAD VECTOR FROM THE FULL FILE
*DMAT,VecB,D,IMPORT,FULL,file.full,RHS

! ALLOCATE THE SOLUTION VECTOR IN SOLVER SPACE BY SIMPLY COPYING B
*DMAT,VecX,D,COPY,VecB			

! FACTORIZE A USING THE SPARSE SOLVER FUNCTIONS
*LSENGINE,DSP,MySolver,MatK
*LSFACTOR,MySolver
 
! SOLVE THE LINEAR SYSTEM
*LSBAC,MySolver,VecB,VecX 		

! CONVERT THE SOLUTION TO THE INTERNAL SPACE
*MULT,Nod2Solv,T,VecX,,XNod

! PRINT THE SOLUTION
*PRINT,XNod

! FREE ALL OBJECTS
*FREE,ALL