Made function for assemblying the local stiffness matrix.