Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

pds Class Reference

#include <ParticleLocalityHeckbert.h>

List of all members.


Detailed Description

pds: particle data structure, for fast neighbor finding in 3-D

Author:
Paul Heckbert
Date:
28 June 1994

Definition at line 15 of file ParticleLocalityHeckbert.h.

Public Member Functions

int nb ()
double csize ()
int num ()
int nbucket ()
double size ()
 pds (int nbit, double size)
 Constructor.

void query_advisory (double diam, double ravg)
 client is telling us stats about his queries

void regrid (int nbit, double size)
 call regrid if cubes are wrong size/number change nbit & cubesize, rebuild datastruc

particle ** bucketi (int ix, int iy, int iz)
 return bucket given bounded integer indices (each index in the range [0..mask])

particle ** bucketf (particle *p)
 return bucket given unbounded double coords

void insert (particle *p)
 add particle to set

void del (particle *p)
 delete particle from set

void address_change (particle *pold, particle *pnew)
 particle’s address changed

void move (particle *p, vec3 &d)
 update particle’s position to p->p+d

void visit_neighbors (particle *p, double r, void(*proc)(particle *pi, particle *pj))
 visit all particles within radius r of particle p, calling proc with arguments pi=p, pj=neighbor.

void visit_stats_init ()
void visit_stats_get (int &nsingle, int &nwrap, int &ncube, int &nempty)
 get stats about visit_neighbors

void ds_stats ()
 print data structure statistics


Public Attributes

int npart
 number of particles

int debug
 level of debugging (0=off)

int manualoverride
 for testing query_advisory


Private Attributes

particle ** bucket
 array of cubical hash buckets; each contains a linked list of particles

int nbit
 number of bits per dimension for hash table

int mask
 for hashing, = 2^nbit - 1

double cubesize
 size of a cube

int nmove_attempt
 number of calls to move()

int nmove_actual
 number of particles actually moved

int nqsingle
int nqwrap
int ncrange
int ncempty
 visit_neighbor stats


Constructor & Destructor Documentation

pds::pds int  nbit,
double  size
 

Constructor.

Author:
Paul Heckbert
Date:
28 June 1994
Parameters:
nbit  number of bits cube size # of buckets in x, y, or z total number of buckets size of entire cubical space

Definition at line 11 of file ParticleLocalityHeckbert.cpp.

References bucket, cubesize, debug, manualoverride, mask, nbit, nbucket(), nmove_actual, nmove_attempt, npart, and num().


Member Function Documentation

void pds::address_change particle *  pold,
particle *  p
 

particle’s address changed

Definition at line 132 of file ParticleLocalityHeckbert.cpp.

References bucketf().

particle** pds::bucketf particle *  p  )  [inline]
 

return bucket given unbounded double coords

Note:
many cubes map to the same bucket

Definition at line 72 of file ParticleLocalityHeckbert.h.

References bucketi(), cubesize, and mask.

Referenced by address_change(), del(), insert(), and move().

particle** pds::bucketi int  ix,
int  iy,
int  iz
[inline]
 

return bucket given bounded integer indices (each index in the range [0..mask])

Definition at line 66 of file ParticleLocalityHeckbert.h.

References bucket, and nbit.

Referenced by bucketf(), and visit_neighbors().

double pds::csize  )  [inline]
 

Definition at line 38 of file ParticleLocalityHeckbert.h.

References cubesize.

void pds::del particle *  p  ) 
 

delete particle from set

Definition at line 115 of file ParticleLocalityHeckbert.cpp.

References bucketf(), and npart.

void pds::ds_stats  ) 
 

print data structure statistics

Definition at line 285 of file ParticleLocalityHeckbert.cpp.

References bucket, CLEN, debug, nbucket(), nmove_actual, nmove_attempt, and npart.

void pds::insert particle *  p  ) 
 

add particle to set

Definition at line 105 of file ParticleLocalityHeckbert.cpp.

References bucketf(), and npart.

Referenced by regrid().

void pds::move particle *  p,
vec3 &  d
 

update particle’s position to p->p+d

Definition at line 149 of file ParticleLocalityHeckbert.cpp.

References bucketf(), nmove_actual, and nmove_attempt.

int pds::nb  )  [inline]
 

Definition at line 35 of file ParticleLocalityHeckbert.h.

References nbit.

int pds::nbucket  )  [inline]
 

Definition at line 44 of file ParticleLocalityHeckbert.h.

References nbit.

Referenced by ds_stats(), pds(), regrid(), and visit_neighbors().

int pds::num  )  [inline]
 

Definition at line 41 of file ParticleLocalityHeckbert.h.

