Skip to content

Commit cf8d9f8

Browse files
authored
Fix a bug in AmrMesh::ChopGrids (#3460)
Fix a corner case for AmrMesh::ChopGrids when there is only one cell in one dimension. Close #3459
1 parent 98d22d2 commit cf8d9f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Src/AmrCore/AMReX_AmrMesh.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,9 @@ AmrMesh::ChopGrids (int lev, BoxArray& ba, int target_size) const
457457
int idim = chunk_dir[idx].second;
458458
if (refine_grid_layout_dims[idim]) {
459459
int new_chunk_size = chunk[idim] / 2;
460-
if (new_chunk_size%blocking_factor[lev][idim] == 0) {
460+
if (new_chunk_size != 0 &&
461+
new_chunk_size%blocking_factor[lev][idim] == 0)
462+
{
461463
chunk[idim] = new_chunk_size;
462464
ba.maxSize(chunk);
463465
break;

0 commit comments

Comments
 (0)