Save before implementing gradient for penalty. wnnlp and Bonmin functional