NetDEM v1.0
|
A class that manages the domain and sub-domains for a DEM simulation. More...
#include <domain_manager.hpp>
Public Member Functions | |
DomainManager () | |
Constructs a new DomainManager object. | |
std::tuple< Vec3d, Vec3d > | GetBound () const |
Get the bounds of the simulation. | |
Vec3i const & | GetDecomposition () const |
Get the spacing of the cells. | |
void | Init (Simulation *s) |
Initializes the domain and sub-domains using the given simulation object. | |
void | Init () |
Initializes the domain and sub-domains without a simulation object. | |
void | SetBound (double bmin_x, double bmin_y, double bmin_z, double bmax_x, double bmax_y, double bmax_z) |
Sets the lower and upper bounds of the domain. | |
void | SetDecomposition (int num_div_x, int num_div_y, int num_div_z) |
Sets the number of domain divisions in each dimension. | |
void | SetCellSpacing (double s_x, double s_y, double s_z) |
Sets the spacing between cells in each dimension. | |
VecXT< Domain * > | GetGhostSubDomains () |
Returns a vector of ghost sub-domains for MPI data exchange. | |
Domain * | GetSelfGhostSubDomain () |
Returns a pointer to the ghost sub-domain that belongs to this process. | |
Domain * | GetSelfSubDomain () |
Returns a pointer to the sub-domain that belongs to this process. | |
A class that manages the domain and sub-domains for a DEM simulation.
The DomainManager
class is responsible for managing the domain and sub-domains in a DEM simulation. It provides functionality to initialize the domain and sub-domains, set their boundaries and decomposition, and retrieve ghost sub-domains for MPI data exchange.
DomainManager::DomainManager | ( | ) |
Constructs a new DomainManager
object.
Vec3i const & DomainManager::GetDecomposition | ( | ) | const |
Get the spacing of the cells.
Returns a vector of ghost sub-domains for MPI data exchange.
This function returns a vector of ghost sub-domains, which are instances of the Domain
class that contain the particles located on the boundaries between sub-domains. These sub-domains are used for MPI data exchange to ensure that particles on the boundaries are correctly updated during the simulation.
Domain * DomainManager::GetSelfGhostSubDomain | ( | ) |
Returns a pointer to the ghost sub-domain that belongs to this process.
This function returns a pointer to the ghost sub-domain that belongs to this process. The ghost sub-domain contains the particles located on the boundaries between sub-domains that belong to this process.
Domain * DomainManager::GetSelfSubDomain | ( | ) |
Returns a pointer to the sub-domain that belongs to this process.
This function returns a pointer to the sub-domain that belongs to this process. The sub-domain is used for DEM computation, and its cell_manager
and scene
will be modified by the DEM solver.
void DomainManager::Init | ( | ) |
Initializes the domain and sub-domains without a simulation object.
This function initializes the domain and sub-domains based on the current values of bound_min
, bound_max
, and num_div
. It creates instances of the Domain
class for each sub-domain and stores them in domain_list
. Unlike the Init()
function that takes a Simulation
object, this function does not set up any communication infrastructure for MPI data exchange.
void DomainManager::Init | ( | Simulation * | s | ) |
Initializes the domain and sub-domains using the given simulation object.
This function initializes the domain and sub-domains based on the current values of bound_min
, bound_max
, and num_div
. It creates instances of the Domain
class for each sub-domain and stores them in domain_list
.
s | A pointer to the Simulation object used in the current simulation. |
void DomainManager::SetBound | ( | double | bmin_x, |
double | bmin_y, | ||
double | bmin_z, | ||
double | bmax_x, | ||
double | bmax_y, | ||
double | bmax_z ) |
Sets the lower and upper bounds of the domain.
This function sets the lower and upper bounds of the domain to the given values.
bmin_x | The lower bound of the x-coordinate. |
bmin_y | The lower bound of the y-coordinate. |
bmin_z | The lower bound of the z-coordinate. |
bmax_x | The upper bound of the x-coordinate. |
bmax_y | The upper bound of the y-coordinate. |
bmax_z | The upper bound of the z-coordinate. |
void DomainManager::SetCellSpacing | ( | double | s_x, |
double | s_y, | ||
double | s_z ) |
Sets the spacing between cells in each dimension.
This function sets the spacing between cells in each dimension to the given values. It does not modify the bounds or number of domain divisions.
s_x | The spacing between cells in the x-dimension. |
s_y | The spacing between cells in the y-dimension. |
s_z | The spacing between cells in the z-dimension. |
void DomainManager::SetDecomposition | ( | int | num_div_x, |
int | num_div_y, | ||
int | num_div_z ) |
Sets the number of domain divisions in each dimension.
This function sets the number of domain divisions in each dimension to the given values. Currently, only a preliminary domain division algorithm is implemented, that the domain is uniformly divided into n_x * n_y * n_z sub-domains.
num_div_x | The number of divisions in the x-dimension. |
num_div_y | The number of divisions in the y-dimension. |
num_div_z | The number of divisions in the z-dimension. |