Molecular Dynamics Simulation  1.0
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:
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 
70 
75 
81  void addNeighbourReference(Cell* c);
82 };
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