Added gradient of source function in parallel version