Skip to content

Commit fab6489

Browse files
committed
Add periodic index space to local grid example
1 parent c64f42d commit fab6489

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

example/grid_tutorial/06_local_grid/local_grid_example.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,23 @@ void localGridExample()
223223
<< boundary_cell_space.size() << "\n"
224224
<< std::endl;
225225

226+
/*
227+
The directions which are shared along periodic edges of the simulation
228+
domain constitute the periodic index spaces. These are the complement of
229+
the boundary index space (periodic vs open system boundaries) and are a
230+
subset of the shared index spaces (any periodic boundary is shared with
231+
another rank, even if it is a self neighbor).
232+
*/
233+
auto ghost_periodic_cell_space = local_grid->periodicIndexSpace(
234+
Cabana::Grid::Ghost(), Cabana::Grid::Cell(), -1, 0, 1 );
235+
std::cout << "Periodic index space (Ghost, Cell):\nMin: ";
236+
for ( int d = 0; d < 3; ++d )
237+
std::cout << ghost_periodic_cell_space.min( d ) << " ";
238+
std::cout << "\nMax: ";
239+
for ( int d = 0; d < 3; ++d )
240+
std::cout << ghost_periodic_cell_space.max( d ) << " ";
241+
std::cout << "\n" << std::endl;
242+
226243
/*
227244
We now create a partially non-periodic global grid to highlight some
228245
details of the local grid boundary index spaces.

0 commit comments

Comments
 (0)