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

Create functions in the local grid to get the index space of cells on periodic or free boundaries #762

Open
JStewart28 opened this issue Jul 30, 2024 · 2 comments · May be fixed by #765
Open

Comments

@JStewart28
Copy link

Create functions similar to the boundaryIndexSpace function in the local grid to:

  1. If the i/j/k offset is on a free boundary, return the index space that is within halo_width of the boundary.
  2. If the i/j/k offset is on a periodic boundary, return the periodic index space.
  3. Otherwise, return an empty index space

This makes access to the boundary cells more straightforward. For example, after performing a periodic halo exchange each process calls this function to iterate over cells received across a periodic boundary for coordinate correction. For free boundaries, it calls this function to iterate over the cells for extrapolation of position from cells in the mesh.

@streeve
Copy link
Member

streeve commented Jul 31, 2024

I want to clarify a few things first - we have boundaryIndexSpace for both Own and Ghost - not sure if you need the owned boundary or the ghosted boundary cells. There is no current support for indices only on periodic boundaries. If I understand correctly:

  1. This is already possible with boundaryIndexSpace?
  2. This could be periodicIndexSpace (necessary to distinguish since many cases explicitly don't want to apply BC on a periodic boundary and this would otherwise be an empty boundary index space). This should build on the sharedIndexSpace concept, but exclude those not on the system boundary
  3. Make sense

Note these will all be collections of index spaces since each one (each relative offset) needs to be contiguous in order to use in multidimensional range policies. We could support that better as well (all boundaries, all periodic boundary spaces, etc.)

@JStewart28
Copy link
Author

  1. I had to take another look at our code to remind myself what we are doing. Currently, boundaryIndexSpace returns the boundary index space (or an empty index space if off_ijk is not on a boundary) only if the boundary is free. This is fine.

  2. Yes, creating a periodicIndexSpace function that behaves oppositely to boundaryIndexSpace is what we are looking for. It would return an empty space if the boundary in the off_ijk direction is not periodic, otherwise it would return the index space of however large the ghosted region along the boundary is.

@streeve streeve linked a pull request Aug 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants