Changeset 342fbc9 for molecuilder/src
- Timestamp:
- Apr 20, 2010, 9:21:51 AM (15 years ago)
- Children:
- 086db0
- Parents:
- adff53
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/linkedcell.cpp
radff53 r342fbc9 280 280 * \param *lower lower bounds 281 281 * \param *upper upper bounds 282 * \param step how deep to check the neighbouring cells (i.e. number of layers to check) 282 283 */ 283 284 void LinkedCell::GetNeighbourBounds(int lower[NDIM], int upper[NDIM], int step) const 284 285 { 285 286 for (int i=0;i<NDIM;i++) { 286 lower[i] = 0;287 lower[i] = n[i]; 287 288 for (int s=step; s>0;--s) 288 289 if ((n[i]-s) >= 0) { … … 290 291 break; 291 292 } 292 upper[i] = 0;293 upper[i] = n[i]; 293 294 for (int s=step; s>0;--s) 294 295 if ((n[i]+s) < N[i]) { … … 296 297 break; 297 298 } 298 //Log() << Verbose(0) << " [" << lower[i] << "," << upper[i] << "] ";299 // check for this axis whether the point is outside of our grid300 if (n[i] < 0)301 upper[i] = lower[i];302 if (n[i] > N[i])303 lower[i] = upper[i];304 305 299 //Log() << Verbose(0) << "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]" << endl; 306 300 } … … 401 395 // set index of LC to center of sphere 402 396 const double dist = SetClosestIndexToOutsideVector(center); 403 if (dist > radius) {397 if (dist > 2.*radius) { 404 398 DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << *center << " is too far away from any atom in LinkedCell's bounding box." << endl); 405 399 return TesselList; 406 } 400 } else 401 Log() << Verbose(1) << "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "." << endl; 407 402 408 403 // gather all neighbours first, then look who fulfills distance criteria 409 NeighbourList = GetallNeighbours(radius-dist); 404 NeighbourList = GetallNeighbours(2.*radius-dist); 405 //Log() << Verbose(1) << "I found " << NeighbourList->size() << " neighbours to check." << endl; 410 406 if (NeighbourList != NULL) { 411 407 for (LinkedNodes::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) { 412 408 Walker = *Runner; 409 //Log() << Verbose(1) << "Current neighbour is at " << *Walker->node << "." << endl; 413 410 if ((center->DistanceSquared(Walker->node) - radiusSquared) < MYEPSILON) { 414 411 TesselList->push_back(Walker);
Note:
See TracChangeset
for help on using the changeset viewer.