1 #ifndef __CELL_LIST_CELL_LIST_FAST_H__
2 #define __CELL_LIST_CELL_LIST_FAST_H__
4 #include <boost/multi_array.hpp>
6 #include "../Vector/Vector.hpp"
24 typedef boost::multi_array<int, 3> CellData;
25 typedef boost::multi_array<int, 1> LinkedList;
26 typedef boost::multi_array<IntVector, 1> CellIndex;
49 int FindListPosition(
int start,
const int ps);
85 CellList(
const int ps,
const int xs,
const int ys,
const int zs);
113 void SetParticle(
const int ps,
const int x,
const int y,
const int z);
164 inline unsigned long Dims(
const int i)
const
167 assert((
unsigned) i < Cells.num_dimensions());
168 return Cells.shape()[i];
NeighborCellIterator BeginNeighborCell(const int particle, const IntVector &low, const IntVector &high)
Create an iterator into the neighboring cells of a given particle.
Definition: CellListFast.cpp:109
This class provides the functionality of a three dimensional cell list.
Definition: CellListFast.h:20
int operator*() const
Definition: CellListFast.cpp:269
CellList(const int ps, const int xs, const int ys, const int zs)
Constructor.
Definition: CellListFast.cpp:59
bool HasNext() const
Definition: CellListFast.cpp:278
void SetParticle(const int ps, const int x, const int y, const int z)
Sets the position of the current particle.
Definition: CellListFast.cpp:125
NeighborCellIterator(CellList &parent, const IntVector &cell, const IntVector &low, const IntVector &high)
Create an iterator into the cells adjacent to the current one (the current one is treated as triviall...
Definition: CellListFast.cpp:185
Definition: CellListFast.h:53
void Clear()
Clear out the contents of the CellList.
Definition: CellListFast.cpp:315
const IntVector & ParticlePosition(const int ps) const
Get the particle's position in the grid space.
Definition: CellListFast.cpp:81
unsigned long Dims(const int i) const
Get the number of partitions along each dimension.
Definition: CellListFast.h:164
void MoveParticle(const int ps, const IntVector &mv)
Moves a particle the set number of cells in each direction.
Definition: CellListFast.cpp:93
void Resize(const int ps, const IntVector &ex)
Resize the cell list to a new volume.
Definition: CellListFast.cpp:286
tvmet::Vector< int, 3UL > IntVector
A vector of integer values to hold a particle's position in the grid of cells.
Definition: Vector.hpp:29
NeighborCellIterator & operator++()
Advances the iterator one position.
Definition: CellListFast.cpp:233