get_vec#

MapdlMath.get_vec(dtype=None, name=None, fname='file.full', mat_id='RHS', asarray=False)[source]#

Load a vector from a file.

Parameters:
dtypenumpy.dtype, optional

Numpy data type to store the vector as. Defaults to np.double.

namestr, optional

APDLMath matrix name. Optional and defaults to a random name.

fnamestr, optional

Filename to read the vector from.

mat_idstr, optional

Vector ID to load. If loading from a "*.full" file, can be one of the following:

  • "RHS" - Load vector

  • "GVEC" - Constraint equation constant terms

  • "BACK" - nodal mapping vector (internal to user). If this is used, the default dtype is np.int32.

  • "FORWARD" - nodal mapping vector (user to internal) If this is used, the default dtype is np.int32.

asarraybool, optional

Return a scipy array rather than an APDLMath matrix.

Returns:
numpy.ndarray or AnsVec

Numpy array or APDLMath vector depending on asarray.

Examples

>>> vec = mm.get_vec(fname='PRSMEMB.full', mat_id="RHS")
>>> vec
APDLMath Vector Size 126