stiff#
- AnsMath.stiff(dtype=<class 'numpy.float64'>, name=None, fname='file.full', asarray=False)#
Load the stiffness 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:
AnsMat
or scipy.sparse.csr.csr_matrixAnsMath matrix or SciPy sparse matrix, depending on the value for the
asarray
parameter.
Examples
>>> k = mm.stiff() AnsMath matrix 60 x 60
Convert to a SciPy array.
>>> mat = k.asarray() >>> mat <60x60 sparse matrix of type '<class 'numpy.float64'>' with 1734 stored elements in Compressed Sparse Row (CSR) format>