prolong_onto Subroutine

private subroutine prolong_onto(mg, id, nc, iv, iv_to, add, method)

Prolong onto a child box

Arguments

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

Prolong from this variable

integer, intent(in) :: iv_to

Prolong to this variable

logical, intent(in) :: add

If true, add to current values

procedure(mg_box_prolong) :: method

Calls

proc~~prolong_onto~2~~CallsGraph proc~prolong_onto~2 prolong_onto proc~mg_get_child_offset~2 mg_get_child_offset proc~prolong_onto~2->proc~mg_get_child_offset~2

Called by

proc~~prolong_onto~2~~CalledByGraph proc~prolong_onto~2 prolong_onto proc~mg_prolong~2 mg_prolong proc~mg_prolong~2->proc~prolong_onto~2 proc~correct_children~2 correct_children proc~correct_children~2->proc~mg_prolong~2 proc~mg_fas_fmg~2 mg_fas_fmg proc~mg_fas_fmg~2->proc~correct_children~2 proc~mg_fas_vcycle~2 mg_fas_vcycle proc~mg_fas_fmg~2->proc~mg_fas_vcycle~2 proc~mg_fas_vcycle~2->proc~correct_children~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 prolong_onto(mg, id, nc, iv, iv_to, add, method)
    type(mg_t), intent(inout) :: mg
    integer, intent(in)       :: id
    integer, intent(in)       :: nc
    integer, intent(in)       :: iv
    !< Prolong from this variable
    integer, intent(in)       :: iv_to
    !< Prolong to this variable
    logical, intent(in)       :: add
    !< If true, add to current values
    procedure(mg_box_prolong) :: method
    integer                   :: hnc, p_id, p_rank, i, dix(1), dsize
    real(dp)                  :: tmp(nc)

    hnc    = nc/2
    p_id   = mg%boxes(id)%parent
    p_rank = mg%boxes(p_id)%rank

    if (p_rank == mg%my_rank) then
       dix    = mg_get_child_offset(mg, id)
       call method(mg, p_id, dix, nc, iv, tmp)
    else
       dsize  = nc**1
       i = mg%buf(p_rank)%i_recv
       tmp = reshape(mg%buf(p_rank)%recv(i+1:i+dsize), [nc])
       mg%buf(p_rank)%i_recv = mg%buf(p_rank)%i_recv + dsize
    end if

    if (add) then
       mg%boxes(id)%cc(1:nc, iv_to) = mg%boxes(id)%cc(1:nc, iv_to) + tmp
    else
       mg%boxes(id)%cc(1:nc, iv_to) = tmp
    end if

  end subroutine prolong_onto