data_transfer.py¶
Class definition for the DataTransfer object.
-
class
openmdao.core.data_transfer.
DataTransfer
(src_idxs, tgt_idxs, vec_conns, byobj_conns, mode, sysdata)[source]¶ Bases:
object
An object that performs data transfer between a source vector and a target vector.
Args: src_idxs : array
Indices of the source variables in the source vector.
tgt_idxs : array
Indices of the target variables in the target vector.
vec_conns : dict
Mapping of ‘pass by vector’ variables to the source variables that they are connected to.
byobj_conns : dict
Mapping of ‘pass by object’ variables to the source variables that they are connected to.
sysdata : SysData object
The SysData object for the Group that will contain this DataTransfer object.
mode : str
Either ‘fwd’ or ‘rev’, indicating a forward or reverse scatter.
-
transfer
(srcvec, tgtvec, mode='fwd', deriv=False)[source]¶ Performs data transfer between a source vector and a target vector.
Args: srcvec : VecWrapper
Variables that are the source of the transfer in fwd mode and the destination of the transfer in rev mode.
tgtvec : VecWrapper
Variables that are the destination of the transfer in fwd mode and the source of the transfer in rev mode.
mode : ‘fwd’ or ‘rev’, optional
Direction of the data transfer, source to target (‘fwd’, the default) or target to source (‘rev’).
deriv : bool, optional
If True, this is a derivative data transfer, so no pass_by_obj variables will be transferred.
-