Prolong onto a child box
| Type | Intent | Optional | 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 |
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