Changeset 872b51 for molecuilder/src/moleculelist.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
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/moleculelist.cpp
rb0ee98 r872b51 376 376 atom *Walker = NULL; 377 377 atom *Runner = NULL; 378 bond *Binder = NULL; 378 379 double ***FitConstant = NULL, **correction = NULL; 379 380 int a, b; … … 482 483 while (Walker->next != (*ListRunner)->end) { 483 484 Walker = Walker->next; 484 //cout << Verbose(1) << "Walker: " << *Walker << " with first bond " << *( *Runner)->ListOfBondsPerAtom[Walker->nr][0]<< "." << endl;485 //cout << Verbose(1) << "Walker: " << *Walker << " with first bond " << *(Walker->ListOfBonds.begin()) << "." << endl; 485 486 if ((Walker->type->Z == 1) && ((Walker->father == NULL) 486 487 || (Walker->father->type->Z != 1))) { // if it's a hydrogen … … 488 489 while (Runner->next != (*ListRunner)->end) { 489 490 Runner = Runner->next; 490 //cout << Verbose(2) << "Runner: " << *Runner << " with first bond " << *( *Runner)->ListOfBondsPerAtom[Runner->nr][0]<< "." << endl;491 //cout << Verbose(2) << "Runner: " << *Runner << " with first bond " << *(Walker->ListOfBonds.begin()) << "." << endl; 491 492 // 3. take every other hydrogen that is the not the first and not bound to same bonding partner 492 if ((Runner->type->Z == 1) && (Runner->nr > Walker->nr) && ((*ListRunner)->ListOfBondsPerAtom[Runner->nr][0]->GetOtherAtom(Runner) != (*ListRunner)->ListOfBondsPerAtom[Walker->nr][0]->GetOtherAtom(Walker))) { // (hydrogens have only one bonding partner!) 493 Binder = *(Runner->ListOfBonds.begin()); 494 if ((Runner->type->Z == 1) && (Runner->nr > Walker->nr) && (Binder->GetOtherAtom(Runner) != Binder->GetOtherAtom(Walker))) { // (hydrogens have only one bonding partner!) 493 495 // 4. evaluate the morse potential for each matrix component and add up 494 496 distance = Runner->x.Distance(&Walker->x); … … 812 814 bool MoleculeLeafClass::FillBondStructureFromReference(ofstream *out, molecule *reference, int &FragmentCounter, atom ***&ListOfLocalAtoms, bool FreeList) 813 815 { 814 atom *Walker = NULL, *OtherWalker = NULL; 815 bond *Binder = NULL; 816 atom *Walker = NULL; 817 atom *OtherWalker = NULL; 818 atom *Father = NULL; 816 819 bool status = true; 817 820 int AtomNo; … … 830 833 while (Walker->next != Leaf->end) { 831 834 Walker = Walker->next; 832 AtomNo = Walker->GetTrueFather()->nr; // global id of the current walker833 for (int i = 0; i < reference->NumberOfBondsPerAtom[AtomNo]; i++) { // go through father's bonds and copy them all834 Binder = reference->ListOfBondsPerAtom[AtomNo][i];835 OtherWalker = ListOfLocalAtoms[FragmentCounter][ Binder->GetOtherAtom(Walker->GetTrueFather())->nr]; // local copy of current bond partner of walker835 Father = Walker->GetTrueFather(); 836 AtomNo = Father->nr; // global id of the current walker 837 for (BondList::const_iterator Runner = Father->ListOfBonds.begin(); Runner != Father->ListOfBonds.end(); (++Runner)) { 838 OtherWalker = ListOfLocalAtoms[FragmentCounter][(*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr]; // local copy of current bond partner of walker 836 839 if (OtherWalker != NULL) { 837 840 if (OtherWalker->nr > Walker->nr) 838 Leaf->AddBond(Walker, OtherWalker, Binder->BondDegree);841 Leaf->AddBond(Walker, OtherWalker, (*Runner)->BondDegree); 839 842 } else { 840 *out << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << Binder->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl;843 *out << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << (*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl; 841 844 status = false; 842 845 } 843 846 } 844 847 } 845 Leaf->CreateListOfBondsPerAtom(out);846 848 FragmentCounter++; 847 849 if (next != NULL)
Note:
See TracChangeset
for help on using the changeset viewer.