Changeset 20895b for molecuilder/src/analysis_correlation.cpp
- Timestamp:
- Nov 4, 2009, 5:34:05 PM (16 years ago)
- Children:
- 5f1d021
- Parents:
- c1b76e
- File:
-
- 1 edited
-
molecuilder/src/analysis_correlation.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/analysis_correlation.cpp
rc1b76e r20895b 52 52 if (Walker->nr < OtherWalker->nr) 53 53 if ((type2 == NULL) || (OtherWalker->type == type2)) { 54 distance = Walker->node-> Distance(OtherWalker->node);54 distance = Walker->node->PeriodicDistance(OtherWalker->node, (*MolWalker)->cell_size); 55 55 //*out << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl; 56 56 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) ); … … 90 90 *out << Verbose(3) << "Current atom is " << *Walker << "." << endl; 91 91 if ((type == NULL) || (Walker->type == type)) { 92 distance = Walker->node-> Distance(point);92 distance = Walker->node->PeriodicDistance(point, (*MolWalker)->cell_size); 93 93 *out << Verbose(4) << "Current distance is " << distance << "." << endl; 94 94 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) ); … … 111 111 { 112 112 CorrelationToSurfaceMap *outmap = NULL; 113 double distance = 0 .;113 double distance = 0; 114 114 class BoundaryTriangleSet *triangle = NULL; 115 115 Vector centroid; 116 int ranges[NDIM] = {1, 1, 1}; 117 int n[NDIM]; 118 Vector periodicX; 119 Vector checkX; 116 120 117 121 if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) { … … 122 126 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 123 127 if ((*MolWalker)->ActiveFlag) { 128 const double * const FullMatrix = ReturnFullMatrixforSymmetric((*MolWalker)->cell_size); 129 const double * const FullInverseMatrix = InverseMatrix(FullMatrix); 124 130 *out << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl; 125 131 atom *Walker = (*MolWalker)->start; … … 128 134 *out << Verbose(3) << "Current atom is " << *Walker << "." << endl; 129 135 if ((type == NULL) || (Walker->type == type)) { 130 triangle = Surface->FindClosestTriangleToPoint(out, Walker->node, LC ); 131 if (triangle != NULL) { 132 distance = DistanceToTrianglePlane(out, Walker->node, triangle); 133 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> (Walker, triangle) ) ); 136 periodicX.CopyVector(Walker->node); 137 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 138 // go through every range in xyz and get distance 139 for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++) 140 for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++) 141 for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) { 142 checkX.Init(n[0], n[1], n[2]); 143 checkX.AddVector(&periodicX); 144 checkX.MatrixMultiplication(FullMatrix); 145 triangle = Surface->FindClosestTriangleToPoint(out, &checkX, LC ); 146 if (triangle != NULL) { 147 distance = DistanceToTrianglePlane(out, &checkX, triangle); 148 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> (Walker, triangle) ) ); 149 } 134 150 } 135 151 }
Note:
See TracChangeset
for help on using the changeset viewer.
