diff --git a/src/HYMLS_CartesianPartitioner.cpp b/src/HYMLS_CartesianPartitioner.cpp index e25eca20..398817ec 100644 --- a/src/HYMLS_CartesianPartitioner.cpp +++ b/src/HYMLS_CartesianPartitioner.cpp @@ -267,6 +267,9 @@ int CartesianPartitioner::GetGroups(int sd, Teuchos::Array &interior int ymax = std::min(ny_ - ypos - 1, sy_ - 1); int zmax = std::min(nz_ - zpos - 1, sz_ - 1); + if (xmax == 0 || ymax == 0 || (zmax == 0 && nz_ > 1)) + Tools::Error("Can't have a subdomain of size 1", __FILE__, __LINE__); + int pvar = -1; for (int i = 0; i < dof_; i++) if (variableType_[i] == 3) diff --git a/src/HYMLS_MainUtils.cpp b/src/HYMLS_MainUtils.cpp index 475f1117..a2334ea2 100755 --- a/src/HYMLS_MainUtils.cpp +++ b/src/HYMLS_MainUtils.cpp @@ -225,9 +225,9 @@ Teuchos::RCP create_testvector( { hymls_gidx grid = matrix.GRID64(i); if (grid % dof == 0) - (*testvector)[i] = ((grid / dof) % 2) * 2 - 1; + (*testvector)[i] = (((grid / dof) % nx) % 2) * 2 - 1; else if (grid % dof == 1) - (*testvector)[i] = ((grid / dof / nx) % 2) * 2 - 1; + (*testvector)[i] = (((grid / dof / nx) % ny) % 2) * 2 - 1; else if (dim > 2 && grid % dof == 2 && eqn == "Stokes-B") (*testvector)[i] = ((grid / dof / nx / ny) % 2) * 2 - 1; else