NNFinder
-
class NNFinder
Nearest Neighbor Finder that constructs a full nearest neighbor list for every atom in a structure, using:
a binned (linked-cell) approach if every cell dimension ≥ cutoff,
a naive approach otherwise (fallback).
The cutoff is from context(“RCUTMAX”).
Public Functions
-
void num_shifts(const Structure &st, int N[3], double cutoff) const
Compute ±N to consider for image shifts.
Remove duplicates from the neighbor list.
Naive approach to build neighbor lists.
Binning-based approach. If any dimension < cutoff, fallback to naive.
-
NNFinder() = default
Construct with cutoff from context(“RCUTMAX”).
-
NNTablePtr build(Structure &st, double cutoff) const
Build nearest neighbors for all atoms in one Structure. Uses binned approach if possible, else naive fallback.
-
NNTablePtr build(Structure &st, const core::Context &context) const
Build nearest neighbors for all atoms in one Structure. Uses context(“RCUTMAX”) to determine the cutoff.
- Parameters:
st – Structure to build neighbors for.
context – Context to get the cutoff from.
-
void calc(Structure &st, double cutoff) const
Build nearest neighbors for all atoms in one Structure. Uses binned approach if possible, else naive fallback.
- Parameters:
st – Structure to build neighbors for.
cutoff – Cutoff distance for neighbor search.
-
void calc(Structure &st, const core::Context &context) const
Build nearest neighbors for all atoms in one Structure. Uses binned approach if possible, else naive fallback.
- Parameters:
st – Structure to build neighbors for.
cutoff – Cutoff distance for neighbor search.
-
void calc(StructureDB &stdb, double cutoff) const
Build nearest neighbors for each structure in a DB.
-
void calc(StructureDB &stdb, const core::Context &context) const
Build nearest neighbors for each structure in a DB. Uses context(“RCUTMAX”) to determine the cutoff.
- Parameters:
stdb – StructureDB to build neighbors for.
context – Context to get the cutoff from.