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

Class for managing the simulation domain and particles that belong to it. More...

#include <domain.hpp>

Public Member Functions

 Domain ()
 Constructs a new Domain object with default settings.
 
 Domain (Vec3d const &bmin, Vec3d const &bmax)
 Constructs a new Domain object with the given bounds.
 
int GetSelfRank () const
 Get the rank id of the domain.
 
int GetTotalRank () const
 Get the total ranks of the simulation.
 
std::tuple< Vec3d, Vec3dGetBound () const
 Get the bounds of the current domain.
 
void Init ()
 Initializes the domain.
 
void InitScene (Scene *const scene)
 Initializes the domain with the given scene.
 
void InitScene ()
 Initializes the domain with a default scene.
 
SceneGetScene ()
 Gets the pointer to the scene used by this domain.
 
void SetBound (double bmin_x, double bmin_y, double bmin_z, double bmax_x, double bmax_y, double bmax_z)
 Sets the size of the domain.
 
void SetCellSpacing (double s_x, double s_y, double s_z)
 Sets the cell spacing for the CellManager.
 
bool IsJudgeDomain (Particle const &p, Particle const &q)
 Checks if a particle needs to be checked for contact detection in this domain.
 
bool IsJudgeDomain (Particle const &p, Wall const &w)
 Checks if a particle needs to be checked for contact with a wall in this domain.
 
bool IsBelongToDomain (Particle const &p)
 Checks if a particle belongs to this domain.
 
bool IsBelongToDomain (ParticleData const &p)
 Checks if a particle data belongs to this domain.
 
bool IsBelongToDomain (Vec3d const &pos)
 Checks if a position belongs to this domain.
 
bool IsParticleProxyToSend (Particle const &p)
 Checks if a particle needs to be sent to other domains for contact detection.
 
bool IsParticleProxyToRecv (Particle const &p)
 Checks if a particle needs to be received from other domains for contact detection.
 
bool IsParticleProxyToRecv (ParticleData const &p)
 Checks if a particle data needs to be received from other domains for contact detection.
 
void Print ()
 Prints information about this domain to the screen.
 
VecXT< std::pair< Particle *, int > > const & GetLinkedOuterParticles ()
 Get the particles that belong to other domains but may potentially overlap with this domain.
 
void ClearLinkedLists ()
 Clears linked lists.
 
STLModel GetSTLModel ()
 Returns an STLModel object for visualization purposes.
 
 ~Domain ()
 Destructor for the Domain object.
 

Public Attributes

CellManager cell_manager
 Manages the cells, which are used in the borad-phase contact detection.
 

Protected Member Functions

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

Friends

class Particle
 
class Wall
 
class MPIManager
 
class DomainManager
 

Detailed Description

Class for managing the simulation domain and particles that belong to it.

The Domain class includes a CellManager object for broad-phase contact detection. It stores information about the rank id and total number of processes, the lower and upper bounds of the domain, and a list of particles that are outside of the domain but need to be transferred to it for contact detection.

Constructor & Destructor Documentation

◆ Domain() [1/2]

Domain::Domain ( )

Constructs a new Domain object with default settings.

◆ Domain() [2/2]

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

Constructs a new Domain object with the given bounds.

Parameters
bminLower bound of the domain.
bmaxUpper bound of the domain.

◆ ~Domain()

Domain::~Domain ( )

Destructor for the Domain object.

Member Function Documentation

◆ ClearLinkedLists()

void Domain::ClearLinkedLists ( )

Clears linked lists.

◆ GetBound()

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

Get the bounds of the current domain.

◆ GetLinkedOuterParticles()

VecXT< std::pair< Particle *, int > > const & Domain::GetLinkedOuterParticles ( )

Get the particles that belong to other domains but may potentially overlap with this domain.

◆ GetScene()

Scene * Domain::GetScene ( )

Gets the pointer to the scene used by this domain.

Returns
Pointer to the scene used by this domain.

◆ GetSelfRank()

int Domain::GetSelfRank ( ) const

Get the rank id of the domain.

◆ GetSTLModel()

STLModel Domain::GetSTLModel ( )

Returns an STLModel object for visualization purposes.

Returns
An STLModel object for visualization.

