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