data_transfer.py

Class definition for the DataTransfer object.

class openmdao.core.data_transfer.DataTransfer(src_idxs, tgt_idxs, vec_conns, byobj_conns)[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.

transfer(srcvec, tgtvec, mode='fwd', deriv=False)[source]

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.

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 scatter, so byobjs should not be transferred.