References nbit.

Referenced by pds(), regrid(), size(), and visit_neighbors().

void pds::query_advisory double  diam,
double  ravg
 

client is telling us stats about his queries

Definition at line 31 of file ParticleLocalityHeckbert.cpp.

References cubesize, debug, manualoverride, nbit, regrid(), and size().

void pds::regrid int  nbit,
double  size
 

call regrid if cubes are wrong size/number change nbit & cubesize, rebuild datastruc

Definition at line 61 of file ParticleLocalityHeckbert.cpp.

References bucket, cubesize, debug, insert(), mask, nbit, nbucket(), npart, num(), and size().

Referenced by query_advisory().

double pds::size  )  [inline]
 

Definition at line 47 of file ParticleLocalityHeckbert.h.

References cubesize, and num().

Referenced by query_advisory(), regrid(), and visit_neighbors().

void pds::visit_neighbors particle *  p,
double  r,
void(*  proc)(particle *pi, particle *pj)
 

visit all particles within radius r of particle p, calling proc with arguments pi=p, pj=neighbor.

Note:
might visit a few with distance > r

Definition at line 180 of file ParticleLocalityHeckbert.cpp.

References bucket, bucketi(), cubesize, debug, mask, nbucket(), ncempty, ncrange, nqsingle, nqwrap, num(), and size().

void pds::visit_stats_get int &  nsingle,
int &  nwrap,
int &  ncube,
int &  nempty
 

get stats about visit_neighbors

Definition at line 272 of file ParticleLocalityHeckbert.cpp.

References ncempty, ncrange, nqsingle, and nqwrap.

void pds::visit_stats_init  ) 
 

Definition at line 264 of file ParticleLocalityHeckbert.cpp.

References ncempty, ncrange, nqsingle, and nqwrap.


Member Data Documentation

particle** pds::bucket [private]
 

array of cubical hash buckets; each contains a linked list of particles

Definition at line 19 of file ParticleLocalityHeckbert.h.

Referenced by bucketi(), ds_stats(), pds(), regrid(), and visit_neighbors().

double pds::cubesize [private]
 

size of a cube

Definition at line 23 of file ParticleLocalityHeckbert.h.

Referenced by bucketf(), csize(), pds(), query_advisory(), regrid(), size(), and visit_neighbors().

int pds::debug
 

level of debugging (0=off)

Definition at line 32 of file ParticleLocalityHeckbert.h.

Referenced by ds_stats(), pds(), query_advisory(), regrid(), and visit_neighbors().

int pds::manualoverride
 

for testing query_advisory

Definition at line 33 of file ParticleLocalityHeckbert.h.

Referenced by pds(), and query_advisory().

int pds::mask [private]
 

for hashing, = 2^nbit - 1

Definition at line 22 of file ParticleLocalityHeckbert.h.

Referenced by bucketf(), pds(), regrid(), and visit_neighbors().

int pds::nbit [private]
 

number of bits per dimension for hash table

Definition at line 21 of file ParticleLocalityHeckbert.h.

Referenced by bucketi(), nb(), nbucket(), num(), pds(), query_advisory(), and regrid().

int pds::ncempty [private]
 

visit_neighbor stats

Definition at line 28 of file ParticleLocalityHeckbert.h.

Referenced by visit_neighbors(), visit_stats_get(), and visit_stats_init().

int pds::ncrange [private]
 

Definition at line 28 of file ParticleLocalityHeckbert.h.

Referenced by visit_neighbors(), visit_stats_get(), and visit_stats_init().

int pds::nmove_actual [private]
 

number of particles actually moved

Definition at line 27 of file ParticleLocalityHeckbert.h.

Referenced by ds_stats(), move(), and pds().

int pds::nmove_attempt [private]
 

number of calls to move()

Definition at line 26 of file ParticleLocalityHeckbert.h.

Referenced by ds_stats(), move(), and pds().

int pds::npart
 

number of particles

Definition at line 31 of file ParticleLocalityHeckbert.h.

Referenced by del(), ds_stats(), insert(), pds(), and regrid().

int pds::nqsingle [private]
 

Definition at line 28 of file ParticleLocalityHeckbert.h.

Referenced by visit_neighbors(), visit_stats_get(), and visit_stats_init().

int pds::nqwrap [private]
 

Definition at line 28 of file ParticleLocalityHeckbert.h.

Referenced by visit_neighbors(), visit_stats_get(), and visit_stats_init().


The documentation for this class was generated from the following files:
Generated on Mon Jun 28 15:03:00 2004 for Advanced Surface Library by doxygen 1.3.4