matrix.py#

Define the base Matrix class.

class openmdao.matrices.matrix.Matrix(comm, is_internal)[source]

Bases: object

Base matrix class.

This class is used for global Jacobians.

Parameters:
commMPI.Comm or <FakeComm>

Communicator of the top-level system that owns the <Jacobian>.

is_internalbool

If True, this is the int_mtx of an AssembledJacobian.

Attributes:
_commMPI.Comm or <FakeComm>

Communicator of the top-level system that owns the <Jacobian>.

_matrixobject

implementation-specific representation of the actual matrix.

_submatsdict

dictionary of sub-jacobian data keyed by (out_name, in_name).

_metadatadict

implementation-specific data for the sub-jacobians.

__init__(comm, is_internal)[source]

Initialize all attributes.

set_complex_step_mode(active)[source]

Turn on or off complex stepping mode.

When turned on, the value in each subjac is cast as complex, and when turned off, they are returned to real values.

Parameters:
activebool

Complex mode flag; set to True prior to commencing complex step.