set_vec#
- MapdlMath.set_vec(data, name=None)[source]#
Push a numpy array or Python list to the MAPDL memory workspace.
- Parameters:
- data
np.ndarray
,list
Numpy array or Python list to push to MAPDL. Must be 1 dimensional.
- name
str
,optional
APDLMath vector name. If unset, one will be automatically generated.
- data
- Returns:
ansys.mapdl.math.AnsVec
MAPDL vector instance generated from the pushed vector.
Examples
Push a random vector from numpy to MAPDL.
>>> data = np.random.random(10) >>> vec = mm.set_vec(data) >>> np.isclose(vec.asarray(), data) True