When going into assembleResidual with r\neq 0, you get another behavior than "just write the residual into r." I think r should be set zero at the beginning of assembleResidual.
When going into assembleResidual with r\neq 0, you get another behavior than "just write the residual into r." I think r should be set zero at the beginning of assembleResidual.