dimension-dependent polynomials for SPR

we have to omit the Z column for 2D meshes
or the matrix is always ill-conditioned.
this change should allow SPR to run
on 1st and 2nd order meshes in 2D and 3D
(the 2D meshes must have a zero Z component).