namespace rgpot_neighbors

Overview

Full neighbour tables in CSR form, built with vesin. More…

namespace rgpot_neighbors {
 
// global functions
 
subroutine neighbor_table_build(class(neighbor_table_t), intent(inout) self, real(wp), dimension(:, :), intent(in), contiguous positions, real(wp), dimension(3, 3), intent(in) cell, real(wp), intent(in) cutoff, integer, intent(out) status, character(len=:), intent(out), allocatable errmsg, logical, dimension(3), intent(in), optional periodic, real(wp), intent(in), optional skin);
 
} // namespace rgpot_neighbors

Detailed Documentation

Full neighbour tables in CSR form, built with vesin.

Every ported potential evaluates forces as a gather : atom i sums the whole force acting on it from its own neighbours, and writes only f(:, i). Iterations of the atom loop then touch disjoint memory, so they run under do concurrent. That needs a full list (both i->j and j->i), which this type provides along with the pair vectors and distances vesin already computed, so the kernels never redo minimum image arithmetic.

Cell convention: C callers hand over nine doubles, row-major, one cell vector per row. Fortran reads that same memory column-major, so a real(wp) :: cell(3, 3) dummy sees one cell vector per column, which is exactly what vesin expects. No transpose anywhere.

Global Functions

subroutine neighbor_table_build(class(neighbor_table_t), intent(inout) self, real(wp), dimension(:, :), intent(in), contiguous positions, real(wp), dimension(3, 3), intent(in) cell, real(wp), intent(in) cutoff, integer, intent(out) status, character(len=:), intent(out), allocatable errmsg, logical, dimension(3), intent(in), optional periodic, real(wp), intent(in), optional skin)

Rebuild the table for positions (3 x natoms) within cutoff.

periodic defaults to fully periodic. status is zero on success; on failure the table is left empty and errmsg describes the fault.

Parameters:

skin

Verlet skin handed to vesin, which then caches its topology between calls and rebuilds only once an atom has moved more than half of it. Defaults to a tenth of the cutoff.