set_vec

MapdlMath.set_vec(data, name=None)

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.

  • vname (str, optional) – APDLMath vector name. If unset, one will be automatically generated.

Returns

vec (ansys.mapdl.math.AnsVec) – MAPDL vector instance generated from the pushed vector.

Examples

>>> data = np.random.random(10)
>>> vec = mm.set_vec(data)
>>> np.isclose(vec.asarray(), data)
True