set_vec

MapdlMath.set_vec(data, name=None)

Push a numpy array or Python list to the MAPDL memory workspace.

Parameters
datanp.ndarray, list

Numpy array or Python list to push to MAPDL. Must be 1 dimensional.

vnamestr, optional

APDLMath vector name. If unset, one will be automatically generated.

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