def gradfunc(self, x, f, g, *args, **kwargs):

        fail = 1
        df = []
        dg = []

        try:
            J = self.workflow.calc_gradient(self.inputs, self.objs + self.cons)

            nobj = len(self.objs)
            df = J[0:nobj, :]
            dg = J[nobj:, :]

            fail = 0

        except Exception as msg:

            # Exceptions seem to be swallowed by the C code, so this
            # should give the user more info than the dreaded "segfault"
            print "Exception: %s" % str(msg)
            print 70*"="
            import traceback
            traceback.print_exc()
            print 70*"="

        return df, dg, fail
Function that evaluates and returns the gradient of the objective
dataset/ETHPy150Open OpenMDAO-Plugins/pyopt_driver/src/pyopt_driver/pyopt_driver.py/pyOptDriver.gradfunc