Molecular Dynamics Simulation
1.0
src
particles
containers
linkedcells
cells
Cell.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <array>
4
#include <optional>
5
#include <vector>
6
7
#include "
particles/Particle.h
"
8
12
class
Cell
{
13
public
:
17
enum class
CellType
{
INNER
,
BOUNDARY
,
HALO
};
18
19
private
:
23
CellType
cell_type
;
24
28
std::vector<Particle*>
particle_references
;
29
33
std::vector<Cell*>
neighbour_references
;
34
35
public
:
41
explicit
Cell
(
CellType
cell_type
);
42
48
CellType
getCellType
()
const
;
49
55
std::vector<Particle*>&
getParticleReferences
();
56
62
std::vector<Cell*>&
getNeighbourReferences
();
63
69
void
addParticleReference
(
Particle
* p);
70
74
void
clearParticleReferences
();
75
81
void
addNeighbourReference
(
Cell
* c);
82
};
Particle.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::CellType::BOUNDARY
@ BOUNDARY
Cell::CellType::HALO
@ HALO
Cell::CellType::INNER
@ INNER
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