Added function for assembling the loading vector.