diff --git a/PGLW/main/boxmesh.py b/PGLW/main/boxmesh.py index 223a084981c8cd9106a7bd993227ce35771ca436..d8ca04400812ba06173e0e07087d63c5e757850d 100644 --- a/PGLW/main/boxmesh.py +++ b/PGLW/main/boxmesh.py @@ -55,8 +55,10 @@ class BoxMesh(Domain): Block size, by default 32 filename : str, optional Name of grid, by default 'grid.x3dunf' - staggered : bool, optional - For cyclic BC remapping, by default False + staggered : bool or int, optional + If True, cyclic BC remapping is used with 1 block shift. + Default False means no shift. If set to non-zero integer + then a shift size of this number of blocks is applied. printscreen: Print final grid parameters to screen similar to boxf90 """ @@ -189,7 +191,7 @@ class BoxMesh(Domain): self.add_blocks(b_i) # Add shift (assume z-direction is ground and top) - if self.staggered: + if int(self.staggered) != 0: if nbj > 96: print( "ERROR: the number of blocks in y-dir is", @@ -200,9 +202,7 @@ class BoxMesh(Domain): for k in range(nbk): for j in range(nbj): in_ind = nbj + 1 - j - 1 - out_ind = nbj - j - 1 - if out_ind == 0: - out_ind = nbj + out_ind = ((nbj - j - int(self.staggered) - 1) % nbj) + 1 in_ind = 501 + in_ind out_ind = 501 + out_ind in_name = str(k) + "_" + str(j) + "_0"