65 HGrid(
int num_buckets,
double cellOverSizeRatio, std::vector<double>& cellSizes);
void InsertParticleToHgrid(BaseParticle *obj)
This insert a particle given by CParticle in to the HGrid (i.e. it sets up the particle grid properts...
Mdouble cellOverSizeRatio_
~HGrid()
constructor: initializes parameters and allocates space for internal variables
void reset_num_buckets(int new_num_buckets)
int NUM_BUCKETS
Number of buckets used for hashing.
std::vector< double > invCellSizes_
std::vector< double > cellSizes_
This is the HGRID class - This is the actually HGRID code.
int ComputeHashBucketIndex(int x, int y, int z, int l)
Computes hash bucket index in range [0, NUM_BUCKETS-1].
void Initialize_inv_size()
bool * bucketIsChecked
bucketIsChecked[b] stores if hash bucket b is checked already; initially all zero ...
int occupiedLevelsMask
l-th bit of occupiedLevelsMask is 1 if level l is contains particles; initially zero (Implies max 32 ...
BaseParticle ** objectBucket
objectBucket[b] stores pointer to first element in hash bucket b; initially all NULL ...