load_matrix_from_file#
- AnsMath.load_matrix_from_file(dtype=<class 'numpy.float64'>, name=None, fname='file.full', mat_id='STIFF', asarray=False)#
Import a matrix from an existing FULL file.
- Parameters:
- dtype
numpy.dtype
,optional
Data type to store the matrix as. The options are double (
"DOUBLE"
or"D"
), complex numbers ("COMPLEX"
or"Z"
), or NumPy data type (np.double
,np.int32
, andnp.int64
). The default isnp.double
.- fname
str
,optional
Name of the file to read the matrix from. The default is
"file.full"
.- name
str
,optional
AnsMath matrix name. The default is
None
, in which case a name is automatically generated.- mat_id
str
,optional
Matrix type. The default is
"STIFF"
. Options are:"STIFF"
: Stiffness matrix."MASS"
: Mass matrix."DAMP"
: Damping matrix."GMAT"
: Constraint equation matrix."K_RE"
: Real part of the stiffness matrix."K_IM"
: Imaginary part of the stiffness matrix.
- asarraybool,
optional
Whether to return a SciPy array rather than an AnsMath matrix. The default is
False
.
- dtype
- Returns:
AnsMat
orscipy.sparse.csr.csr_matrix
AnsMath matrix or SciPy sparse matrix, depending on the value for the
asarray
parameter.