

def apply_linear(self, params, unknowns, dparams, dunknowns, dresids, mode):
    "\n        Multiplies incoming vector by the Jacobian (fwd mode) or the\n        transpose Jacobian (rev mode).\n\n        Args\n        ----\n        params : `VecWrapper`\n            `VecWrapper` containing parameters. (p)\n\n        unknowns : `VecWrapper`\n            `VecWrapper` containing outputs and states. (u)\n\n        dparams : `VecWrapper`\n            `VecWrapper` containing either the incoming vector in forward mode\n            or the outgoing result in reverse mode. (dp)\n\n        dunknowns : `VecWrapper`\n            In forward mode, this `VecWrapper` contains the incoming vector for\n            the states. In reverse mode, it contains the outgoing vector for\n            the states. (du)\n\n        dresids : `VecWrapper`\n            `VecWrapper` containing either the outgoing result in forward mode\n            or the incoming vector in reverse mode. (dr)\n\n        mode : string\n            Derivative mode, can be 'fwd' or 'rev'.\n        "
    if (mode == 'fwd'):
        dresids[self.out_name] += dparams[self.param_name]
    elif (mode == 'rev'):
        dparams[self.param_name] += dresids[self.out_name]

dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/components/unit_comp.py UnitComp.apply_linear/original