We need to zero the output matrix before assembling with createMatrixFromFunction() and similar calls. Otherwise, if we call this function twice, the resulting matrix is broken.
createMatrixFromFunction()