seams-core v2.14.0
libyodaLib, the C++ engine of d-SEAMS
Loading...
Searching...
No Matches
neighbours.hpp File Reference

Header file for neighbour list generation. More...

#include <algorithm>
#include <array>
#include <cmath>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include <generic.hpp>
#include <mol_sys.hpp>

Go to the source code of this file.

Classes

class  nneigh::CutoffSkin
 In-situ cutoff list. More...
class  nneigh::SkinNeighborList
 Persistent neighbour list with a LAMMPS skin. More...

Namespaces

namespace  nneigh
 Functions for building neighbour lists.

Enumerations

enum class  nneigh::BondGraph { nneigh::Cutoff , nneigh::KnnMutual , nneigh::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, the absolute value of det(H), from dumpBoundsToH.
double nneigh::dumpVolume (const molSys::PointCloud< molSys::Point< double >, double > &yCloud)
bool nneigh::setBoxFromLammpsEdges (std::vector< double > &box, std::vector< double > &boxLow, double xlo, double ylo, double zlo, double lx, double ly, double lz, double xy, double xz, double yz)
 LAMMPS edge origin and edge lengths, plus tilt, as a dump box.
bool nneigh::setBoxFromLengthsAngles (std::vector< double > &box, std::vector< double > &boxLow, double a, double b, double c, double alphaDeg, double betaDeg, double gammaDeg)
 Crystallographic lengths and angles in degrees, stored as a dump box.
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)
const std::vector< std::vector< int > > & nneigh::reusedShellList (double rcutoff, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< char > *source)
bool nneigh::blockWindowRows (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, double rcutoff, const std::vector< char > *source, std::vector< std::vector< int > > &rows, bool byId=true, bool everyRow=false)
bool nneigh::cellListRowsThreaded (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< int > &subset, double rcutoff, std::vector< std::vector< int > > &rows)
void nneigh::preferSerialCutoff (bool on)
 When set, neighListO stays on the one-thread builder even if the OpenMP team is wider.
bool nneigh::orthoFullCsr (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< int > *subset, double rcutoff, std::vector< int > &offsets, std::vector< int > &cols, bool half=false, std::vector< std::vector< int > > *directRows=nullptr, const int *indexToID=nullptr, bool *wroteRows=nullptr, bool branchy=false)
 Full cutoff list as CSR of cloud indices.
bool nneigh::refillNeighListO (double rcutoff, const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int typeI, std::vector< std::vector< int > > &rows)
bool nneigh::refillIndexRows (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, double cutoff, std::vector< std::vector< int > > &rows)
 Same rows as getNewNeighbourListByIndex, written into rows.
bool nneigh::directedKNearestCsr (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, double candidateCutoff, std::vector< int > &offsets, std::vector< int > &cols)
 Directed k nearest neighbours as a CSR of cloud indices, no self entry.
std::vector< std::vector< int > > nneigh::idRowsFromCsr (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< int > &indexToID, const std::vector< int > &offsets, const std::vector< int > &cols)
 Atom-ID rows, self first, from a CSR of cloud indices.
std::vector< std::vector< int > > nneigh::indexRowsFromCsr (int nop, const std::vector< int > &offsets, const std::vector< int > &cols)
 Index rows, self first, from a CSR of cloud indices.
std::vector< std::vector< int > > nneigh::halfIdRowsFromCsr (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, const std::vector< int > &indexToID, const std::vector< int > &offsets, const std::vector< int > &cols)
 Half list by atom ID. The lower cloud index owns the pair.
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::neighListLinkcell (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.
void nneigh::kNearestCsr (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, double candidateCutoff, int typeI, bool mutual, std::vector< int > &offsets, std::vector< int > &cols, bool park=true)
void nneigh::kNearestPacked (const molSys::PointCloud< molSys::Point< double >, double > &yCloud, int k, double candidateCutoff, int typeI, std::vector< double > &xyz, std::vector< int > &nom)
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)

Detailed Description

Header file for neighbour list generation.

Definition in file neighbours.hpp.