MercuryDPM
0.10
|
This is the HGRID class - This is the actually HGRID code. More...
#include <HGRID.h>
Public Member Functions | |
HGrid () | |
HGrid (int num_buckets, double cellOverSizeRatio, std::vector< double > &cellSizes) | |
constructor: initializes parameters and allocates space for internal variables More... | |
~HGrid () | |
constructor: initializes parameters and allocates space for internal variables More... | |
void | Initialize_inv_size () |
void | InsertParticleToHgrid (BaseParticle *obj) |
This insert a particle given by CParticle in to the HGrid (i.e. it sets up the particle grid properts updates the level information on the grid) More... | |
int | ComputeHashBucketIndex (int x, int y, int z, int l) |
Computes hash bucket index in range [0, NUM_BUCKETS-1]. More... | |
int | ComputeHashBucketIndex (int x, int y, int l) |
Computes hash bucket index in range [0, NUM_BUCKETS-1]. More... | |
void | reset_num_buckets (int new_num_buckets) |
Public Attributes | |
int | NUM_BUCKETS |
Number of buckets used for hashing. More... | |
std::vector< double > | cellSizes_ |
std::vector< double > | invCellSizes_ |
int | occupiedLevelsMask |
l-th bit of occupiedLevelsMask is 1 if level l is contains particles; initially zero (Implies max 32 hgrid levels) More... | |
BaseParticle ** | objectBucket |
objectBucket[b] stores pointer to first element in hash bucket b; initially all NULL More... | |
bool * | bucketIsChecked |
bucketIsChecked[b] stores if hash bucket b is checked already; initially all zero More... | |
Mdouble | cellOverSizeRatio_ |
HGrid::HGrid | ( | ) |
Definition at line 29 of file HGRID.cc.
References bucketIsChecked, and objectBucket.
HGrid::HGrid | ( | int | num_buckets, |
double | cellOverSizeRatio, | ||
std::vector< double > & | cellSizes | ||
) |
constructor: initializes parameters and allocates space for internal variables
Definition at line 36 of file HGRID.cc.
References bucketIsChecked, cellOverSizeRatio_, cellSizes_, NUM_BUCKETS, and objectBucket.
HGrid::~HGrid | ( | ) |
constructor: initializes parameters and allocates space for internal variables
Definition at line 52 of file HGRID.cc.
References bucketIsChecked, and objectBucket.
Computes hash bucket index in range [0, NUM_BUCKETS-1].
Definition at line 93 of file HGRID.cc.
References NUM_BUCKETS.
Referenced by HGRID_2D::CheckCell(), HGRID_3D::CheckCell(), HGRID_2D::CheckCell_current(), HGRID_3D::CheckCell_current(), HGRID_2D::HGRID_RemoveParticleFromHgrid(), HGRID_3D::HGRID_RemoveParticleFromHgrid(), HGRID_2D::HGRID_UpdateParticleInHgrid(), HGRID_3D::HGRID_UpdateParticleInHgrid(), Chute::IsInsertable(), HGRID_2D::TestCell(), and HGRID_3D::TestCell().
Computes hash bucket index in range [0, NUM_BUCKETS-1].
Definition at line 108 of file HGRID.cc.
References NUM_BUCKETS.
void HGrid::Initialize_inv_size | ( | ) |
Definition at line 57 of file HGRID.cc.
References cellSizes_, and invCellSizes_.
Referenced by HGRID_base::InitBroadPhase().
void HGrid::InsertParticleToHgrid | ( | BaseParticle * | obj | ) |
This insert a particle given by CParticle in to the HGrid (i.e. it sets up the particle grid properts updates the level information on the grid)
Definition at line 69 of file HGRID.cc.
References cellOverSizeRatio_, cellSizes_, BaseParticle::get_InteractionRadius(), occupiedLevelsMask, and BaseParticle::set_HGRID_Level().
Referenced by Chute::add_particle(), HGRID_base::HGRID_InsertParticleToHgrid(), and HGRID_base::InitBroadPhase().
void HGrid::reset_num_buckets | ( | int | new_num_buckets | ) |
Definition at line 124 of file HGRID.cc.
References bucketIsChecked, NUM_BUCKETS, and objectBucket.
bool* HGrid::bucketIsChecked |
bucketIsChecked[b] stores if hash bucket b is checked already; initially all zero
Definition at line 61 of file HGRID.h.
Referenced by HGRID_2D::CheckCell_current(), HGRID_3D::CheckCell_current(), HGrid(), HGRID_base::HGRID_actions_before_time_step(), HGRID_base::InitBroadPhase(), reset_num_buckets(), and ~HGrid().
Mdouble HGrid::cellOverSizeRatio_ |
Definition at line 84 of file HGRID.h.
Referenced by HGrid(), and InsertParticleToHgrid().
std::vector<double> HGrid::cellSizes_ |
Definition at line 50 of file HGRID.h.
Referenced by HGRID_2D::CheckObjAgainstGrid(), HGRID_3D::CheckObjAgainstGrid(), HGrid(), HGRID_base::HGRID_update_move(), Initialize_inv_size(), InsertParticleToHgrid(), HGRID_2D::TestObjAgainstGrid(), and HGRID_3D::TestObjAgainstGrid().
std::vector<double> HGrid::invCellSizes_ |
Definition at line 51 of file HGRID.h.
Referenced by HGRID_2D::CheckObjAgainstGrid(), HGRID_3D::CheckObjAgainstGrid(), HGRID_2D::HGRID_UpdateParticleInHgrid(), HGRID_3D::HGRID_UpdateParticleInHgrid(), Initialize_inv_size(), HGRID_2D::TestObjAgainstGrid(), and HGRID_3D::TestObjAgainstGrid().
int HGrid::NUM_BUCKETS |
Number of buckets used for hashing.
Definition at line 47 of file HGRID.h.
Referenced by ComputeHashBucketIndex(), HGrid(), HGRID_base::HGRID_actions_before_time_step(), HGRID_base::InitBroadPhase(), and reset_num_buckets().
BaseParticle** HGrid::objectBucket |
objectBucket[b] stores pointer to first element in hash bucket b; initially all NULL
Definition at line 58 of file HGRID.h.
Referenced by HGRID_2D::CheckCell(), HGRID_3D::CheckCell(), HGRID_2D::CheckCell_current(), HGRID_3D::CheckCell_current(), HGrid(), HGRID_base::HGRID_actions_before_time_step(), HGRID_2D::HGRID_RemoveParticleFromHgrid(), HGRID_3D::HGRID_RemoveParticleFromHgrid(), HGRID_2D::HGRID_UpdateParticleInHgrid(), HGRID_3D::HGRID_UpdateParticleInHgrid(), HGRID_base::InitBroadPhase(), Chute::IsInsertable(), reset_num_buckets(), HGRID_2D::TestCell(), HGRID_3D::TestCell(), and ~HGrid().
int HGrid::occupiedLevelsMask |
l-th bit of occupiedLevelsMask is 1 if level l is contains particles; initially zero (Implies max 32 hgrid levels)
Definition at line 55 of file HGRID.h.
Referenced by HGRID_2D::CheckObjAgainstGrid(), HGRID_3D::CheckObjAgainstGrid(), HGRID_base::InitBroadPhase(), InsertParticleToHgrid(), HGRID_2D::TestObjAgainstGrid(), and HGRID_3D::TestObjAgainstGrid().