Skip to content

Commit

Permalink
Fix a bug in AmrMesh::ChopGrids (#3460)
Browse files Browse the repository at this point in the history
Fix a corner case for AmrMesh::ChopGrids when there is only one cell in
one dimension.

Close #3459
  • Loading branch information
WeiqunZhang authored Jul 31, 2023
1 parent 98d22d2 commit cf8d9f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Src/AmrCore/AMReX_AmrMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@ AmrMesh::ChopGrids (int lev, BoxArray& ba, int target_size) const
int idim = chunk_dir[idx].second;
if (refine_grid_layout_dims[idim]) {
int new_chunk_size = chunk[idim] / 2;
if (new_chunk_size%blocking_factor[lev][idim] == 0) {
if (new_chunk_size != 0 &&
new_chunk_size%blocking_factor[lev][idim] == 0)
{
chunk[idim] = new_chunk_size;
ba.maxSize(chunk);
break;
Expand Down

0 comments on commit cf8d9f8

Please sign in to comment.