Prolong variable iv from lvl to variable iv_to at lvl+1
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_t), | intent(inout) | :: | mg | |||
| integer, | intent(in) | :: | lvl |
Level to prolong from |
||
| integer, | intent(in) | :: | iv |
Source variable |
||
| integer, | intent(in) | :: | iv_to |
Target variable |
||
| procedure(mg_box_prolong) | :: | method |
Prolongation method |
|||
| logical, | intent(in) | :: | add |
If true, add to current values |
subroutine mg_prolong(mg, lvl, iv, iv_to, method, add) type(mg_t), intent(inout) :: mg integer, intent(in) :: lvl !< Level to prolong from integer, intent(in) :: iv !< Source variable integer, intent(in) :: iv_to !< Target variable procedure(mg_box_prolong) :: method !< Prolongation method logical, intent(in) :: add !< If true, add to current values integer :: i, id, dsize, nc if (lvl == mg%highest_lvl) error stop "cannot prolong highest level" if (lvl < mg%lowest_lvl) error stop "cannot prolong below lowest level" ! Below the first normal level, all boxes are on the same CPU if (lvl >= mg%first_normal_lvl-1) then dsize = mg%box_size**1 mg%buf(:)%i_send = 0 mg%buf(:)%i_ix = 0 do i = 1, size(mg%lvls(lvl)%my_ids) id = mg%lvls(lvl)%my_ids(i) call prolong_set_buffer(mg, id, mg%box_size, iv, method) end do mg%buf(:)%i_recv = mg%comm_prolong%n_recv(:, lvl) * dsize call sort_and_transfer_buffers(mg, dsize) mg%buf(:)%i_recv = 0 end if nc = mg%box_size_lvl(lvl+1) do i = 1, size(mg%lvls(lvl+1)%my_ids) id = mg%lvls(lvl+1)%my_ids(i) call prolong_onto(mg, id, nc, iv, iv_to, add, method) end do end subroutine mg_prolong