Main Page | Class Hierarchy | Class List | File List | Class Members

Space Class Reference

#include <space.h>

Inheritance diagram for Space:

SPH_Space List of all members.

Public Member Functions

 Space (const double length_x, const double length_y, const double length_z, const double diameter)
double get_diameter () const
double get_length_x () const
double get_length_y () const
double get_length_z () const
double get_length (const int i) const
void insert_particle (const Particle::vector_t &p)
void reset ()
bool next ()
bool at_end () const
const Particleget_particle () const
void reset_neighborhood ()
void reset_neighborhood (double &r_sqr)
void reset_neighborhood (const Particle::vector_t &p, double &r_sqr)
bool next_neighbor ()
bool next_neighbor (double &r_sqr)
bool at_end_of_neighborhood () const
const Particleget_neighbor_particle () const
void reorder_particles ()

Protected Member Functions

Particleget_particle ()
Particleget_neighbor_particle ()

Detailed Description

Space to store particles.

Iterate though particles and their neighborhood (i.e. neighboring particles) in an efficient manner.

Author:
Moritz Franosch


Constructor & Destructor Documentation

Space::Space const double  length_x,
const double  length_y,
const double  length_z,
const double  diameter
 

Constructs a space of particles.

The space has dimensions (length_x,length_y,length_z) and diameter of one cell is diameter.


Member Function Documentation

bool Space::at_end  )  const
 

Last next() has returned false.

bool Space::at_end_of_neighborhood  )  const [inline]
 

Last next_neighborhood() has returned false.

double Space::get_diameter  )  const
 

Returns the diameter of a cell.

double Space::get_length const int  i  )  const
 

Returns the length in dimension i of the space.

double Space::get_length_x  )  const
 

Returns the length in x-dimension of the space.

double Space::get_length_y  )  const
 

Returns the length in y-dimension of the space.

double Space::get_length_z  )  const
 

Returns the length in z-dimension of the space.

const Particle& Space::get_neighbor_particle  )  const [inline]
 

Returns a reference to current particle in the neighborhood of the current particle.

Particle& Space::get_neighbor_particle  )  [inline, protected]
 

Returns a reference to current particle in the neighborhood of the current particle.

const Particle& Space::get_particle  )  const [inline]
 

Returns a reference to current particle.

Particle& Space::get_particle  )  [inline, protected]
 

Returns a reference to current particle.

void Space::insert_particle const Particle::vector_t &  p  ) 
 

Insert particle at postion p.

Calls reset().

Invalidates all references to particles.

bool Space::next  ) 
 

Iterator set to next particle.

Returns false if no next particle exists.

bool Space::next_neighbor double &  r_sqr  )  [inline]
 

Same as next_neighbor(), besides

r_sqr is the square of the euclidian distance between the particle and its neighbor if the return value is true (undefined otherwise).

bool Space::next_neighbor  )  [inline]
 

Iterator of neighborhood set to next particle.

Returns false if no next particle exists.

void Space::reorder_particles  ) 
 

Reorders the particles.

Must be called when particles' positions have been changed.

Resets all iterators (see reset()).

void Space::reset  ) 
 

Resets iterator through particles.

void Space::reset_neighborhood const Particle::vector_t &  p,
double &  r_sqr
 

Resets iterator through neighborhood of current position p.

Invalidates current particle.

void Space::reset_neighborhood double &  r_sqr  ) 
 

Same as reset_neighborhood(), besides

r_sqr is the square of the euclidian distance between the particle and its neighbor if !at_end_of_neighborhood() (undefined otherwise).

void Space::reset_neighborhood  ) 
 

Resets iterator through neighborhood of current particle.


The documentation for this class was generated from the following files:
Generated on Fri Apr 22 11:06:48 2005 for partsim.kdevelop by doxygen 1.3.6