petsc_transfer.py

Define the PETSc Transfer class.

class openmdao.vectors.petsc_transfer.PETScTransfer(in_vec, out_vec, in_inds, out_inds, comm)[source]

Bases: openmdao.vectors.default_transfer.DefaultTransfer

PETSc Transfer implementation for running in parallel.

__init__(in_vec, out_vec, in_inds, out_inds, comm)

Initialize all attributes.

Parameters:
in_vec : <Vector>

pointer to the input vector.

out_vec : <Vector>

pointer to the output vector.

in_inds : int ndarray

input indices for the transfer.

out_inds : int ndarray

output indices for the transfer.

comm : MPI.Comm or <FakeComm>

communicator of the system that owns this transfer.

multi_transfer(in_vec, out_vec, mode='fwd')[source]

Perform transfer.

Parameters:
in_vec : <Vector>

pointer to the input vector.

out_vec : <Vector>

pointer to the output vector.

mode : str

‘fwd’ or ‘rev’.

transfer(in_vec, out_vec, mode='fwd')[source]

Perform transfer.

Parameters:
in_vec : <Vector>

pointer to the input vector.

out_vec : <Vector>

pointer to the output vector.

mode : str

‘fwd’ or ‘rev’.