StructuredGridFactory: index[j] is only defined for j < dim