def user_defined_jacobian(self, con, params, J):
        """ Inserts the user-defined Jacobian into the full Jacobian rather
        than doing any calculation. """

        if not isinstance(J, dict):
            msg = 'Only PyOptSparse supports custom Jacobians'
            raise RuntimeError(msg)

        jacs = self.custom_jacs[con]()
        for param in params:

            if param in jacs:
                J[con][param] = jacs[param]

            # Assume zero if user did not explicitly define.
            else:
                psize = self._system.get_size(param)
                csize = self._system.get_size(con)
                J[con][param] = np.zeros((csize, psize))
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/linearsolver.py/LinearSolver.user_defined_jacobian/original