Hi,
I was trying to create my own AMR grid for some testing purposes. I have frequently run into the following problem. As an example, I create an AMR grid with two levels: (a) Level 1 -> One large cube of unit length (e.g. 1pc) (b) Level 2 -> this large cube has been subdivided into 8 smaller cubes similar to an octree. Hyperion complains while running the fortran binaries, saying that the walls are not aligned.
############################################################
An example:
level = amr.add_level()
grid = level.add_grid()
grid.xmin, grid.xmax, grid.ymin, grid.ymax, grid.zmin, grid.zmax = 0, pc, 0, pc, 0, pc #Level 1
grid.nx,...,nz = 1,1,1
level = amr.add_level()
grid = level.add_grid()
grid.xmin, grid.xmax, grid.ymin, grid.ymax, grid.zmin, grid.zmax = 0, pc/2, 0, pc/2, 0, pc/2 #Level 2
grid.nx,...,nz = 1,1,1
...
grid.xmin, grid.xmax, grid.ymin, grid.ymax, grid.zmin, grid.zmax = pc/2, pc, pc/2, pc, pc/2, pc #Level 2
grid.nx,...,nz = 1,1,1
###########################################################
The offending line has been highlighted in bold and hyperion says that grid 2 is not aligned with parent cell in level 1 in the xdirection
After examining the source code, I think I have identified the issue (grid_geometry_amr.f90, line 258):
if(.not.aligned(grid%xmin, grid_ref%xmin, grid_ref%width(1))) then
Is there a reason why only the xmin boundaries are checked for alignment? Shouldn't it be a check for xmin OR xmax?
Thanks!
Hi,
I was trying to create my own AMR grid for some testing purposes. I have frequently run into the following problem. As an example, I create an AMR grid with two levels: (a) Level 1 -> One large cube of unit length (e.g. 1pc) (b) Level 2 -> this large cube has been subdivided into 8 smaller cubes similar to an octree. Hyperion complains while running the fortran binaries, saying that the walls are not aligned.
############################################################
An example:
level = amr.add_level()
grid = level.add_grid()
grid.xmin, grid.xmax, grid.ymin, grid.ymax, grid.zmin, grid.zmax = 0, pc, 0, pc, 0, pc #Level 1
grid.nx,...,nz = 1,1,1
level = amr.add_level()
grid = level.add_grid()
grid.xmin, grid.xmax, grid.ymin, grid.ymax, grid.zmin, grid.zmax = 0, pc/2, 0, pc/2, 0, pc/2 #Level 2
grid.nx,...,nz = 1,1,1
...
grid.xmin, grid.xmax, grid.ymin, grid.ymax, grid.zmin, grid.zmax = pc/2, pc, pc/2, pc, pc/2, pc #Level 2
grid.nx,...,nz = 1,1,1
###########################################################
The offending line has been highlighted in bold and hyperion says that grid 2 is not aligned with parent cell in level 1 in the xdirection
After examining the source code, I think I have identified the issue (grid_geometry_amr.f90, line 258):
Is there a reason why only the xmin boundaries are checked for alignment? Shouldn't it be a check for xmin OR xmax?
Thanks!