Skip to content

Commit

Permalink
Add periodic index space to local grid example
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Oct 9, 2024
1 parent c64f42d commit fab6489
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions example/grid_tutorial/06_local_grid/local_grid_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,23 @@ void localGridExample()
<< boundary_cell_space.size() << "\n"
<< std::endl;

/*
The directions which are shared along periodic edges of the simulation
domain constitute the periodic index spaces. These are the complement of
the boundary index space (periodic vs open system boundaries) and are a
subset of the shared index spaces (any periodic boundary is shared with
another rank, even if it is a self neighbor).
*/
auto ghost_periodic_cell_space = local_grid->periodicIndexSpace(
Cabana::Grid::Ghost(), Cabana::Grid::Cell(), -1, 0, 1 );
std::cout << "Periodic index space (Ghost, Cell):\nMin: ";
for ( int d = 0; d < 3; ++d )
std::cout << ghost_periodic_cell_space.min( d ) << " ";
std::cout << "\nMax: ";
for ( int d = 0; d < 3; ++d )
std::cout << ghost_periodic_cell_space.max( d ) << " ";
std::cout << "\n" << std::endl;

/*
We now create a partially non-periodic global grid to highlight some
details of the local grid boundary index spaces.
Expand Down

0 comments on commit fab6489

Please sign in to comment.