fill_refinement_bnd Subroutine

private subroutine fill_refinement_bnd(mg, id, nb, nc, iv, dry_run)

Arguments

Type IntentOptional Attributes Name
type(mg_t), intent(inout) :: mg
integer, intent(in) :: id
integer, intent(in) :: nb
integer, intent(in) :: nc
integer, intent(in) :: iv
logical, intent(in) :: dry_run

Calls

proc~~fill_refinement_bnd~3~~CallsGraph proc~fill_refinement_bnd~3 fill_refinement_bnd proc~box_gc_for_fine_neighbor~3 box_gc_for_fine_neighbor proc~fill_refinement_bnd~3->proc~box_gc_for_fine_neighbor~3 proc~mg_get_child_offset~3 mg_get_child_offset proc~fill_refinement_bnd~3->proc~mg_get_child_offset~3 proc~sides_rb~3 sides_rb proc~fill_refinement_bnd~3->proc~sides_rb~3

Called by

proc~~fill_refinement_bnd~3~~CalledByGraph proc~fill_refinement_bnd~3 fill_refinement_bnd proc~set_ghost_cells~3 set_ghost_cells proc~set_ghost_cells~3->proc~fill_refinement_bnd~3 proc~mg_fill_ghost_cells_lvl~3 mg_fill_ghost_cells_lvl proc~mg_fill_ghost_cells_lvl~3->proc~set_ghost_cells~3 proc~mg_ghost_cell_buffer_size~3 mg_ghost_cell_buffer_size proc~mg_ghost_cell_buffer_size~3->proc~set_ghost_cells~3 proc~mg_allocate_storage~3 mg_allocate_storage proc~mg_allocate_storage~3->proc~mg_ghost_cell_buffer_size~3 proc~mg_fas_fmg~3 mg_fas_fmg proc~mg_fas_fmg~3->proc~mg_fill_ghost_cells_lvl~3 proc~mg_fas_vcycle~3 mg_fas_vcycle proc~mg_fas_fmg~3->proc~mg_fas_vcycle~3 proc~update_coarse~3 update_coarse proc~mg_fas_fmg~3->proc~update_coarse~3 proc~mg_fas_vcycle~3->proc~mg_fill_ghost_cells_lvl~3 proc~smooth_boxes~3 smooth_boxes proc~mg_fas_vcycle~3->proc~smooth_boxes~3 proc~mg_fas_vcycle~3->proc~update_coarse~3 proc~mg_fill_ghost_cells~3 mg_fill_ghost_cells proc~mg_fill_ghost_cells~3->proc~mg_fill_ghost_cells_lvl~3 proc~smooth_boxes~3->proc~mg_fill_ghost_cells_lvl~3 proc~update_coarse~3->proc~mg_fill_ghost_cells_lvl~3 proc~diffusion_solve_acoeff~3 diffusion_solve_acoeff proc~diffusion_solve_acoeff~3->proc~mg_fas_fmg~3 proc~diffusion_solve_acoeff~3->proc~mg_fas_vcycle~3 proc~diffusion_solve_vcoeff~3 diffusion_solve_vcoeff proc~diffusion_solve_vcoeff~3->proc~mg_fas_fmg~3 proc~diffusion_solve_vcoeff~3->proc~mg_fas_vcycle~3 proc~diffusion_solve~3 diffusion_solve proc~diffusion_solve~3->proc~mg_fas_fmg~3 proc~diffusion_solve~3->proc~mg_fas_vcycle~3 proc~mg_copy_to_tree mg_copy_to_tree proc~mg_copy_to_tree->proc~mg_fill_ghost_cells~3 proc~mg_tree_from_amrvac mg_tree_from_amrvac proc~mg_tree_from_amrvac->proc~mg_allocate_storage~3 proc~mg_setup_multigrid mg_setup_multigrid proc~mg_setup_multigrid->proc~mg_tree_from_amrvac proc~mg_update_refinement mg_update_refinement proc~mg_update_refinement->proc~mg_tree_from_amrvac proc~amr_coarsen_refine amr_coarsen_refine proc~amr_coarsen_refine->proc~mg_update_refinement proc~improve_initial_condition improve_initial_condition proc~improve_initial_condition->proc~mg_setup_multigrid proc~main main proc~main->proc~mg_setup_multigrid proc~main->proc~improve_initial_condition proc~resettree_convert resettree_convert proc~main->proc~resettree_convert proc~settree settree proc~main->proc~settree proc~timeintegration timeintegration proc~main->proc~timeintegration proc~resettree resettree proc~resettree->proc~amr_coarsen_refine proc~resettree_convert->proc~amr_coarsen_refine proc~settree->proc~amr_coarsen_refine program~agile agile program~agile->proc~main proc~timeintegration->proc~resettree

Source Code

  subroutine fill_refinement_bnd(mg, id, nb, nc, iv, dry_run)
    type(mg_t), intent(inout) :: mg
    integer, intent(in)       :: id
    integer, intent(in)       :: nc
    integer, intent(in)       :: iv
    integer, intent(in)       :: nb
    logical, intent(in)       :: dry_run
    real(dp)                  :: gc(nc, nc)
    integer                   :: p_id, p_nb_id, ix_offset(3)
    integer                   :: i, dsize, p_nb_rank

    dsize     = nc**(3-1)
    p_id      = mg%boxes(id)%parent
    p_nb_id   = mg%boxes(p_id)%neighbors(nb)
    p_nb_rank = mg%boxes(p_nb_id)%rank

    if (p_nb_rank /= mg%my_rank) then
       i = mg%buf(p_nb_rank)%i_recv
       if (.not. dry_run) then
          gc = reshape(mg%buf(p_nb_rank)%recv(i+1:i+dsize), shape(gc))
       end if
       mg%buf(p_nb_rank)%i_recv = mg%buf(p_nb_rank)%i_recv + dsize
    else if (.not. dry_run) then
       ix_offset = mg_get_child_offset(mg, id)
       call box_gc_for_fine_neighbor(mg%boxes(p_nb_id), mg_neighb_rev(nb),&
           ix_offset, nc, iv, gc)
    end if

    if (.not. dry_run) then
       if (associated(mg%bc(nb, iv)%refinement_bnd)) then
          call mg%bc(nb, iv)%refinement_bnd(mg%boxes(id), nc, iv, nb, gc)
       else
          call sides_rb(mg%boxes(id), nc, iv, nb, gc)
       end if
    end if
  end subroutine fill_refinement_bnd