Changes in src/molecule_graph.cpp [e5ad5c:e359a8]
- File:
-
- 1 edited
-
src/molecule_graph.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_graph.cpp
re5ad5c re359a8 147 147 for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) { 148 148 const LinkedNodes *List = LC->GetCurrentCell(); 149 //Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;149 //Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl; 150 150 if (List != NULL) { 151 151 for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 152 152 Walker = AtomMap[(*Runner)->nr]; 153 //Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl;153 //Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl; 154 154 // 3c. check for possible bond between each atom in this and every one in the 27 cells 155 155 for (n[0] = -1; n[0] <= 1; n[0]++) … … 157 157 for (n[2] = -1; n[2] <= 1; n[2]++) { 158 158 const LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n); 159 //Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;159 //Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl; 160 160 if (OtherList != NULL) { 161 161 for (LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) { 162 162 if ((*OtherRunner)->nr > Walker->nr) { 163 163 OtherWalker = AtomMap[(*OtherRunner)->nr]; 164 // Log() << Verbose(0) << "Current other Atom is " << *OtherWalker << "." << endl; 164 //Log() << Verbose(1) << "Checking distance " << OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size) << " against typical bond length of " << bonddistance*bonddistance << "." << endl; 165 (BG->*minmaxdistance)(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem); 165 166 const double distance = OtherWalker->x.PeriodicDistanceSquared(&(Walker->x), cell_size); 166 // Log() << Verbose(1) << "Checking distance " << distance << " against typical bond length of " << bonddistance*bonddistance << "." << endl;167 (BG->*minmaxdistance)(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem);168 167 const bool status = (distance <= MaxDistance * MaxDistance) && (distance >= MinDistance * MinDistance); 169 // Log() << Verbose(1) << "MinDistance is " << MinDistance << " and MaxDistance is " << MaxDistance << "." << endl; 170 if (OtherWalker->father->nr > Walker->father->nr) { 171 if (status) { // create bond if distance is smaller 172 // Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl; 173 AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount 174 } else { 175 // Log() << Verbose(1) << "Not Adding: distance too great." << endl; 176 } 168 if ((OtherWalker->father->nr > Walker->father->nr) && (status)) { // create bond if distance is smaller 169 //Log() << Verbose(1) << "Adding Bond between " << *Walker << " and " << *OtherWalker << " in distance " << sqrt(distance) << "." << endl; 170 AddBond(Walker->father, OtherWalker->father, 1); // also increases molecule::BondCount 177 171 } else { 178 // Log() << Verbose(1) << "Not Adding: Wrong order of labels." << endl;172 //Log() << Verbose(1) << "Not Adding: Wrong label order or distance too great." << endl; 179 173 } 180 174 } … … 932 926 break; // breaking here will not cause error! 933 927 } 934 if (i == vertex->ListOfBonds.size()) 928 if (i == vertex->ListOfBonds.size()) { 935 929 eLog() << Verbose(0) << "Error: All Component entries are already occupied!" << endl; 936 } else 930 performCriticalExit(); 931 } 932 } else { 937 933 eLog() << Verbose(0) << "Error: Given vertex is NULL!" << endl; 934 performCriticalExit(); 935 } 938 936 } 939 937 ; … … 1120 1118 if (ReferenceStack->IsEmpty()) { 1121 1119 eLog() << Verbose(0) << "ReferenceStack is empty!" << endl; 1120 performCriticalExit(); 1122 1121 return false; 1123 1122 }
Note:
See TracChangeset
for help on using the changeset viewer.
