Skip to content

Commit

Permalink
Fix B-grid on odd sized subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
Sbte committed Jan 10, 2020
1 parent b868d95 commit 922a9b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/HYMLS_CartesianPartitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ int CartesianPartitioner::GetGroups(int sd, Teuchos::Array<hymls_gidx> &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)
Expand Down
4 changes: 2 additions & 2 deletions src/HYMLS_MainUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ Teuchos::RCP<Epetra_Vector> 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
Expand Down

0 comments on commit 922a9b8

Please sign in to comment.