Changes in src/linkedcell.cpp [bdc91e:36166d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/linkedcell.cpp
rbdc91e r36166d 10 10 #include "helpers.hpp" 11 11 #include "linkedcell.hpp" 12 #include "verbose.hpp" 12 13 #include "log.hpp" 13 14 #include "molecule.hpp" … … 187 188 N[i] = 0; 188 189 index = -1; 190 max.Zero(); 191 min.Zero(); 189 192 }; 190 193 … … 197 200 for(int i=0;i<NDIM;i++) 198 201 status = status && ((n[i] >=0) && (n[i] < N[i])); 199 //if (!status)200 //DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl);202 if (!status) 203 DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl); 201 204 return status; 202 205 }; … … 277 280 278 281 /** Calculates the interval bounds of the linked cell grid. 279 * \param lower lower bounds280 * \param upper upper bounds282 * \param *lower lower bounds 283 * \param *upper upper bounds 281 284 * \param step how deep to check the neighbouring cells (i.e. number of layers to check) 282 285 */ … … 284 287 { 285 288 for (int i=0;i<NDIM;i++) { 286 lower[i] = n[i]-step; 287 if (lower[i] < 0) 288 lower[i] = 0; 289 if (lower[i] >= N[i]) 290 lower[i] = N[i]-1; 291 upper[i] = n[i]+step; 292 if (upper[i] >= N[i]) 293 upper[i] = N[i]-1; 294 if (upper[i] < 0) 295 upper[i] = 0; 289 lower[i] = n[i]; 290 for (int s=step; s>0;--s) 291 if ((n[i]-s) >= 0) { 292 lower[i] = n[i]-s; 293 break; 294 } 295 upper[i] = n[i]; 296 for (int s=step; s>0;--s) 297 if ((n[i]+s) < N[i]) { 298 upper[i] = n[i]+s; 299 break; 300 } 296 301 //Log() << Verbose(0) << "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]" << endl; 297 302 }
Note:
See TracChangeset
for help on using the changeset viewer.