vesin Module

High-level fortran interface to vesin.

This is the recomended interface to vesin, taking care of data conversion from and to the C API for you.



Interfaces

public interface NeighborList

Initialize a NeighborList.

The cutoff and full options are mandatory, the other are optional and default to .false.

  • private function vesin_construct_c_float(cutoff, full, sorted, algorithm, return_shifts, return_distances, return_vectors) result(self)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=c_float), intent(in) :: cutoff

    Spherical cutoff, only pairs below this cutoff will be included

    logical, intent(in) :: full

    Should the returned neighbor list be a full list (include both i -> j and j -> i pairs) or a half list (include only i -> j)?

    logical, intent(in), optional :: sorted

    Should the neighbor list be sorted? If .true., the returned pairs will be sorted by the first point index (i). The order of the second point index (j) and shifts in the list of pairs is unspecified.

    integer(kind=c_int32_t), intent(in), optional :: algorithm

    Algorithm to use for the neighbor list calculation (one of VesinAutoAlgorithm, ! VesinBruteForceAlgorithm, or VesinCellListAlgorithm)

    logical, intent(in), optional :: return_shifts

    Should the returned VesinNeighborList contain shifts?

    logical, intent(in), optional :: return_distances

    Should the returned VesinNeighborList contain distances?

    logical, intent(in), optional :: return_vectors

    Should the returned VesinNeighborList contain vector?

    Return Value type(NeighborList)

  • private function vesin_construct_c_double(cutoff, full, sorted, algorithm, return_shifts, return_distances, return_vectors) result(self)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=c_double), intent(in) :: cutoff

    Spherical cutoff, only pairs below this cutoff will be included

    logical, intent(in) :: full

    Should the returned neighbor list be a full list (include both i -> j and j -> i pairs) or a half list (include only i -> j)?

    logical, intent(in), optional :: sorted

    Should the neighbor list be sorted? If .true., the returned pairs will be sorted by the first index (i). The order of the second index (j) and shifts in the list of pairs is unspecified.

    integer(kind=c_int32_t), intent(in), optional :: algorithm

    Algorithm to use for the neighbor list calculation (one of VesinAutoAlgorithm, ! VesinBruteForceAlgorithm, or VesinCellListAlgorithm)

    logical, intent(in), optional :: return_shifts

    Should the returned VesinNeighborList contain shifts?

    logical, intent(in), optional :: return_distances

    Should the returned VesinNeighborList contain distances?

    logical, intent(in), optional :: return_vectors

    Should the returned VesinNeighborList contain vector?

    Return Value type(NeighborList)


Derived Types

type, public ::  NeighborList

A neighbor list calculator.

Read more…

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: errmsg

Latest error message

integer(kind=c_size_t), public :: length = 0_c_size_t

Number of pairs in the list

integer(kind=c_size_t), public, pointer :: pairs(:,:) => null()

Array of pairs (storing the indices of the first and second point in the pair). The shape is [2, length].

integer(kind=c_int32_t), public, pointer :: shifts(:,:) => null()

Array of box shifts, one for each pair. This is only set if return_pairs was set to .true. during intialization. The shape is [3, length]

real(kind=c_double), public, pointer :: distances(:) => null()

Array of pair distance (i.e. distance between the two points), one for each pair. This is only set if return_distances was set to .true. during intialization. The shape is [length]

real(kind=c_double), public, pointer :: vectors(:,:) => null()

Array of pair vector (i.e. vector between the two points), one for each pair. This is only set if return_vectors was set to .true. during intialization. The shape is [3, length]

Constructor

Initialize a NeighborList.

Read more…
private function vesin_construct_c_float (cutoff, full, sorted, algorithm, return_shifts, return_distances, return_vectors)
private function vesin_construct_c_double (cutoff, full, sorted, algorithm, return_shifts, return_distances, return_vectors)

Type-Bound Procedures

generic, public :: compute => vesin_compute_c_double
generic, public :: compute => vesin_compute_c_float
procedure, public :: free => vesin_destroy