dictionary_jacobian.py#
Define the DictionaryJacobian class.
- class openmdao.jacobians.dictionary_jacobian.DictionaryJacobian(system)[source]
Bases:
JacobianA Jacobian that stores nonzero subjacobians in a dictionary.
- Parameters:
- systemSystem
Parent system to this jacobian.
- Attributes:
- _has_childrenbool
True if the system has children, False otherwise.
Methods
create_subjac(abs_key, meta, dtype)Create a subjacobian.
get_metadata(key)Get metadata for the given key.
is_relevant(key)Return whether there is a relevant subjac for the given promoted or relative name pair.
items()Yield name pair and value of sub-Jacobian.
keys()Yield next name pair of sub-Jacobian.
set_col(system, icol, column)Set a column of the jacobian.
set_csc_jac(system, jac)Assign a CSC jacobian to this jacobian.
set_dense_jac(system, jac)Assign a dense jacobian to this jacobian.
todense()Return a dense version of the full jacobian.
- __init__(system)[source]
Initialize all attributes.
- class openmdao.jacobians.dictionary_jacobian.ExplicitDictionaryJacobian(system)[source]
Bases:
JacobianA DictionaryJacobian that is a collection of sub-Jacobians.
It is intended to be used with ExplicitComponents only because dr/do is assumed to be -I.
- Parameters:
- systemSystem
System that is updating this jacobian. Must be an ExplicitComponent.
Methods
create_subjac(abs_key, meta, dtype)Create a subjacobian.
get_metadata(key)Get metadata for the given key.
is_relevant(key)Return whether there is a relevant subjac for the given promoted or relative name pair.
items()Yield name pair and value of sub-Jacobian.
keys()Yield next name pair of sub-Jacobian.
set_col(system, icol, column)Set a column of the jacobian.
set_csc_jac(system, jac)Assign a CSC jacobian to this jacobian.
set_dense_jac(system, jac)Assign a dense jacobian to this jacobian.
todense()Return a dense version of the jacobian.
- __init__(system)[source]
Initialize all attributes.
- todense()[source]
Return a dense version of the jacobian.
- Returns:
- ndarray
Dense version of the jacobian.