Checks if a vector or vector field is of a particular dimension.