15 INTEGER :: n_candidates
16 REAL(kind=
dp),
ALLOCATABLE :: points(:, :)
20 particle_set => particles
21 particle_set(1)%r = [0.0_dp, 0.0_dp, 0.0_dp]
22 particle_set(2)%r = [2.0_dp, 0.0_dp, 0.0_dp]
23 ALLOCATE (points(3, 4))
24 points(:, :) = reshape([ &
25 0.0_dp, 0.0_dp, 0.0_dp, &
26 0.5_dp, 0.0_dp, 0.0_dp, &
27 1.0_dp, 0.0_dp, 0.0_dp, &
28 1.5_dp, 0.0_dp, 0.0_dp], [3, 4])
31 IF (n_candidates /= 3) error stop
"incorrect RI-RS Voronoi candidate count"
32 IF (maxval(abs(points(:, 1) - [0.0_dp, 0.0_dp, 0.0_dp])) > 1.0e-14_dp)
THEN
33 error stop
"RI-RS maximin selection did not start at the origin"
35 IF (maxval(abs(points(:, 2) - [1.0_dp, 0.0_dp, 0.0_dp])) > 1.0e-14_dp)
THEN
36 error stop
"RI-RS maximin selection returned the wrong second point"
40 ALLOCATE (points(3, 5))
41 points(:, :) = reshape([ &
42 0.0_dp, 0.0_dp, 0.0_dp, &
43 0.5_dp, 0.0_dp, 0.0_dp, &
44 1.0_dp, 0.0_dp, 0.0_dp, &
45 1.5_dp, 0.0_dp, 0.0_dp, &
46 2.0_dp, 0.0_dp, 0.0_dp], [3, 5])
48 IF (n_candidates /= 3) error stop
"incorrect RI-RS Voronoi fallback candidate count"
49 IF (
SIZE(points, 2) /= 4) error stop
"RI-RS Voronoi fallback returned the wrong grid size"
50 IF (maxval(abs(points(:, 2) - [2.0_dp, 0.0_dp, 0.0_dp])) > 1.0e-14_dp)
THEN
51 error stop
"RI-RS Voronoi fallback did not select from the full source grid"
Defines the basic variable types.
integer, parameter, public dp
Define the data structure for the particle information.
Shared RI-RS grid I/O and contracted-Gaussian evaluation utilities.
subroutine, public initialize_rirs_grid(points, n_select, center_atom, particle_set, n_voronoi_candidates)
Build one deterministic atom-specific grid from a tabulated source grid.
program rirs_grid_utils_unittest