def METHOD_NAME(self, m, dp, result):
    """Computes the Jacobian adjoint action of c(m) in direction dp.
    Stores the result in result.
    """
    if isinstance(m, list):
        assert len(m) == 1
        m = m[0]
    self.update_control(m)
    asm = backend.assemble(
        dp * ufl.replace(self.dform, {self.trial: self.test})
    )
    if isinstance(result, backend.Function):
        if backend.__name__ in ["dolfin", "fenics"]:
            result.vector().zero()
            result.vector().axpy(1.0, asm)
        else:
            result.assign(asm)
    else:
        raise NotImplementedError("Do I need to untangle all controls?")