Fill ghost cells near refinement boundaries which preserves diffusive fluxes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_box_t), | intent(inout) | :: | box | |||
| integer, | intent(in) | :: | nc | |||
| integer, | intent(in) | :: | iv | |||
| integer, | intent(in) | :: | nb |
Ghost cell direction |
||
| real(kind=dp), | intent(in) | :: | gc(nc) |
Interpolated coarse grid ghost cell data (but not yet in the nb direction) |
subroutine sides_rb(box, nc, iv, nb, gc) type(mg_box_t), intent(inout) :: box integer, intent(in) :: nc integer, intent(in) :: iv integer, intent(in) :: nb !< Ghost cell direction !> Interpolated coarse grid ghost cell data (but not yet in the nb direction) real(dp), intent(in) :: gc(nc) integer :: di, dj integer :: i, j, ix, dix if (mg_neighb_low(nb)) then ix = 1 dix = 1 else ix = nc dix = -1 end if select case (mg_neighb_dim(nb)) case (1) i = ix di = dix do j = 1, nc dj = -1 + 2 * iand(j, 1) box%cc(i-di, j, iv) = 0.5_dp * gc(j) + 0.75_dp * box%cc(i, j,& iv) - 0.25_dp * box%cc(i+di, j, iv) end do case (2) j = ix dj = dix do i = 1, nc di = -1 + 2 * iand(i, 1) box%cc(i, j-dj, iv) = 0.5_dp * gc(i) + 0.75_dp * box%cc(i, j,& iv) - 0.25_dp * box%cc(i, j+dj, iv) end do end select end subroutine sides_rb