Molecular Dynamics Simulation
1.0
src
particles
containers
linkedcells
cells
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
5
Cell::CellType
Cell::getCellType
()
const
{
return
cell_type
; }
6
7
std::vector<Particle*>&
Cell::getParticleReferences
() {
return
particle_references
; }
8
9
std::vector<Cell*>&
Cell::getNeighbourReferences
() {
return
neighbour_references
; }
10
11
void
Cell::addParticleReference
(
Particle
* p) {
particle_references
.push_back(p); }
12
13
void
Cell::clearParticleReferences
() {
particle_references
.clear(); }
14
15
void
Cell::addNeighbourReference
(
Cell
* c) {
neighbour_references
.push_back(c); }
Cell.h
Cell
Class representing a cell in the linked cells algorithm.
Definition:
Cell.h:12
Cell::Cell
Cell(CellType cell_type)
Construct a new Cell object.
Definition:
Cell.cpp:3
Cell::CellType
CellType
Enum representing the type of a cell.
Definition:
Cell.h:17
Cell::getCellType
CellType getCellType() const
Get the type of the cell.
Definition:
Cell.cpp:5
Cell::getNeighbourReferences
std::vector< Cell * > & getNeighbourReferences()
Get the reference vector for the neighbouring cells.
Definition:
Cell.cpp:9
Cell::getParticleReferences
std::vector< Particle * > & getParticleReferences()
Get the reference vector for the particles the cell contains.
Definition:
Cell.cpp:7
Cell::neighbour_references
std::vector< Cell * > neighbour_references
References to the neighbouring cells.
Definition:
Cell.h:33
Cell::addNeighbourReference
void addNeighbourReference(Cell *c)
Adds a neighbour reference to the cell.
Definition:
Cell.cpp:15
Cell::particle_references
std::vector< Particle * > particle_references
References to the particles the cell contains.
Definition:
Cell.h:28
Cell::cell_type
CellType cell_type
Type of the cell.
Definition:
Cell.h:23
Cell::clearParticleReferences
void clearParticleReferences()
Removes all particle references from the cell.
Definition:
Cell.cpp:13
Cell::addParticleReference
void addParticleReference(Particle *p)
Adds a particle reference to the cell.
Definition:
Cell.cpp:11
Particle
Class to represent a particle.
Definition:
Particle.h:26
Generated by
1.9.1