NetDEM v1.0
Loading...
Searching...
No Matches
cell.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "particle.hpp"
4#include "wall.hpp"
5
6namespace netdem {
7
8class MPIManager;
9
19class Cell {
20 friend class Particle;
21 friend class Wall;
22 friend class MPIManager;
23
24private:
26 Vec3d bound_min{-0.5, -0.5, -0.5};
27
29 Vec3d bound_max{0.5, 0.5, 0.5};
30
35 VecXT<std::pair<Particle *, int>> linked_particle_list;
36
40 VecXT<std::pair<Wall *, int>> linked_wall_list;
41
42public:
46 Cell();
47
53 Cell(Vec3d const &bmin, Vec3d const &bmax);
54
61 bool IsJudgeCell(Particle const &p, Particle const &q);
62
70 bool IsJudgeCell(Particle const &p, Wall const &w);
71
75 std::tuple<Vec3d, Vec3d> GetBound() const;
76
81
86
90 void ClearLinkedLists();
91
92protected:
96 void RemoveLinkedParticle(int lookup_id);
97
101 void RemoveLinkedWall(int lookup_id);
102
103public:
108 STLModel GetSTLModel();
109
113 ~Cell();
114
118 void Print();
119};
120
121} // namespace netdem
A class representing a cell in a simulation grid.
Definition cell.hpp:19
STLModel GetSTLModel()
Generate an STL model for visualization purposes.
Definition cell.cpp:79
friend class Particle
Definition cell.hpp:20
void ClearLinkedLists()
Clear the linked particle and wall lists.
Definition cell.cpp:61
VecXT< std::pair< Wall *, int > > const & GetLinkedWalls() const
Get the walls that are linked with this cell.
Definition cell.cpp:37
Cell()
Default constructor for the Cell class.
Definition cell.cpp:6
bool IsJudgeCell(Particle const &p, Particle const &q)
Determine if two particles are in the same cell.
Definition cell.cpp:11
void RemoveLinkedWall(int lookup_id)
Remove a linked wall by look-up id.
Definition cell.cpp:51
VecXT< std::pair< Particle *, int > > const & GetLinkedParticles() const
Get the particles that are linked with this cell.
Definition cell.cpp:33
~Cell()
Default destructor for the Cell class.
Definition cell.cpp:169
void RemoveLinkedParticle(int lookup_id)
Remove a linked particle by look-up id.
Definition cell.cpp:41
friend class Wall
Definition cell.hpp:21
std::tuple< Vec3d, Vec3d > GetBound() const
Get the lower and upper coordinates of the cell box.
Definition cell.cpp:29
void Print()
Print the bounding box of the cell to stdout.
Definition cell.cpp:171
Manages the data exchange in a DEM simulation.
Definition mpi_manager.hpp:39
Definition particle.hpp:26
A class representing a wall object in a physics simulation.
Definition wall.hpp:32
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18