Namespaces | |
| namespace | nneigh |
| Functions for building neighbour lists. | |
Classes | |
| class | nneigh::SkinNeighborList |
| Persistent neighbour list with a LAMMPS skin. More... | |
Enumerations | |
| enum class | nneigh::BondGraph { nneigh::BondGraph::Cutoff , nneigh::BondGraph::KnnMutual , nneigh::BondGraph::KnnUnion } |
| Bond graph for TUM. More... | |
Functions | |
| void | nneigh::dumpBoundsToH (const std::vector< double > &box, const std::vector< double > &boxLow, double H[3][3], double origin[3]) |
| LAMMPS dump bound spans to restricted triclinic H (rows a, b, c). | |
| void | nneigh::dumpCellLengths (const std::vector< double > &box, const std::vector< double > &boxLow, double lengths[3]) |
| Recovered restricted-triclinic lengths lx, ly, lz (H diagonal). | |
| int | nneigh::dumpAxialDim (const std::vector< double > &box, const std::vector< double > &boxLow) |
| Longest recovered length: 0 = x, 1 = y, 2 = z. | |
| int | nneigh::dumpAxialDim (const molSys::PointCloud< molSys::Point< double >, double > &yCloud) |
| void | nneigh::dumpToFrac (const double H[3][3], const double origin[3], double x, double y, double z, double s[3]) |
| Cartesian to fractional coordinates via dump H. | |
| void | nneigh::dumpFromFrac (const double H[3][3], const double origin[3], const double s[3], double r[3]) |
| Fractional to cartesian coordinates via dump H. | |
| double | nneigh::dumpVolume (const std::vector< double > &box, const std::vector< double > &boxLow) |
| Triclinic dump-cell volume |det(H)| from dumpBoundsToH. | |
| double | nneigh::dumpVolume (const molSys::PointCloud< molSys::Point< double >, double > &yCloud) |
| std::vector< std::vector< int > > | nneigh::neighList (double rcutoff, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int typeI, int typeJ) |
| All these functions use atom IDs and not indices. | |
| std::vector< std::vector< int > > | nneigh::neighListPair (double rcutoff, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int typeI, int typeJ) |
| bool | nneigh::cellListRowsThreaded (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< int > &subset, double rcutoff, std::vector< std::vector< int > > &rows) |
| std::vector< std::vector< int > > | nneigh::neighListO (double rcutoff, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int typeI) |
| std::vector< std::vector< int > > | nneigh::halfNeighList (double rcutoff, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int typeI=1) |
| std::vector< std::vector< int > > | nneigh::neighbourListByIndex (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< std::vector< int > > &nList) |
| std::vector< std::vector< int > > | nneigh::getNewNeighbourListByIndex (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, double cutoff) |
| std::vector< std::vector< int > > | nneigh::kNearestNeighbourList (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, double candidateCutoff, int typeI, bool mutual=true) |
| Bonded graph from the k nearest neighbours of each particle rather than a distance cutoff. | |
| std::vector< std::vector< int > > | nneigh::kNearestNeighbourList (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, double candidateCutoff, const std::vector< int > &types, bool mutual=true) |
| k-nearest graph on a type set (water oxygens). | |
| std::pair< std::vector< std::vector< int > >, std::vector< std::vector< int > > > | nneigh::kNearestNeighbourPair (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, double candidateCutoff, int typeI) |
| Mutual and union k-nearest graphs from one candidate search. | |
| std::pair< std::vector< std::vector< int > >, std::vector< std::vector< int > > > | nneigh::kNearestNeighbourPair (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, double candidateCutoff, const std::vector< int > &types) |
| std::pair< double, double > | nneigh::shellSeparation (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, int typeI) |
| The shell-separation certificate for the exact reduction of the k-nearest graph to the cutoff graph: returns {max_i d_k(i), min_i d_{k+1}(i)} over particles of the type. | |
| std::vector< std::tuple< int, int, double > > | nneigh::nearestUnlike (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int typeI, int typeJ) |
| Nearest unlike image of each typeI particle among typeJ particles. | |
| std::vector< std::pair< int, int > > | nneigh::mutualNearestUnlike (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int typeI, int typeJ) |
| Subset of nearestUnlike where j's nearest typeI is i (mutual). | |
| int | nneigh::clearNeighbourList (std::vector< std::vector< int > > &nList) |
| Erases memory for a vector of vectors for the neighbour list. | |
| BondGraph | nneigh::bondGraphFromName (const std::string &name) |
| const char * | nneigh::bondGraphName (BondGraph graph) |
| nneigh::SkinNeighborList::SkinNeighborList (double cutoff, double skin, int typeI, BondGraph graph=BondGraph::KnnMutual, int k=4) | |
| BondGraph | nneigh::SkinNeighborList::graph () const |
| const std::vector< std::vector< int > > & | nneigh::SkinNeighborList::update (const molSys::PointCloud< molSys::Point< double >, double > &yCloud) |
| bool | nneigh::SkinNeighborList::lastRebuilt () const |
| int | nneigh::SkinNeighborList::lastChangedAtoms () const |
| Atoms whose cutoff bond set changed on the last update. | |
| const std::vector< std::vector< int > > & | nneigh::SkinNeighborList::bonds () const |
|
strong |
Bond graph for TUM.
Chosen at runtime so the three published assignments can be compared on the same frames. cutoff: pairs inside the distance cutoff (2020 graph). knn: mutual k-nearest (TUM v2 without hysteresis). knn-union: union k-nearest (the completion graph of the seeded rule).
| Enumerator | |
|---|---|
| Cutoff | |
| KnnMutual | |
| KnnUnion | |
Definition at line 383 of file neighbours.hpp.
| BondGraph nneigh::bondGraphFromName | ( | const std::string & | name | ) |
| const char * nneigh::bondGraphName | ( | BondGraph | graph | ) |
|
inlinenodiscard |
Definition at line 413 of file neighbours.hpp.
| bool nneigh::cellListRowsThreaded | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| const std::vector< int > & | subset, | ||
| double | rcutoff, | ||
| std::vector< std::vector< int > > & | rows ) |
Threaded cell-list neighbour rows. rows[k] holds the indices within rcutoff of subset[k] under the minimum image convention, ascending and without the atom itself. Atoms are binned in fractional coordinates of the recovered triclinic cell H; every axis needs at least three cells of perpendicular width rcutoff, so that the nearest image of every neighbour sits in one of the 27 surrounding cells. Returns false, with rows untouched, when the cell is too small for that, and the caller takes the vesin or brute-force path. Each row is built by one thread.
|
nodiscard |
Erases memory for a vector of vectors for the neighbour list.
|
inline |
Definition at line 131 of file neighbours.hpp.
|
inline |
Longest recovered length: 0 = x, 1 = y, 2 = z.
Definition at line 117 of file neighbours.hpp.
|
inline |
LAMMPS dump bound spans to restricted triclinic H (rows a, b, c).
box[0..2] are xhi_bound - xlo_bound etc. Optional box[3..5] are tilt xy, xz, yz. boxLow is the bound lo. Inverse of xlo_bound = xlo + min(0, xy, xz, xy+xz).
Definition at line 74 of file neighbours.hpp.
|
inline |
Recovered restricted-triclinic lengths lx, ly, lz (H diagonal).
Definition at line 105 of file neighbours.hpp.
|
inline |
Fractional to cartesian coordinates via dump H.
Definition at line 151 of file neighbours.hpp.
|
inline |
Cartesian to fractional coordinates via dump H.
Definition at line 137 of file neighbours.hpp.
|
inline |
Definition at line 169 of file neighbours.hpp.
|
inline |
Triclinic dump-cell volume |det(H)| from dumpBoundsToH.
Bound spans Lx*Ly*Lz are not the cell volume when tilt is present.
Definition at line 160 of file neighbours.hpp.
| std::vector< std::vector< int > > nneigh::getNewNeighbourListByIndex | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| double | cutoff ) |
Gets a neighbour list by index, according to a pointCloud given as the input. Assume no slices or other skullduggery
|
inlinenodiscard |
Definition at line 403 of file neighbours.hpp.
| std::vector< std::vector< int > > nneigh::halfNeighList | ( | double | rcutoff, |
| const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, | ||
| int | typeI = 1 ) |
Half neighbour list for one type (vesin cell list, brute-force fallback) You can only use this for neighbour lists with one type
| std::vector< std::vector< int > > nneigh::kNearestNeighbourList | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| int | k, | ||
| double | candidateCutoff, | ||
| const std::vector< int > & | types, | ||
| bool | mutual = true ) |
k-nearest graph on a type set (water oxygens).
Substrate, ions and other species never appear as neighbours. An empty set is no atoms.
| std::vector< std::vector< int > > nneigh::kNearestNeighbourList | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| int | k, | ||
| double | candidateCutoff, | ||
| int | typeI, | ||
| bool | mutual = true ) |
Bonded graph from the k nearest neighbours of each particle rather than a distance cutoff.
The default intersection symmetrization (mutual = true) bonds i and j only when each lists the other among its k nearest; the union alternative bonds on either nomination. In a crystal the first shell is mutual and the two coincide; on disordered packings the mutual graph is sparser, which starves accidental ring structure – measured on the dense null, mutual scores zero false crystal where union reaches 2.5%. Nominations are a periodic linked-cell k-nearest search via linkcell (Allen and Tildesley): vesin is cutoff-only and KD-trees have no minimum-image convention. candidateCutoff is only a cell-size hint. On an undistorted tetrahedral lattice with k = 4 this graph equals the first-shell cutoff graph. Rows are by atom ID with the leading self entry, like neighListO.
| std::pair< std::vector< std::vector< int > >, std::vector< std::vector< int > > > nneigh::kNearestNeighbourPair | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| int | k, | ||
| double | candidateCutoff, | ||
| const std::vector< int > & | types ) |
| std::pair< std::vector< std::vector< int > >, std::vector< std::vector< int > > > nneigh::kNearestNeighbourPair | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| int | k, | ||
| double | candidateCutoff, | ||
| int | typeI ) |
Mutual and union k-nearest graphs from one candidate search.
Seeded affiliation needs both; building them separately repeats the cell list.
|
inlinenodiscard |
Atoms whose cutoff bond set changed on the last update.
Definition at line 412 of file neighbours.hpp.
|
inlinenodiscard |
Definition at line 410 of file neighbours.hpp.
| std::vector< std::pair< int, int > > nneigh::mutualNearestUnlike | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| int | typeI, | ||
| int | typeJ ) |
Subset of nearestUnlike where j's nearest typeI is i (mutual).
A contact pair is this mutual edge, not first-shell membership.
| std::vector< std::tuple< int, int, double > > nneigh::nearestUnlike | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| int | typeI, | ||
| int | typeJ ) |
Nearest unlike image of each typeI particle among typeJ particles.
Returns cloud-index pairs (i, j) and the MIC distance (sqrt of gen::periodicDistSq). On an ion cloud, typeI = 1 (cation vertex) and typeJ = 2 (anion vertex). This is the nearest unlike neighbour, not a coordination number.
| std::vector< std::vector< int > > nneigh::neighbourListByIndex | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| const std::vector< std::vector< int > > & | nList ) |
The following function outputs a neighbour list using indices and NOT atom IDs
Converts the neighbour list build with atom IDs into a neighbour list of atom indices, according to the pointCloud
| std::vector< std::vector< int > > nneigh::neighList | ( | double | rcutoff, |
| const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, | ||
| int | typeI, | ||
| int | typeJ ) |
All these functions use atom IDs and not indices.
Full neighbour list for pairs of type I and type J (vesin cell list, brute-force fallback). The neighbour list does not differentiate between the types of atoms
| std::vector< std::vector< int > > nneigh::neighListO | ( | double | rcutoff, |
| const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, | ||
| int | typeI ) |
Full neighbour list for one type (threaded cell list from 2048 atoms when OpenMP is compiled, vesin cell list, brute-force fallback) You can only use this for neighbour lists with one type
| std::vector< std::vector< int > > nneigh::neighListPair | ( | double | rcutoff, |
| const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, | ||
| int | typeI, | ||
| int | typeJ ) |
I-J neighbour list (I==J is like-type and reuses neighListO). Unlike-type pairs use the same dump MIC as neighListO.
| std::pair< double, double > nneigh::shellSeparation | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud, |
| int | k, | ||
| int | typeI ) |
The shell-separation certificate for the exact reduction of the k-nearest graph to the cutoff graph: returns {max_i d_k(i), min_i d_{k+1}(i)} over particles of the type.
When max_i d_k(i) <= rcutoff <= min_i d_{k+1}(i), the two graphs coincide edge for edge and every downstream graph predicate is identical. Brute force, intended for validation.
| nneigh::SkinNeighborList::SkinNeighborList | ( | double | cutoff, |
| double | skin, | ||
| int | typeI, | ||
| BondGraph | graph = BondGraph::KnnMutual, | ||
| int | k = 4 ) |
graph selects cutoff vs k-nearest (mutual or union). k is the neighbour count for the knn graphs (default 4).
| const std::vector< std::vector< int > > & nneigh::SkinNeighborList::update | ( | const molSys::PointCloud< molSys::Point< double >, double > & | yCloud | ) |
Refresh from a new frame. The returned list is ID-keyed with a leading self entry, the same shape as neighListO.