25 { offsetsPtr_ = &offsets; }
31 { nextCellPtr_ = &nextCell; }
47 bool reverseUpdateFlag)
const 51 assert(!isGhostCell_);
53 const Cell* cellBegin;
61 ns = offsetsPtr_->
size();
63 if (reverseUpdateFlag) {
64 for (is = 0; is < ns; ++is) {
65 cellBegin =
this + (*offsetsPtr_)[is].first;
66 cellEnd =
this + (*offsetsPtr_)[is].second;
67 if (cellBegin->
id() >= id_) {
68 atomBegin = cellBegin->begin_;
69 atomEnd = cellEnd->begin_ + cellEnd->nAtom_;
70 for ( ; atomBegin < atomEnd; ++atomBegin) {
71 neighbors.
append(atomBegin);
76 for (is = 0; is < ns; ++is) {
77 cellBegin =
this + (*offsetsPtr_)[is].first;
78 cellEnd =
this + (*offsetsPtr_)[is].second;
79 if (cellBegin->
id() >= id_) {
80 atomBegin = cellBegin->begin_;
81 atomEnd = cellEnd->begin_ + cellEnd->nAtom_;
82 for ( ; atomBegin < atomEnd; ++atomBegin) {
83 neighbors.
append(atomBegin);
97 assert(cellEnd >= cellBegin);
98 atomBegin = cellBegin->begin_;
99 atomEnd = cellEnd->begin_ + cellEnd->nAtom_;
100 for ( ; atomBegin < atomEnd; ++atomBegin) {
101 neighbors.
append(atomBegin);
void clear()
Set logical size to zero.
Data for an atom in a CellList.
void append(const Data &data)
Append data to the end of the array.
Parallel domain decomposition (DD) MD simulation.
int id() const
Get identifier for this Cell.
void setOffsetArray(OffsetArray &offsets)
Set the pointer to an array of integer offsets.
void setNextCell(Cell &nextCell)
Set the pointer to the next cell in the list.
Utility classes for scientific computation.
void setIsGhostCell(bool isGhostCell=true)
Mark as a ghost or local cell.
void setLastCell()
Set this to be the last cell in the list.
void getNeighbors(NeighborArray &neighbors, bool reverseUpdateFlag=false) const
Fill an array with pointers to atoms in a cell and neighboring cells.
int size() const
Return logical size of this array (i.e., number of elements).
bool isGhostCell() const
Is this a ghost cell?
A single Cell in a CellList.