14 REAL(kind=
dp),
DIMENSION(3, 3) :: hmat
22 IF (abs(
min_image_gap_sq([4.0_dp, 0.0_dp, 0.0_dp], hmat) - 20.0_dp) > 1.0e-12_dp)
THEN
23 error stop
"Wrong minimum-image gap for reversed cell vectors"
38 REAL(KIND=
dp),
DIMENSION(3),
INTENT(IN) :: diag
40 INTEGER :: i, j, k, n1, n2, n3
41 REAL(KIND=
dp) :: exact, gap
42 REAL(KIND=
dp),
DIMENSION(3) :: r, shifted
43 REAL(KIND=
dp),
DIMENSION(3, 3) :: cell
54 r = [real(i,
dp)*abs(diag(1)), real(j,
dp)*abs(diag(2)), real(k,
dp)*abs(diag(3))]/16.0_dp
60 IF (n1 == 0 .AND. n2 == 0 .AND. n3 == 0) cycle
61 shifted = r - matmul(cell, real([n1, n2, n3],
dp))
62 exact = min(exact, sum(shifted**2) - sum(r**2))
66 IF (abs(gap - exact) > 1.0e-10_dp)
THEN
67 error stop
"min_image_gap_sq differs from the explicit image search"
subroutine check_against_all_images(diag)
Compare min_image_gap_sq with an explicit search over neighbouring images.
program hfx_pair_list_methods_unittest
Routines for optimizing load balance between processes in HFX calculations.
pure real(dp) function, public min_image_gap_sq(r, hmat)
Smallest increase of |r|**2 when r is moved to any other periodic image of an orthorhombic,...
Defines the basic variable types.
integer, parameter, public dp