Perform Laplacian operator on a box in cylindrical geometry, using (r,z) and (r,phi,z) coordinates in 2D/3D.
| 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_clpl(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) :: dr(2), idr2(2) real(dp) :: r_face(nc+1), r_inv(nc) dr = mg%dr(:, mg%boxes(id)%lvl) idr2 = 1 / dr**2 r_face = mg%boxes(id)%r_min(1) + dr(1) * [(i, i=0,nc)] r_inv = 1/(mg%boxes(id)%r_min(1) + dr(1) * [(i-0.5_dp, i=1,nc)]) associate (cc => mg%boxes(id)%cc, n => mg_iphi) do j = 1, nc do i = 1, nc cc(i, j, i_out) = idr2(1) * (r_face(i) * r_inv(i) * cc(i-1, j,& n) + r_face(i+1) * r_inv(i) * 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_clpl