sides_rb Subroutine

private subroutine sides_rb(box, nc, iv, nb, gc)

Fill ghost cells near refinement boundaries which preserves diffusive fluxes.

Arguments

Type IntentOptional Attributes Name
type(mg_box_t), intent(inout) :: box
integer, intent(in) :: nc
integer, intent(in) :: iv
integer, intent(in) :: nb

Ghost cell direction

real(kind=dp), intent(in) :: gc(nc)

Interpolated coarse grid ghost cell data (but not yet in the nb direction)


Called by

proc~~sides_rb~~CalledByGraph proc~sides_rb sides_rb proc~fill_refinement_bnd fill_refinement_bnd proc~fill_refinement_bnd->proc~sides_rb proc~set_ghost_cells set_ghost_cells proc~set_ghost_cells->proc~fill_refinement_bnd proc~mg_fill_ghost_cells_lvl mg_fill_ghost_cells_lvl proc~mg_fill_ghost_cells_lvl->proc~set_ghost_cells proc~mg_ghost_cell_buffer_size mg_ghost_cell_buffer_size proc~mg_ghost_cell_buffer_size->proc~set_ghost_cells proc~mg_allocate_storage mg_allocate_storage proc~mg_allocate_storage->proc~mg_ghost_cell_buffer_size proc~mg_fas_fmg mg_fas_fmg proc~mg_fas_fmg->proc~mg_fill_ghost_cells_lvl proc~mg_fas_vcycle mg_fas_vcycle proc~mg_fas_fmg->proc~mg_fas_vcycle proc~update_coarse update_coarse proc~mg_fas_fmg->proc~update_coarse proc~mg_fas_vcycle->proc~mg_fill_ghost_cells_lvl proc~smooth_boxes smooth_boxes proc~mg_fas_vcycle->proc~smooth_boxes proc~mg_fas_vcycle->proc~update_coarse proc~mg_fill_ghost_cells mg_fill_ghost_cells proc~mg_fill_ghost_cells->proc~mg_fill_ghost_cells_lvl proc~smooth_boxes->proc~mg_fill_ghost_cells_lvl proc~update_coarse->proc~mg_fill_ghost_cells_lvl proc~diffusion_solve diffusion_solve proc~diffusion_solve->proc~mg_fas_fmg proc~diffusion_solve->proc~mg_fas_vcycle proc~diffusion_solve_acoeff diffusion_solve_acoeff proc~diffusion_solve_acoeff->proc~mg_fas_fmg proc~diffusion_solve_acoeff->proc~mg_fas_vcycle proc~diffusion_solve_vcoeff diffusion_solve_vcoeff proc~diffusion_solve_vcoeff->proc~mg_fas_fmg proc~diffusion_solve_vcoeff->proc~mg_fas_vcycle

Source Code

  subroutine sides_rb(box, nc, iv, nb, gc)
    type(mg_box_t), intent(inout) :: box
    integer, intent(in)       :: nc
    integer, intent(in)       :: iv
    integer, intent(in)       :: nb
    !< Ghost cell direction
    !> Interpolated coarse grid ghost cell data (but not yet in the nb direction)
    real(dp), intent(in)      :: gc(nc)
    integer                   :: di, dj
    integer                   :: i, j, ix, dix

    if (mg_neighb_low(nb)) then
       ix = 1
       dix = 1
    else
       ix = nc
       dix = -1
    end if

    select case (mg_neighb_dim(nb))
    case (1)
       i = ix
       di = dix

       do j = 1, nc
          dj = -1 + 2 * iand(j, 1)
          box%cc(i-di, j, iv) = 0.5_dp * gc(j) + 0.75_dp * box%cc(i, j,&
              iv) - 0.25_dp * box%cc(i+di, j, iv)
       end do
    case (2)
       j = ix
       dj = dix
       do i = 1, nc
          di = -1 + 2 * iand(i, 1)
          box%cc(i, j-dj, iv) = 0.5_dp * gc(i) + 0.75_dp * box%cc(i, j,&
              iv) - 0.25_dp * box%cc(i, j+dj, iv)
       end do
    end select

  end subroutine sides_rb