glotzopt::Cell Class Reference
[Optimization]

Contains ObjectInCellList(s). More...

#include <Cell.h>

List of all members.

Public Member Functions

 Cell ()
 Constructor.
virtual ~Cell ()
 Destructor.
virtual CellClone ()
 Smart copy function.
virtual void Clear ()
 Clears the cell memory space (contents, neighbors, ghosts).
virtual void ClearContents ()
 Clears the contents of teh cell.
virtual void Print (std::ostream &os)
 Prints the contents of the cell.
virtual void Insert (ObjectInCellList *)
 Inserts an object at the back of the cell.
virtual void Remove (ObjectInCellList *)
 Removes an object from the cell.
int GetNumberOfObjects ()
 Returns the number of objects in the cell.
ObjectInCellListoperator[] (int)
 Indexing operator.
ObjectInCellListGetObject (int)
 Gets the object at index "i".
void AddNeighbor (Cell *)
 Add a neighboring cell to the list of neighbors.
int GetNumberOfNeighbors ()
 Returns the number of neighboring cells.
CellGetNeighbor (int)
 Returns a pointer to a neighboring cell at index "i".
bool IsBoundaryCell () const
 Returns whether or not the cell is on the boundary of the box.
void SetSequencer (int)
 Sets the sequencer, which is like a cell id.
int GetSequencer ()
 Returns the sequencer.
void SetParentCellList (CellList *)
 Set a pointer to the CellList containing the cell.
void SetBoundaryMultiplier (glotz_vec &)
 Sets the boundary conditions factor.
void SetIsBoundaryCell (bool)
 Indicates whether the cell is a boundary cel.

Static Public Member Functions

static void InitializeStaticVariables ()
 Initializes all static member variables.

Public Attributes

std::vector< Cell * > xNeighbor
 List containing the neighboring cells of a cell.
std::vector
< ObjectInCellList * > 
xObject
 A container to hold the objects in the cell.

Protected Attributes

std::map< int, int > mIndexOf
glotz_vec mBoundaryMultiplier
 Index of an object in the cell.
int mSequencer
 An integer indicating the cell-id.
bool mIsBoundaryCell
 Indicates whether or not the cell is on the boundary of the box.

Private Attributes

CellListmParentCellList
 A pointer to the CellList containing the cell.

Friends

glotz_vec compute_boundary_correction (const Cell *, const Cell *)
 Special function to get the boundary conditions correction for two cells.


Detailed Description

Contains ObjectInCellList(s).

Author:
Aaron Keys
Cell represents one cell in class CellList, which contains and manages many Cells

Constructor & Destructor Documentation

glotzopt::Cell::Cell (  ) 

Constructor.

glotzopt::Cell::~Cell (  )  [virtual]

Destructor.


Member Function Documentation

Cell * glotzopt::Cell::Clone (  )  [virtual]

Smart copy function.

Returns:
a pointer to a new cell that is identical to the current cell

void glotzopt::Cell::Clear (  )  [virtual]

Clears the cell memory space (contents, neighbors, ghosts).

Clears the contents of the cell and the cell neighbors.

void glotzopt::Cell::ClearContents (  )  [virtual]

Clears the contents of teh cell.

Clears the contents of the cells only (i.e., all objects contained in the cell).

void glotzopt::Cell::Print ( std::ostream &  os  )  [virtual]

Prints the contents of the cell.

Parameters:
os is the output stream that is printed to

void glotzopt::Cell::Insert ( ObjectInCellList object  )  [virtual]

Inserts an object at the back of the cell.

Parameters:
object is the object to be inserted

void glotzopt::Cell::Remove ( ObjectInCellList object  )  [virtual]

Removes an object from the cell.

Parameters:
object is the object to be removed

int glotzopt::Cell::GetNumberOfObjects (  ) 

Returns the number of objects in the cell.

Returns:
the number of objects in the cell

ObjectInCellList * glotzopt::Cell::operator[] ( int  i  ) 

Indexing operator.

Returns the "i"th object contained in the cell

Parameters:
i is the index of the object to be returned
Returns:
a pointer to the "i"th object

ObjectInCellList * glotzopt::Cell::GetObject ( int  i  ) 

Gets the object at index "i".

Returns the "i"th object contained in the cell

Parameters:
i is the index of the object to be returned
Returns:
a pointer to the "i"th object

void glotzopt::Cell::AddNeighbor ( Cell nbr  ) 

Add a neighboring cell to the list of neighbors.

Parameters:
nbr is a pointer to the cell to be added to the neighbor list of current cell

int glotzopt::Cell::GetNumberOfNeighbors (  ) 

Returns the number of neighboring cells.

Returns:
the number of objects in the cell

Cell * glotzopt::Cell::GetNeighbor ( int  i  ) 

Returns a pointer to a neighboring cell at index "i".

Returns the index of the cell neighbor at position "i" in xNeighbor array

Parameters:
i is the index of the cell neighbor in xNeighbor array
Returns:
the index of the cell neighbor at position "i"

bool glotzopt::Cell::IsBoundaryCell (  )  const

Returns whether or not the cell is on the boundary of the box.

Returns:
a boolean value indicating whether or not the cell is on the border of the box
This function is used to determine whether or not we need to check the boundary conditions for a particle in a given cell.

void glotzopt::Cell::SetSequencer ( int  number  ) 

Sets the sequencer, which is like a cell id.

is the integer value of the seqencer

int glotzopt::Cell::GetSequencer (  ) 

Returns the sequencer.

Returns:
an integer sequencer or id of current cell

void glotzopt::Cell::SetParentCellList ( CellList cellList  ) 

Set a pointer to the CellList containing the cell.

Parameters:
cellList is the parent cell list containing the cell

static void glotzopt::Cell::InitializeStaticVariables (  )  [static]

Initializes all static member variables.

void glotzopt::Cell::SetBoundaryMultiplier ( glotz_vec pbc  ) 

Sets the boundary conditions factor.

is a vector that, when multiplied by the box size, gives the periodic boundary conditions

void glotzopt::Cell::SetIsBoundaryCell ( bool  val  ) 

Indicates whether the cell is a boundary cel.

is a boolean value indicating whether or not the cell is a boundary cell


Friends And Related Function Documentation

glotz_vec compute_boundary_correction ( const Cell cell_i,
const Cell cell_j 
) [friend]

Special function to get the boundary conditions correction for two cells.


Member Data Documentation

std::vector<Cell*> glotzopt::Cell::xNeighbor

List containing the neighboring cells of a cell.

std::vector<ObjectInCellList*> glotzopt::Cell::xObject

A container to hold the objects in the cell.

std::map<int, int> glotzopt::Cell::mIndexOf [protected]

glotz_vec glotzopt::Cell::mBoundaryMultiplier [protected]

Index of an object in the cell.

When multiplied by the box size this variable gives the boundary correction

int glotzopt::Cell::mSequencer [protected]

An integer indicating the cell-id.

bool glotzopt::Cell::mIsBoundaryCell [protected]

Indicates whether or not the cell is on the boundary of the box.

CellList* glotzopt::Cell::mParentCellList [private]

A pointer to the CellList containing the cell.


The documentation for this class was generated from the following files:
Generated on Tue Feb 24 20:54:47 2009 by  doxygen 1.5.3