Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linkedcell.cpp

    r36166d rbdc91e  
    1010#include "helpers.hpp"
    1111#include "linkedcell.hpp"
    12 #include "verbose.hpp"
    1312#include "log.hpp"
    1413#include "molecule.hpp"
     
    188187    N[i] = 0;
    189188  index = -1;
    190   max.Zero();
    191   min.Zero();
    192189};
    193190
     
    200197  for(int i=0;i<NDIM;i++)
    201198    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);
    204201  return status;
    205202};
     
    280277
    281278/** Calculates the interval bounds of the linked cell grid.
    282  * \param *lower lower bounds
    283  * \param *upper upper bounds
     279 * \param lower lower bounds
     280 * \param upper upper bounds
    284281 * \param step how deep to check the neighbouring cells (i.e. number of layers to check)
    285282 */
     
    287284{
    288285  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;
    301296    //Log() << Verbose(0) << "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]" << endl;
    302297  }
Note: See TracChangeset for help on using the changeset viewer.