# approximation_scheme.py

# approximation_scheme.py¶

Base class used to define the interface for derivative approximation schemes.

classopenmdao.approximation_schemes.approximation_scheme.ApproximationScheme[source]Bases:

`object`

Base class used to define the interface for derivative approximation schemes.

- Attributes

_approx_groupslistA list of approximation tuples ordered into groups of ‘of’s matching the same ‘wrt’.

_colored_approx_groups: listA list containing info for all colored approximation groups.

_approx_groups_cached_under_csboolFlag indicates whether approx_groups was generated under complex step from higher in the model hieararchy.

_wrt_metadictA dict that maps wrt name to its fd/cs metadata.

_progress_outNone or file-like objectAttribute to output the progress of check_totals

_during_sparsity_compboolIf True, we’re doing a sparsity computation and uncolored approxs need to be restricted to only colored columns.

_jac_scattertupleData needed to scatter values from results array to a total jacobian column.

- __init__()[source]
Initialize the ApproximationScheme.

- add_approximation(
abs_key,system,kwargs)[source]Use this approximation scheme to approximate the derivative d(of)/d(wrt).

- Parameters

abs_keytuple(str,str)Absolute name pairing of (of, wrt) for the derivative.

systemSystemContaining System.

kwargsdictAdditional keyword arguments, to be interpreted by sub-classes.

- compute_approximations(
system,jac=None)[source]Execute the system to compute the approximate sub-Jacobians.

- Parameters

systemSystemSystem on which the execution is run.

jacNone or dict-likeIf None, update system with the approximated sub-Jacobians. Otherwise, store the approximations in the given dict-like object.