This is a Fortran interface to the C-API of vesin
, from the header vesin.h
.
enumerator | :: | VesinUnknownDevice | = | 0 | Unknown device, used for default initialization and to indicate no allocated data. |
enumerator | :: | VesinCPU | = | 1 | CPU device |
Device on which the data can be
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.
Type | Intent | Optional | 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 |
||
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 |
||
type(VesinOptions), | value | :: | options |
Options for the calculation |
||
type(VesinNeighborList) | :: | neighbors |
A |
|||
type(c_ptr), | intent(in) | :: | error_message |
A |
Non-zero integer upon error; zero otherwise.
Free all allocated memory inside a VesinNeighborList
, according to it's
device
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(VesinNeighborList) | :: | neighbors |
Used for storing Vesin options.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=c_double), | public | :: | cutoff | = | 0.0_c_double |
Spherical cutoff, only pairs below this cutoff will be included |
|
logical(kind=c_bool), | public | :: | full |
Should the returned neighbor list be a full list (include both |
|||
logical(kind=c_bool), | public | :: | sorted | = | .false. |
Should the neighbor list be sorted? If yes, the returned pairs will be sorted using lexicographic order. |
|
logical(kind=c_bool), | public | :: | return_shifts | = | .false. |
Should the returned |
|
logical(kind=c_bool), | public | :: | return_distances | = | .false. |
Should the returned |
|
logical(kind=c_bool), | public | :: | return_vectors | = | .false. |
Should the returned |
Used as return type from vesin_neighbors()
.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=c_size_t), | public | :: | length | = | 0_c_size_t |
Number of pairs in this neighbor list |
|
integer(kind=c_int), | public | :: | device | = | VesinUnknownDevice |
Device used for the data allocations |
|
type(c_ptr), | public | :: | pairs | = | c_null_ptr |
Array of pairs (storing the indices of the first and second point in
the pair), containing |
|
type(c_ptr), | public | :: | shifts | = | c_null_ptr |
Array of box shifts, one for each |
|
type(c_ptr), | public | :: | distances | = | c_null_ptr |
Array of pair distance (i.e. distance between the two points), one for
each pair. This is only set if |
|
type(c_ptr), | public | :: | vectors | = | c_null_ptr |
Array of pair vector (i.e. vector between the two points), one for
each pair. This is only set if |