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:
dtypenumpy.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, and np.int64). The default is np.double.

fnamestr, optional

Name of the file to read the matrix from. The default is "file.full".

namestr, optional

AnsMath matrix name. The default is None, in which case a name is automatically generated.

mat_idstr, 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.

Returns:
AnsMat or scipy.sparse.csr.csr_matrix

AnsMath matrix or SciPy sparse matrix, depending on the value for the asarray parameter.