◆ GetTotalRank()

int Domain::GetTotalRank ( ) const

Get the total ranks of the simulation.

◆ Init()

void Domain::Init ( )

Initializes the domain.

◆ InitScene() [1/2]

void Domain::InitScene ( )

Initializes the domain with a default scene.

◆ InitScene() [2/2]

void Domain::InitScene ( Scene *const scene)

Initializes the domain with the given scene.

Parameters
scenePointer to the scene to use for initialization.

◆ IsBelongToDomain() [1/3]

bool Domain::IsBelongToDomain ( Particle const & p)

Checks if a particle belongs to this domain.

A particle is assumed to belong to this domain if its centroid is inside this domain.

Parameters
pThe particle to check.
Returns
True if the particle belongs to this domain, false otherwise.

◆ IsBelongToDomain() [2/3]

bool Domain::IsBelongToDomain ( ParticleData const & p)

Checks if a particle data belongs to this domain.

A particle is assumed to belong to this domain if its centroid is inside this domain.

Parameters
pParticleData struct containing the particle data to check.
Returns
True if the particle data belongs to this domain, false otherwise.

◆ IsBelongToDomain() [3/3]

bool Domain::IsBelongToDomain ( Vec3d const & pos)

Checks if a position belongs to this domain.

Parameters
posThe position to check.
Returns
True if the position belongs to this domain, false otherwise.

◆ IsJudgeDomain() [1/2]

bool Domain::IsJudgeDomain ( Particle const & p,
Particle const & q )

Checks if a particle needs to be checked for contact detection in this domain.

Parameters
pThe first particle involved in the potential contact.
qThe second particle involved in the potential contact.
Returns
True if the contact should be checked in this domain, false otherwise.

◆ IsJudgeDomain() [2/2]

bool Domain::IsJudgeDomain ( Particle const & p,
Wall const & w )

Checks if a particle needs to be checked for contact with a wall in this domain.

Parameters
pThe particle involved in the potential contact.
wThe wall involved in the potential contact.
Returns
True if the contact should be checked in this domain, false otherwise.

◆ IsParticleProxyToRecv() [1/2]

bool Domain::IsParticleProxyToRecv ( Particle const & p)

Checks if a particle needs to be received from other domains for contact detection.

Parameters
pThe particle to check.
Returns
True if the particle should be received from other domains, false otherwise.

◆ IsParticleProxyToRecv() [2/2]

bool Domain::IsParticleProxyToRecv ( ParticleData const & p)

Checks if a particle data needs to be received from other domains for contact detection.

Parameters
pParticleData struct containing the particle data to check.
Returns
True if the particle data should be received from other domains, false otherwise.

◆ IsParticleProxyToSend()

bool Domain::IsParticleProxyToSend ( Particle const & p)

Checks if a particle needs to be sent to other domains for contact detection.

Parameters
pThe particle to check.
Returns
True if the particle should be sent to other domains, false otherwise.

◆ Print()

void Domain::Print ( )

Prints information about this domain to the screen.

◆ RemoveLinkedParticle()

void Domain::RemoveLinkedParticle ( int lookup_id)
protected

Remove a linked particle by look-up id.

◆ SetBound()

void Domain::SetBound ( double bmin_x,
double bmin_y,
double bmin_z,
double bmax_x,
double bmax_y,
double bmax_z )

Sets the size of the domain.

Parameters
bmin_xLower bound in the x direction.
bmin_yLower bound in the y direction.
bmin_zLower bound in the z direction.
bmax_xUpper bound in the x direction.
bmax_yUpper bound in the y direction.
bmax_zUpper bound in the z direction.

◆ SetCellSpacing()

void Domain::SetCellSpacing ( double s_x,
double s_y,
double s_z )

Sets the cell spacing for the CellManager.

Parameters
s_xCell spacing in the x direction.
s_yCell spacing in the y direction.
s_zCell spacing in the z direction.

Friends And Related Symbol Documentation

◆ DomainManager

friend class DomainManager
friend

◆ MPIManager

friend class MPIManager
friend

◆ Particle

friend class Particle
friend

◆ Wall

friend class Wall
friend

Member Data Documentation

◆ cell_manager


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