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