vesin_neighbors Interface

interface

Compute a neighbor list.

The data is returned in a VesinNeighborList. For an initial call, the VesinNeighborList should be default-initalized. The VesinNeighborList can be re-used across calls to this functions to re-use memory allocations, and once it is no longer needed, users should call vesin_free to release the corresponding memory.


public function vesin_neighbors(points, n_points, box, periodic, device, options, neighbors, error_message) result(status) bind(c, name="vesin_neighbors")

Arguments

Type IntentOptional Attributes Name
real(kind=c_double), intent(in) :: points(3,n_points)

Positions of all points in the system;

integer(kind=c_size_t), value :: n_points

Number of elements in the points array

real(kind=c_double), intent(in) :: box(3,3)

Bounding box for the system. If the system is non-periodic, this is ignored. This should contain the three vectors of the bounding box, one vector per column of the matrix.

logical(kind=c_bool), value :: periodic

Is the system using periodic boundary conditions?

integer(kind=c_int), value :: device

Device where the points and box data is allocated.

type(VesinOptions), value :: options

Options for the calculation

type(VesinNeighborList) :: neighbors

A type(VesinNeighborList) instance, that will be used to store the computed list of neighbors.

type(c_ptr), intent(in) :: error_message

A type(c_ptr) to a null-terminated char* containing the error message of this function if any.

Return Value integer(kind=c_int)

Non-zero integer upon error; zero otherwise.