Boundary handling#

Boundary handling for the ghosts cells (discretization.kgrid.ElemSpaceDiscr) and nodes (discretization.kgrid.NodeSpaceDiscr) are handled in boundary.py.

Cell boundarys are handled by the function inputs.boundary.set_explicit_boundary_data(). The bondary conditions are given in the initial user data file, inputs.user_data.UserDataInit.bdry_type.

For ghost cells in directions without gravity, the ghost cells are padded by the np.pad() function.

For ghost cells in direction with gravity, the update follows figure 1, where the blue and red sets of nlast, nimage, and nsource are used together in an update step depending on the values of offset and direction.

../_images/boundary_handling.svg

Fig. 1 Boundary handling of gravity axis.#

Todos#

  • get_ghost_padding

  • set_ghost_cells

  • set_ghost_nodes