NetDEM v1.0
Loading...
Searching...
No Matches
netdem::Cell Class Reference

A class representing a cell in a simulation grid. More...

#include <cell.hpp>

Public Member Functions

 Cell ()
 Default constructor for the Cell class.
 
 Cell (Vec3d const &bmin, Vec3d const &bmax)
 Constructor for the Cell class with bounding box specified.
 
bool IsJudgeCell (Particle const &p, Particle const &q)
 Determine if two particles are in the same cell.
 
bool IsJudgeCell (Particle const &p, Wall const &w)
 Determine if a particle and a wall are in the same cell.
 
std::tuple< Vec3d, Vec3dGetBound () const
 Get the lower and upper coordinates of the cell box.
 
VecXT< std::pair< Particle *, int > > const & GetLinkedParticles () const
 Get the particles that are linked with this cell.
 
VecXT< std::pair< Wall *, int > > const & GetLinkedWalls () const
 Get the walls that are linked with this cell.
 
void ClearLinkedLists ()
 Clear the linked particle and wall lists.
 
STLModel GetSTLModel ()
 Generate an STL model for visualization purposes.
 
 ~Cell ()
 Default destructor for the Cell class.
 
void Print ()
 Print the bounding box of the cell to stdout.
 

Protected Member Functions

void RemoveLinkedParticle (int lookup_id)
 Remove a linked particle by look-up id.
 
void RemoveLinkedWall (int lookup_id)
 Remove a linked wall by look-up id.
 

Friends

class Particle
 
class Wall
 
class MPIManager
 

Detailed Description

A class representing a cell in a simulation grid.

This class keeps track of particles and walls that are located within its boundaries. It is used for broad-phase contact detection. The particles in a sub-domain will first be sorted into cells, so that only the particles that fall in the same cell could be potentially contact with each other.

Constructor & Destructor Documentation

◆ Cell() [1/2]

Cell::Cell ( )

Default constructor for the Cell class.

◆ Cell() [2/2]

Cell::Cell ( Vec3d const & bmin,
Vec3d const & bmax )

Constructor for the Cell class with bounding box specified.

Parameters
bminThe minimum coordinates of the cell's bounding box.
bmaxThe maximum coordinates of the cell's bounding box.

◆ ~Cell()

Cell::~Cell ( )

Default destructor for the Cell class.

Member Function Documentation

◆ ClearLinkedLists()

void Cell::ClearLinkedLists ( )

Clear the linked particle and wall lists.

◆ GetBound()

tuple< Vec3d, Vec3d > Cell::GetBound ( ) const

Get the lower and upper coordinates of the cell box.

◆ GetLinkedParticles()

VecXT< std::pair< Particle *, int > > const & Cell::GetLinkedParticles ( ) const

Get the particles that are linked with this cell.

◆ GetLinkedWalls()

VecXT< std::pair< Wall *, int > > const & Cell::GetLinkedWalls ( ) const

Get the walls that are linked with this cell.

◆ GetSTLModel()

STLModel Cell::GetSTLModel ( )

Generate an STL model for visualization purposes.

Returns
An STLModel object representing the cell.

◆ IsJudgeCell() [1/2]

bool Cell::IsJudgeCell ( Particle const & p,
Particle const & q )

Determine if two particles are in the same cell.

Parameters
pThe first particle.
qThe second particle.
Returns
True if the two particles are in the same cell, false otherwise.

◆ IsJudgeCell() [2/2]

bool Cell::IsJudgeCell ( Particle const & p,
Wall const & w )

Determine if a particle and a wall are in the same cell.

Parameters
pThe particle.
wThe wall.
Returns
True if the particle and the wall are in the same cell, false otherwise.

◆ Print()

void Cell::Print ( )

Print the bounding box of the cell to stdout.

◆ RemoveLinkedParticle()

void Cell::RemoveLinkedParticle ( int lookup_id)
protected

Remove a linked particle by look-up id.

◆ RemoveLinkedWall()

void Cell::RemoveLinkedWall ( int lookup_id)
protected

Remove a linked wall by look-up id.

Friends And Related Symbol Documentation

◆ MPIManager

friend class MPIManager
friend

◆ Particle

friend class Particle
friend

◆ Wall

friend class Wall
friend

The documentation for this class was generated from the following files: