box_gc_for_fine_neighbor Subroutine

private subroutine box_gc_for_fine_neighbor(box, nb, di, nc, iv, gc)

Get ghost cells for a fine neighbor

Arguments

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

Direction of fine neighbor

integer, intent(in) :: di(1)

Index offset of fine neighbor

integer, intent(in) :: nc
integer, intent(in) :: iv
real(kind=dp), intent(out) :: gc(1)

Called by

proc~~box_gc_for_fine_neighbor~2~~CalledByGraph proc~box_gc_for_fine_neighbor~2 box_gc_for_fine_neighbor proc~buffer_for_fine_nb~2 buffer_for_fine_nb proc~buffer_for_fine_nb~2->proc~box_gc_for_fine_neighbor~2 proc~fill_refinement_bnd~2 fill_refinement_bnd proc~fill_refinement_bnd~2->proc~box_gc_for_fine_neighbor~2 proc~buffer_refinement_boundaries~2 buffer_refinement_boundaries proc~buffer_refinement_boundaries~2->proc~buffer_for_fine_nb~2 proc~set_ghost_cells~2 set_ghost_cells proc~set_ghost_cells~2->proc~fill_refinement_bnd~2 proc~mg_fill_ghost_cells_lvl~2 mg_fill_ghost_cells_lvl proc~mg_fill_ghost_cells_lvl~2->proc~buffer_refinement_boundaries~2 proc~mg_fill_ghost_cells_lvl~2->proc~set_ghost_cells~2 proc~mg_ghost_cell_buffer_size~2 mg_ghost_cell_buffer_size proc~mg_ghost_cell_buffer_size~2->proc~buffer_refinement_boundaries~2 proc~mg_ghost_cell_buffer_size~2->proc~set_ghost_cells~2 proc~mg_allocate_storage~2 mg_allocate_storage proc~mg_allocate_storage~2->proc~mg_ghost_cell_buffer_size~2 proc~mg_fas_fmg~2 mg_fas_fmg proc~mg_fas_fmg~2->proc~mg_fill_ghost_cells_lvl~2 proc~mg_fas_vcycle~2 mg_fas_vcycle proc~mg_fas_fmg~2->proc~mg_fas_vcycle~2 proc~update_coarse~2 update_coarse proc~mg_fas_fmg~2->proc~update_coarse~2 proc~mg_fas_vcycle~2->proc~mg_fill_ghost_cells_lvl~2 proc~smooth_boxes~2 smooth_boxes proc~mg_fas_vcycle~2->proc~smooth_boxes~2 proc~mg_fas_vcycle~2->proc~update_coarse~2 proc~mg_fill_ghost_cells~2 mg_fill_ghost_cells proc~mg_fill_ghost_cells~2->proc~mg_fill_ghost_cells_lvl~2 proc~smooth_boxes~2->proc~mg_fill_ghost_cells_lvl~2 proc~update_coarse~2->proc~mg_fill_ghost_cells_lvl~2 proc~diffusion_solve_acoeff~2 diffusion_solve_acoeff proc~diffusion_solve_acoeff~2->proc~mg_fas_fmg~2 proc~diffusion_solve_acoeff~2->proc~mg_fas_vcycle~2 proc~diffusion_solve_vcoeff~2 diffusion_solve_vcoeff proc~diffusion_solve_vcoeff~2->proc~mg_fas_fmg~2 proc~diffusion_solve_vcoeff~2->proc~mg_fas_vcycle~2 proc~diffusion_solve~2 diffusion_solve proc~diffusion_solve~2->proc~mg_fas_fmg~2 proc~diffusion_solve~2->proc~mg_fas_vcycle~2

Source Code

  subroutine box_gc_for_fine_neighbor(box, nb, di, nc, iv, gc)
    type(mg_box_t), intent(in) :: box
    integer, intent(in)     :: nb
    !< Direction of fine neighbor
    integer, intent(in)     :: di(1)
    !< Index offset of fine neighbor
    integer, intent(in)     :: nc, iv
    real(dp), intent(out)   :: gc(1)
    real(dp)                :: tmp
    integer                 :: hnc

    hnc = nc/2

    ! First fill a temporary array with data next to the fine grid
    select case (nb)
    case (mg_neighb_lowx)
       tmp = box%cc(1, iv)
    case (mg_neighb_highx)
       tmp = box%cc(nc, iv)
    case default
       error stop
    end select

    ! Now interpolate the coarse grid data to obtain values 'straight' next to
    ! the fine grid points
    gc = tmp
  end subroutine box_gc_for_fine_neighbor