tlm_adjoint.tangent_linear

Module Contents

class tlm_adjoint.tangent_linear.TangentLinearMap(M, dM)

Defines a map from forward variables to associated tangent-linear variables.

The map is used via e.g.

tau_x = tlm_map[x]

where x is a forward variable.

  • If x defines a component of the control, then tau_x is a variable defining the associated component of the direction.

  • If x does not define a component of the control and is not ‘static’, then tau_x is a tangent-linear variable. A new variable is instantiated if needed.

  • Otherwise tau_x is None, indicating that the tangent-linear variable is zero.

Containment can be tested

if x in tlm_map:
    [...]

and returns True if x defines a component of the control, or a tangent-linear variable associated with x has been instantiated.

Parameters:
  • M – A variable or Sequence of variables defining the control.

  • dM – A variable or Sequence of variables defining the derivative direction. The tangent-linear computes directional derivatives with respect to the control defined by M and with direction defined by dM.

property id

A unique int ID associated with this TangentLinearMap.

property M

A Sequence of variables defining the control.

property dM

A Sequence of variables defining the derivative direction.