Molecular Dynamics Simulation  1.0
Cell.cpp
Go to the documentation of this file.
1 #include "Cell.h"
2 
3 Cell::Cell(CellType cell_type) : cell_type(cell_type) { neighbour_references.reserve(26); }
4 
6 
7 std::vector<Particle*>& Cell::getParticleReferences() { return particle_references; }
8 
9 std::vector<Cell*>& Cell::getNeighbourReferences() { return neighbour_references; }
10 
12 
14 
Class representing a cell in the linked cells algorithm.
Definition: Cell.h:12
Cell(CellType cell_type)
Construct a new Cell object.
Definition: Cell.cpp:3
CellType
Enum representing the type of a cell.
Definition: Cell.h:17
CellType getCellType() const
Get the type of the cell.
Definition: Cell.cpp:5
std::vector< Cell * > & getNeighbourReferences()
Get the reference vector for the neighbouring cells.
Definition: Cell.cpp:9
std::vector< Particle * > & getParticleReferences()
Get the reference vector for the particles the cell contains.
Definition: Cell.cpp:7
std::vector< Cell * > neighbour_references
References to the neighbouring cells.
Definition: Cell.h:33
void addNeighbourReference(Cell *c)
Adds a neighbour reference to the cell.
Definition: Cell.cpp:15
std::vector< Particle * > particle_references
References to the particles the cell contains.
Definition: Cell.h:28
CellType cell_type
Type of the cell.
Definition: Cell.h:23
void clearParticleReferences()
Removes all particle references from the cell.
Definition: Cell.cpp:13
void addParticleReference(Particle *p)
Adds a particle reference to the cell.
Definition: Cell.cpp:11
Class to represent a particle.
Definition: Particle.h:26