Changeset 872b51 for molecuilder/src/molecule_geometry.cpp
- Timestamp:
- Oct 18, 2009, 2:51:38 PM (16 years ago)
- Children:
- 77894f
- Parents:
- b0ee98
- git-author:
- Frederik Heber <heber@…> (10/18/09 14:15:37)
- git-committer:
- Frederik Heber <heber@…> (10/18/09 14:51:38)
- File:
-
- 1 edited
-
molecuilder/src/molecule_geometry.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/molecule_geometry.cpp
rb0ee98 r872b51 258 258 { 259 259 atom *Walker = start; 260 bond *Binder = NULL;261 260 double *matrix = ReturnFullMatrixforSymmetric(cell_size); 262 261 double tmp; … … 275 274 Testvector.InverseMatrixMultiplication(matrix); 276 275 Translationvector.Zero(); 277 for (int i=0;i<NumberOfBondsPerAtom[Walker->nr]; i++) { 278 Binder = ListOfBondsPerAtom[Walker->nr][i]; 279 if (Walker->nr < Binder->GetOtherAtom(Walker)->nr) // otherwise we shift one to, the other fro and gain nothing 276 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 277 if (Walker->nr < (*Runner)->GetOtherAtom(Walker)->nr) // otherwise we shift one to, the other fro and gain nothing 280 278 for (int j=0;j<NDIM;j++) { 281 tmp = Walker->x.x[j] - Binder->GetOtherAtom(Walker)->x.x[j];279 tmp = Walker->x.x[j] - (*Runner)->GetOtherAtom(Walker)->x.x[j]; 282 280 if ((fabs(tmp)) > BondDistance) { 283 281 flag = false; 284 cout << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << * Binder<< " has to be shifted due to " << tmp << "." << endl;282 cout << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl; 285 283 if (tmp > 0) 286 284 Translationvector.x[j] -= 1.; … … 298 296 #ifdef ADDHYDROGEN 299 297 // now also change all hydrogens 300 for (int i=0;i<NumberOfBondsPerAtom[Walker->nr]; i++) { 301 Binder = ListOfBondsPerAtom[Walker->nr][i]; 302 if (Binder->GetOtherAtom(Walker)->type->Z == 1) { 303 Testvector.CopyVector(&Binder->GetOtherAtom(Walker)->x); 298 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 299 if ((*Runner)->GetOtherAtom(Walker)->type->Z == 1) { 300 Testvector.CopyVector(&(*Runner)->GetOtherAtom(Walker)->x); 304 301 Testvector.InverseMatrixMultiplication(matrix); 305 302 Testvector.AddVector(&Translationvector);
Note:
See TracChangeset
for help on using the changeset viewer.
