aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXUtil.cpp
diff options
context:
space:
mode:
authorGravatar David Grote <grote1@llnl.gov> 2023-07-10 09:22:46 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-10 09:22:46 -0700
commit4e032fcdaeb1d89539c8b1da64192a3a6871408a (patch)
treef61682bb886addccef74c8966b82735d0ff7bb5d /Source/Utils/WarpXUtil.cpp
parentfb99946b3c1b667e5300e1ae79bcabe37083a6ea (diff)
downloadWarpX-4e032fcdaeb1d89539c8b1da64192a3a6871408a.tar.gz
WarpX-4e032fcdaeb1d89539c8b1da64192a3a6871408a.tar.zst
WarpX-4e032fcdaeb1d89539c8b1da64192a3a6871408a.zip
Fix `max_grid_size` for RZ PSATD (#4073)
Diffstat (limited to 'Source/Utils/WarpXUtil.cpp')
-rw-r--r--Source/Utils/WarpXUtil.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp
index 7e486eb98..c65603f4d 100644
--- a/Source/Utils/WarpXUtil.cpp
+++ b/Source/Utils/WarpXUtil.cpp
@@ -322,14 +322,15 @@ void CheckGriddingForRZSpectral ()
Vector<int> max_grid_size_x(max_level+1);
// Set the radial block size to be the power of 2 greater than or equal to
- // the number of grid cells. The blocking_factor must be a power of 2
- // and the max_grid_size should be a multiple of the blocking_factor.
+ // the number of grid cells. The blocking factor must be a power of 2
+ // and the max_grid_size must be a multiple of the blocking_factor unless
+ // it is less than the blocking factor.
int k = 1;
while (k < n_cell[0]) {
k *= 2;
}
blocking_factor_x[0] = k;
- max_grid_size_x[0] = k;
+ max_grid_size_x[0] = n_cell[0];
for (int lev=1 ; lev <= max_level ; lev++) {
// For this to be correct, this needs to read in any user specified refinement ratios.