28 int typeI,
int typeJ) {
37 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
40 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
43 if (itr == yCloud->idIndexMap.end()) {
44 std::cerr <<
"Something is wrong with your idIndexMap!\n";
47 iatomIndex = itr->first;
57 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
58 if (yCloud->pts[iatom].type != typeI) {
62 for (
int jatom = 0; jatom < yCloud->nop; jatom++) {
63 if (yCloud->pts[jatom].type != typeJ) {
74 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
76 if (gotI == yCloud->idIndexMap.end()) {
77 std::cerr <<
"Something is wrong with your idIndexMap!\n";
80 iatomIndex = gotI->first;
84 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
86 if (gotJ == yCloud->idIndexMap.end()) {
87 std::cerr <<
"Something is wrong with your idIndexMap!\n";
90 jatomIndex = gotJ->first;
127 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
130 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
133 if (itr == yCloud->idIndexMap.end()) {
134 std::cerr <<
"Something is wrong with your idIndexMap!\n";
137 iatomIndex = itr->first;
146 for (
int iatom = 0; iatom < yCloud->nop - 1; iatom++) {
147 if (yCloud->pts[iatom].type != typeI) {
151 for (
int jatom = iatom + 1; jatom < yCloud->nop; jatom++) {
152 if (yCloud->pts[jatom].type != typeI) {
157 if (r_ij > rcutoff) {
163 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
165 if (gotI == yCloud->idIndexMap.end()) {
166 std::cerr <<
"Something is wrong with your idIndexMap!\n";
169 iatomIndex = gotI->first;
173 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
175 if (gotJ == yCloud->idIndexMap.end()) {
176 std::cerr <<
"Something is wrong with your idIndexMap!\n";
179 jatomIndex = gotJ->first;
216 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
219 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
222 if (itr == yCloud->idIndexMap.end()) {
223 std::cerr <<
"Something is wrong with your idIndexMap!\n";
226 iatomIndex = itr->first;
235 for (
int iatom = 0; iatom < yCloud->nop - 1; iatom++) {
236 if (yCloud->pts[iatom].type != typeI) {
240 for (
int jatom = iatom + 1; jatom < yCloud->nop; jatom++) {
241 if (yCloud->pts[jatom].type != typeI) {
246 if (r_ij > rcutoff) {
252 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
254 if (gotI == yCloud->idIndexMap.end()) {
255 std::cerr <<
"Something is wrong with your idIndexMap!\n";
258 iatomIndex = gotI->first;
262 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
264 if (gotJ == yCloud->idIndexMap.end()) {
265 std::cerr <<
"Something is wrong with your idIndexMap!\n";
268 jatomIndex = gotJ->first;
299 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
307 for (
int iatom = 0; iatom < yCloud->nop - 1; iatom++) {
309 for (
int jatom = iatom + 1; jatom < yCloud->nop; jatom++) {
342 int iatomID, jatomID;
343 int iatomIndex, jatomIndex;
348 for (
int iatom = 0; iatom < nList.size(); iatom++) {
349 iatomID = nList[iatom][0];
351 auto gotI = yCloud->idIndexMap.find(iatomID);
352 if (gotI != yCloud->idIndexMap.end()) {
353 iatomIndex = gotI->second;
356 nnumNeighbours = nList[iatomIndex].
size() - 1;
364 for (
int jatom = 1; jatom <= nnumNeighbours; jatom++) {
365 jatomID = nList[iatomIndex][jatom];
368 auto gotJ = yCloud->idIndexMap.find(jatomID);
369 if (gotJ != yCloud->idIndexMap.end()) {
370 jatomIndex = gotJ->second;
391 nList.
swap(tempEmpty);
double periodicDist(molSys::PointCloud< molSys::Point< double >, double > *yCloud, int iatom, int jatom)
Inline generic function for obtaining the unwrapped periodic distance between two particles,...
std::vector< std::vector< int > > neighList(double rcutoff, 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 > > halfNeighList(double rcutoff, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int typeI=1)
std::vector< std::vector< int > > neighListO(double rcutoff, molSys::PointCloud< molSys::Point< double >, double > *yCloud, int typeI)
std::vector< std::vector< int > > neighbourListByIndex(molSys::PointCloud< molSys::Point< double >, double > *yCloud, std::vector< std::vector< int >> nList)
int clearNeighbourList(std::vector< std::vector< int >> &nList)
Erases memory for a vector of vectors for the neighbour list.
std::vector< std::vector< int > > getNewNeighbourListByIndex(molSys::PointCloud< molSys::Point< double >, double > *yCloud, double cutoff)
Header file for neighbour list generation.
This contains a collection of points; contains information for a particular frame.
This contains per-particle information.