画像電荷を足し合わせて点電荷の電場を加算する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | q |
電荷量。 |
||
| real(kind=dp), | intent(in) | :: | src(3) |
電荷量。 |
||
| real(kind=dp), | intent(in) | :: | target(3) |
電荷量。 |
||
| real(kind=dp), | intent(in) | :: | soft2 |
ソフトニング二乗。 |
||
| integer(kind=i32), | intent(in) | :: | axis1 |
画像シフト軸 1。 |
||
| integer(kind=i32), | intent(in) | :: | axis2 |
画像シフト軸 1。 画像シフト軸 2。 |
||
| real(kind=dp), | intent(in) | :: | shift_axis1(:) | |||
| real(kind=dp), | intent(in) | :: | shift_axis2(:) | |||
| integer(kind=i32), | intent(in) | :: | nshift |
画像シフト軸 1。 画像シフト軸 2。 シフト数。 |
||
| real(kind=dp), | intent(inout) | :: | e(3) |
subroutine add_point_charge_images_field(q, src, target, soft2, axis1, axis2, shift_axis1, shift_axis2, nshift, e) real(dp), intent(in) :: q, src(3), target(3) real(dp), intent(in) :: soft2 integer(i32), intent(in) :: axis1, axis2, nshift real(dp), intent(in) :: shift_axis1(:), shift_axis2(:) real(dp), intent(inout) :: e(3) integer(i32) :: img_i, img_j real(dp) :: shifted(3), dx(3), r2, inv_r3 if (abs(q) <= tiny(1.0d0)) return do img_i = 1_i32, nshift do img_j = 1_i32, nshift shifted = src if (axis1 > 0_i32) shifted(axis1) = shifted(axis1) + shift_axis1(img_i) if (axis2 > 0_i32) shifted(axis2) = shifted(axis2) + shift_axis2(img_j) dx = target - shifted r2 = sum(dx*dx) + soft2 if (r2 <= tiny(1.0d0)) cycle inv_r3 = 1.0d0/(sqrt(r2)*r2) e = e + q*inv_r3*dx end do end do end subroutine add_point_charge_images_field