32 int typeI,
int typeJ) {
33 std::vector<std::vector<int>> nList;
41 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
43 auto itr = std::find_if(
44 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
45 [&iatom](
const std::pair<int, int> &p) { return p.second == iatom; });
47 if (itr == yCloud->idIndexMap.end()) {
48 std::cerr <<
"Something is wrong with your idIndexMap!\n";
51 iatomIndex = itr->first;
54 nList.push_back(std::vector<int>());
56 nList[iatom].push_back(iatomIndex);
61 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
62 if (yCloud->pts[iatom].type != typeI) {
66 for (
int jatom = 0; jatom < yCloud->nop; jatom++) {
67 if (yCloud->pts[jatom].type != typeJ) {
77 auto gotI = std::find_if(
78 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
79 [&iatom](
const std::pair<int, int> &p) { return p.second == iatom; });
80 if (gotI == yCloud->idIndexMap.end()) {
81 std::cerr <<
"Something is wrong with your idIndexMap!\n";
84 iatomIndex = gotI->first;
87 auto gotJ = std::find_if(
88 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
89 [&jatom](
const std::pair<int, int> &p) { return p.second == jatom; });
90 if (gotJ == yCloud->idIndexMap.end()) {
91 std::cerr <<
"Something is wrong with your idIndexMap!\n";
94 jatomIndex = gotJ->first;
98 nList[iatom].push_back(jatomIndex);
99 nList[jatom].push_back(iatomIndex);
121 std::vector<std::vector<int>>
127 std::vector<int> tempListIatom;
131 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
133 auto itr = std::find_if(
134 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
135 [&iatom](
const std::pair<int, int> &p) { return p.second == iatom; });
137 if (itr == yCloud->idIndexMap.end()) {
138 std::cerr <<
"Something is wrong with your idIndexMap!\n";
141 iatomIndex = itr->first;
144 nList.push_back(std::vector<int>());
146 nList[iatom].push_back(iatomIndex);
150 for (
int iatom = 0; iatom < yCloud->nop - 1; iatom++) {
151 if (yCloud->pts[iatom].type != typeI) {
155 for (
int jatom = iatom + 1; jatom < yCloud->nop; jatom++) {
156 if (yCloud->pts[jatom].type != typeI) {
161 if (r_ij > rcutoff) {
166 auto gotI = std::find_if(
167 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
168 [&iatom](
const std::pair<int, int> &p) { return p.second == iatom; });
169 if (gotI == yCloud->idIndexMap.end()) {
170 std::cerr <<
"Something is wrong with your idIndexMap!\n";
173 iatomIndex = gotI->first;
176 auto gotJ = std::find_if(
177 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
178 [&jatom](
const std::pair<int, int> &p) { return p.second == jatom; });
179 if (gotJ == yCloud->idIndexMap.end()) {
180 std::cerr <<
"Something is wrong with your idIndexMap!\n";
183 jatomIndex = gotJ->first;
187 nList[iatom].push_back(jatomIndex);
188 nList[jatom].push_back(iatomIndex);
210 std::vector<std::vector<int>>
216 std::vector<int> tempListIatom;
220 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
222 auto itr = std::find_if(
223 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
224 [&iatom](
const std::pair<int, int> &p) { return p.second == iatom; });
226 if (itr == yCloud->idIndexMap.end()) {
227 std::cerr <<
"Something is wrong with your idIndexMap!\n";
230 iatomIndex = itr->first;
233 nList.push_back(std::vector<int>());
235 nList[iatom].push_back(iatomIndex);
239 for (
int iatom = 0; iatom < yCloud->nop - 1; iatom++) {
240 if (yCloud->pts[iatom].type != typeI) {
244 for (
int jatom = iatom + 1; jatom < yCloud->nop; jatom++) {
245 if (yCloud->pts[jatom].type != typeI) {
250 if (r_ij > rcutoff) {
255 auto gotI = std::find_if(
256 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
257 [&iatom](
const std::pair<int, int> &p) { return p.second == iatom; });
258 if (gotI == yCloud->idIndexMap.end()) {
259 std::cerr <<
"Something is wrong with your idIndexMap!\n";
262 iatomIndex = gotI->first;
265 auto gotJ = std::find_if(
266 yCloud->idIndexMap.begin(), yCloud->idIndexMap.end(),
267 [&jatom](
const std::pair<int, int> &p) { return p.second == jatom; });
268 if (gotJ == yCloud->idIndexMap.end()) {
269 std::cerr <<
"Something is wrong with your idIndexMap!\n";
272 jatomIndex = gotJ->first;
276 nList[iatom].push_back(jatomIndex);
297 std::vector<std::vector<int>> nList;
299 std::vector<int> tempListIatom;
303 for (
int iatom = 0; iatom < yCloud->nop; iatom++) {
305 nList.push_back(std::vector<int>());
307 nList[iatom].push_back(iatom);
311 for (
int iatom = 0; iatom < yCloud->nop - 1; iatom++) {
313 for (
int jatom = iatom + 1; jatom < yCloud->nop; jatom++) {
322 nList[iatom].push_back(jatom);
323 nList[jatom].push_back(iatom);
343 std::vector<std::vector<int>> nList) {
345 std::vector<std::vector<int>> indexNlist;
346 int iatomID, jatomID;
347 int iatomIndex, jatomIndex;
352 for (
int iatom = 0; iatom < nList.size(); iatom++) {
353 iatomID = nList[iatom][0];
355 auto gotI = yCloud->idIndexMap.find(iatomID);
356 if (gotI != yCloud->idIndexMap.end()) {
357 iatomIndex = gotI->second;
360 nnumNeighbours = nList[iatomIndex].size() - 1;
362 indexNlist.push_back(
365 indexNlist[iatom].push_back(iatomIndex);
368 for (
int jatom = 1; jatom <= nnumNeighbours; jatom++) {
369 jatomID = nList[iatomIndex][jatom];
372 auto gotJ = yCloud->idIndexMap.find(jatomID);
373 if (gotJ != yCloud->idIndexMap.end()) {
374 jatomIndex = gotJ->second;
377 indexNlist[iatom].push_back(jatomIndex);
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.