40 real(real64),
allocatable :: pos(:, :)
46 type(lookup_t),
intent(inout) :: this
47 integer,
intent(in) :: dim
48 integer,
intent(in) :: nobjs
49 real(real64),
intent(in) :: pos(:, :)
55 safe_allocate(this%pos(1:this%dim, 1:this%nobjs))
57 this%pos(1:this%dim, 1:this%nobjs) = pos(1:this%dim, 1:this%nobjs)
64 type(lookup_t),
intent(inout) :: this
67 safe_deallocate_a(this%pos)
74 type(lookup_t),
intent(in) :: this
75 integer,
intent(in) :: npoint
76 real(real64),
intent(in) :: points(:, :)
77 real(real64),
intent(in) :: radius
78 integer,
intent(out) :: nlist(:)
79 integer,
optional,
allocatable,
intent(out) :: list(:, :)
86 if (
present(list))
then
87 safe_allocate(list(1:this%nobjs, 1:npoint))
94 r2 = sum((this%pos(1:this%dim, ii) - points(ipoint, 1:this%dim))**2)
95 if (r2 < radius**2)
then
96 nlist(ipoint) = nlist(ipoint) + 1
101 if (
present(list)) list(nlist(ipoint), ipoint) = ii
subroutine, public lookup_end(this)
subroutine, public lookup_init(this, dim, nobjs, pos)
subroutine, public lookup_get_list(this, npoint, points, radius, nlist, list)