Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce Ghost Depth Constraints on Block Size #109

Closed
mabruzzo opened this issue May 26, 2021 · 0 comments · Fixed by #134
Closed

Enforce Ghost Depth Constraints on Block Size #109

mabruzzo opened this issue May 26, 2021 · 0 comments · Fixed by #134
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mabruzzo
Copy link
Contributor

Currently, Cello/Enzo-E does not enforce any constraints on the block size based on the ghost depth. This can cause the simulation to silently break. An explicit check should be added to cause the simulation to fail at startup with an informative error message.

This should be easy to address and would be a great first issue!

In case this is somebody's first issue, I wanted to briefly outline how I I would approach this (but feel free to do something different). The easiest way to accomplish this is to add ~2 ASSERT or ERROR statements to Config::read_mesh_ in src/Cello/parameters_Config.cpp. Here are a couple of notes:

  • The dimensions of the active zone on each block need to be computed. They are given by mesh_root_blocks[i]/mesh_root_size[i]. Note that i=0, i=1, and i=2 correspond to the x, y, and z axes, respectively.
  • When AMR is being used (mesh_max_level > 0), you need to confirm that the dimensions of the active zone on each block are at least double the size of the ghost depth.
  • For unigrid simulations (mesh_max_level = 0), the dimensions of the active zone on each block must be at least as large as the ghost depth.
  • Some care needs to be taken to properly handle 1D and 2D simulations (the dimensionality is stored in mesh_root_rank). In these cases, the number of cells along the extra dimensions are set to 1

There are a couple of optional, additional checks that might also be nice to have. These are not necessary (other error handling will catch these problems eventually), but it might be nice to provide more explicit error messages for new users.

  • the dimensions of the active zone on each block is should each be even when AMR is being used (they can be odd for unigrid simulations). Again, care needs to be taken for handling 1D/2D simulations
  • The parameter "Adapt:min_level" (stored in the mesh_min_level variable) should be less than or equal to zero.
@mabruzzo mabruzzo added enhancement New feature or request good first issue Good for newcomers labels May 26, 2021
@mabruzzo mabruzzo linked a pull request Jan 23, 2022 that will close this issue
mabruzzo added a commit that referenced this issue Jan 25, 2022
Enforce Ghost Depth Constraints on Block Size #109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant