Changes in src/analysis_correlation.cpp [1513a74:7fd416]
- File:
-
- 1 edited
-
src/analysis_correlation.cpp (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/analysis_correlation.cpp
r1513a74 r7fd416 39 39 return outmap; 40 40 } 41 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 42 (*MolWalker)->doCountAtoms(); 41 43 outmap = new PairCorrelationMap; 42 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 44 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++){ 43 45 if ((*MolWalker)->ActiveFlag) { 44 46 DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 45 atom *Walker = (*MolWalker)->start; 46 while (Walker->next != (*MolWalker)->end) { 47 Walker = Walker->next; 48 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 49 if ((type1 == NULL) || (Walker->type == type1)) { 50 for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++) 47 eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl; 48 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 49 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl); 50 if ((type1 == NULL) || ((*iter)->type == type1)) { 51 for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++){ 51 52 if ((*MolOtherWalker)->ActiveFlag) { 52 53 DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl); 53 atom *OtherWalker = (*MolOtherWalker)->start; 54 while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker 55 OtherWalker = OtherWalker->next; 56 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl); 57 if (Walker->nr < OtherWalker->nr) 58 if ((type2 == NULL) || (OtherWalker->type == type2)) { 59 distance = Walker->node->PeriodicDistance(*OtherWalker->node, World::getInstance().getDomain()); 60 //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl; 61 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) ); 54 for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) { 55 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl); 56 if ((*iter)->getId() < (*runner)->getId()){ 57 if ((type2 == NULL) || ((*runner)->type == type2)) { 58 distance = (*iter)->node->PeriodicDistance(*(*runner)->node, World::getInstance().getDomain()); 59 //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl; 60 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) ); 62 61 } 62 } 63 63 } 64 } 64 65 } 65 66 } 66 67 } 67 68 } 68 69 } 69 70 return outmap; 70 71 }; … … 95 96 return outmap; 96 97 } 98 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 99 (*MolWalker)->doCountAtoms(); 97 100 outmap = new PairCorrelationMap; 98 101 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) … … 101 104 double * FullInverseMatrix = InverseMatrix(FullMatrix); 102 105 DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 103 atom *Walker = (*MolWalker)->start; 104 while (Walker->next != (*MolWalker)->end) { 105 Walker = Walker->next; 106 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 107 if ((type1 == NULL) || (Walker->type == type1)) { 108 periodicX = *(Walker->node); 106 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 107 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl); 108 if ((type1 == NULL) || ((*iter)->type == type1)) { 109 periodicX = *(*iter)->node; 109 110 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 110 111 // go through every range in xyz and get distance … … 117 118 if ((*MolOtherWalker)->ActiveFlag) { 118 119 DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl); 119 atom *OtherWalker = (*MolOtherWalker)->start; 120 while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker 121 OtherWalker = OtherWalker->next; 122 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl); 123 if (Walker->nr < OtherWalker->nr) 124 if ((type2 == NULL) || (OtherWalker->type == type2)) { 125 periodicOtherX = *(OtherWalker->node); 120 for (molecule::const_iterator runner = (*MolOtherWalker)->begin(); runner != (*MolOtherWalker)->end(); ++runner) { 121 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << **runner << "." << endl); 122 if ((*iter)->nr < (*runner)->nr) 123 if ((type2 == NULL) || ((*runner)->type == type2)) { 124 periodicOtherX = *(*runner)->node; 126 125 periodicOtherX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 127 126 // go through every range in xyz and get distance … … 132 131 checkOtherX.MatrixMultiplication(FullMatrix); 133 132 distance = checkX.distance(checkOtherX); 134 //Log() << Verbose(1) <<"Inserting " << * Walker << " and " << *OtherWalker<< endl;135 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ( Walker, OtherWalker) ) );133 //Log() << Verbose(1) <<"Inserting " << *(*iter) << " and " << *(*runner) << endl; 134 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> ((*iter), (*runner)) ) ); 136 135 } 137 136 } … … 141 140 } 142 141 } 143 Free(&FullMatrix);144 Free(&FullInverseMatrix);142 delete[](FullMatrix); 143 delete[](FullInverseMatrix); 145 144 } 146 145 … … 165 164 return outmap; 166 165 } 166 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 167 (*MolWalker)->doCountAtoms(); 167 168 outmap = new CorrelationToPointMap; 168 169 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 169 170 if ((*MolWalker)->ActiveFlag) { 170 171 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 171 atom *Walker = (*MolWalker)->start; 172 while (Walker->next != (*MolWalker)->end) { 173 Walker = Walker->next; 174 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 175 if ((type == NULL) || (Walker->type == type)) { 176 distance = Walker->node->PeriodicDistance(*point, World::getInstance().getDomain()); 172 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 173 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl); 174 if ((type == NULL) || ((*iter)->type == type)) { 175 distance = (*iter)->node->PeriodicDistance(*point, World::getInstance().getDomain()); 177 176 DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl); 178 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> ( Walker, point) ) );177 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> ((*iter), point) ) ); 179 178 } 180 179 } … … 205 204 return outmap; 206 205 } 206 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 207 (*MolWalker)->doCountAtoms(); 207 208 outmap = new CorrelationToPointMap; 208 209 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) … … 211 212 double * FullInverseMatrix = InverseMatrix(FullMatrix); 212 213 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 213 atom *Walker = (*MolWalker)->start; 214 while (Walker->next != (*MolWalker)->end) { 215 Walker = Walker->next; 216 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 217 if ((type == NULL) || (Walker->type == type)) { 218 periodicX = *(Walker->node); 214 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 215 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl); 216 if ((type == NULL) || ((*iter)->type == type)) { 217 periodicX = *(*iter)->node; 219 218 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 220 219 // go through every range in xyz and get distance … … 226 225 distance = checkX.distance(*point); 227 226 DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl); 228 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> ( Walker, point) ) );227 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (*iter, point) ) ); 229 228 } 230 229 } 231 230 } 232 Free(&FullMatrix);233 Free(&FullInverseMatrix);231 delete[](FullMatrix); 232 delete[](FullInverseMatrix); 234 233 } 235 234 … … 257 256 return outmap; 258 257 } 258 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 259 (*MolWalker)->doCountAtoms(); 259 260 outmap = new CorrelationToSurfaceMap; 260 261 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 261 262 if ((*MolWalker)->ActiveFlag) { 262 263 DoLog(1) && (Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl); 263 atom *Walker = (*MolWalker)->start;264 while (Walker->next != (*MolWalker)->end) {265 Walker = Walker->next;266 //Log() << Verbose(1) << "Current atom is " << *Walker << "." << endl;267 if ((type == NULL) || ( Walker->type == type)) {268 TriangleIntersectionList Intersections( Walker->node,Surface,LC);264 if ((*MolWalker)->empty()) 265 DoLog(1) && (1) && (Log() << Verbose(1) << "\t is empty." << endl); 266 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 267 DoLog(1) && (Log() << Verbose(1) << "\tCurrent atom is " << *(*iter) << "." << endl); 268 if ((type == NULL) || ((*iter)->type == type)) { 269 TriangleIntersectionList Intersections((*iter)->node,Surface,LC); 269 270 distance = Intersections.GetSmallestDistance(); 270 271 triangle = Intersections.GetClosestTriangle(); 271 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> ( Walker, triangle) ) );272 } 273 } 274 } else 272 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> ((*iter), triangle) ) ); 273 } 274 } 275 } else { 275 276 DoLog(1) && (Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl); 277 } 276 278 277 279 return outmap; … … 306 308 return outmap; 307 309 } 310 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 311 (*MolWalker)->doCountAtoms(); 308 312 outmap = new CorrelationToSurfaceMap; 309 313 double ShortestDistance = 0.; … … 314 318 double * FullInverseMatrix = InverseMatrix(FullMatrix); 315 319 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 316 atom *Walker = (*MolWalker)->start; 317 while (Walker->next != (*MolWalker)->end) { 318 Walker = Walker->next; 319 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 320 if ((type == NULL) || (Walker->type == type)) { 321 periodicX = *(Walker->node); 320 for (molecule::const_iterator iter = (*MolWalker)->begin(); iter != (*MolWalker)->end(); ++iter) { 321 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << **iter << "." << endl); 322 if ((type == NULL) || ((*iter)->type == type)) { 323 periodicX = *(*iter)->node; 322 324 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 323 325 // go through every range in xyz and get distance … … 337 339 } 338 340 // insert 339 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> ( Walker, ShortestTriangle) ) );341 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> (*iter, ShortestTriangle) ) ); 340 342 //Log() << Verbose(1) << "INFO: Inserting " << Walker << " with distance " << ShortestDistance << " to " << *ShortestTriangle << "." << endl; 341 343 } 342 344 } 343 Free(&FullMatrix);344 Free(&FullInverseMatrix);345 delete[](FullMatrix); 346 delete[](FullInverseMatrix); 345 347 } 346 348
Note:
See TracChangeset
for help on using the changeset viewer.
