Perform Laplacian operator on a box
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_t), | intent(inout) | :: | mg | |||
| integer, | intent(in) | :: | id | |||
| integer, | intent(in) | :: | nc | |||
| integer, | intent(in) | :: | i_out |
Index of variable to store Laplacian in |
subroutine box_lpl(mg, id, nc, i_out) type(mg_t), intent(inout) :: mg integer, intent(in) :: id integer, intent(in) :: nc integer, intent(in) :: i_out !< Index of variable to store Laplacian in integer :: i, j real(dp) :: idr2(2) idr2 = 1 / mg%dr(:, mg%boxes(id)%lvl)**2 associate (cc => mg%boxes(id)%cc, n => mg_iphi) do j = 1, nc do i = 1, nc cc(i, j, i_out) = idr2(1) * (cc(i-1, j, n) + cc(i+1, j,& n) - 2 * cc(i, j, n)) + idr2(2) * (cc(i, j-1, n) + cc(i, j+1,& n) - 2 * cc(i, j, n)) end do end do end associate end subroutine box_lpl