damp#
- AnsMath.damp(dtype=<class 'numpy.float64'>, name=None, fname='file.full', asarray=False)#
Load the damping matrix from a FULL file.
- Parameters:
- dtype
numpy.dtype,optional NumPy data type to store the matrix as. The options are
np.double,np.int32, andnp.int64. The default isnp.double. This parameter is only applicable ifasarray=True.- name
str,optional AnsMath matrix name. The default is
None, in which case a name is automatically generated.- fname
str,optional Name of the file to read the matrix from. The default is
"file.full".- asarraybool,
optional Whether to return a SciPy array rather than an AnsMath matrix. The default is
False.
- dtype
- Returns:
AnsMator scipy.sparse.csr.csr_matrixAnsMath matrix or SciPy sparse matrix, depending on the value for the
asarrayparameter.
Examples
>>> import ansys.math.core.math as pymath >>> mm = pymath.AnsMath() >>> ans_mat = mm.damp() >>> ans_mat AnsMath Matrix 60 x 60
Convert to a SciPy array.
>>> mat = ans_mat.asarray() >>> mat <60x60 sparse matrix of type '<class 'numpy.float64'>' with 1734 stored elements in Compressed Sparse Row (CSR) format>.