21 std::vector<uint64_t> forAtoms,
22 std::vector<Atom> & atoms,
26 if (cutOff <= 0.0f || forAtoms.size() == 0) {
return {}; }
28 std::map<uint64_t, std::set<uint64_t>> bonds;
32 for (uint64_t i : forAtoms)
34 auto nn = n.
neighbours(atoms, atoms[forAtoms[i]].position, cutOff);
35 for (uint64_t j = 1; j < nn.size(); j++)
37 auto s = bonds[nn[j].first];
38 if (s.find(i) == s.cend())
40 bonds[i].insert(nn[j].first);
std::map< uint64_t, std::set< uint64_t > > determineBonds(std::vector< uint64_t > forAtoms, std::vector< Atom > &atoms, float cutOff)
Obtain bonds based on a fixed distance cutOff using Neighbours.
Definition bond.h:20
std::vector< std::pair< uint64_t, float > > neighbours(const std::vector< Atom > &atoms, glm::vec3 position, float cutoff, bool noDirect=false, bool nearestImage=true) const
Get the neighbours to a position within a cutoff using the spatial domains.
Definition neighbours.h:109