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

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, Vec3dGetBound () 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.
 
DomainGetSelfGhostSubDomain ()
 Returns a pointer to the ghost sub-domain that belongs to this process.
 
DomainGetSelfSubDomain ()
 Returns a pointer to the sub-domain that belongs to this process.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DomainManager()

DomainManager::DomainManager ( )

Constructs a new DomainManager object.

Member Function Documentation

◆ GetBound()

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

Get the bounds of the simulation.

◆ GetDecomposition()

Vec3i const & DomainManager::GetDecomposition ( ) const

Get the spacing of the cells.

◆ GetGhostSubDomains()

VecXT< Domain * > DomainManager::GetGhostSubDomains ( )

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.

Returns
A vector of ghost sub-domains for MPI data exchange.

◆ GetSelfGhostSubDomain()

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.

Returns
A pointer to the ghost sub-domain that belongs to this process.

◆ GetSelfSubDomain()

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.

Returns
A pointer to the sub-domain that belongs to this process.
Examples
1_test_triaxial_comp.cpp, 91_triaixal_comp.cpp, 91_triaixal_comp_trimesh.cpp, 92_angle_of_repose.cpp, 92_angle_repose_trimesh.cpp, 93_triaixal_comp_trimesh.cpp, 94_angle_repose_trimesh.cpp, and 97_triaixal_comp_sphere_geom.cpp.

◆ Init() [1/2]

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.

◆ Init() [2/2]

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.

Parameters
sA pointer to the Simulation object used in the current simulation.

◆ SetBound()

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.

Parameters
bmin_xThe lower bound of the x-coordinate.
bmin_yThe lower bound of the y-coordinate.
bmin_zThe lower bound of the z-coordinate.
bmax_xThe upper bound of the x-coordinate.
bmax_yThe upper bound of the y-coordinate.
bmax_zThe upper bound of the z-coordinate.
Examples
00_nut_in_bolt.cpp, 02_energy_test.cpp, 0_geometric_solver.cpp, 0_plane_case.cpp, 1_gjk_solver.cpp, 1_membrane_case.cpp, 1_test_triaxial_comp.cpp, 2_sdf_solver.cpp, 3_hybrid_solver.cpp, 81_voronoi_packing.cpp, 90_packing_demo.cpp, 90_random_packing.cpp, 90_random_packing_trimesh.cpp, 91_packing_ellipsoid.cpp, 91_triaixal_comp.cpp, 91_triaixal_comp_trimesh.cpp, 92_angle_of_repose.cpp, 92_angle_repose_trimesh.cpp, 92_nut_in_bolt.cpp, 93_triaixal_comp_trimesh.cpp, 94_angle_repose_trimesh.cpp, 96_random_packing_ellipsoid.cpp, 97_triaixal_comp_sphere_geom.cpp, angle_repose_main.cpp, blade_mixing_main.cpp, landslide_main.cpp, and odemetric_comp_main.cpp.

◆ SetCellSpacing()

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.

Parameters
s_xThe spacing between cells in the x-dimension.
s_yThe spacing between cells in the y-dimension.
s_zThe spacing between cells in the z-dimension.
Examples
00_nut_in_bolt.cpp, 02_energy_test.cpp, 0_geometric_solver.cpp, 0_plane_case.cpp, 1_gjk_solver.cpp, 1_membrane_case.cpp, 2_sdf_solver.cpp, 3_hybrid_solver.cpp, 81_voronoi_packing.cpp, 90_packing_demo.cpp, 90_random_packing.cpp, 90_random_packing_trimesh.cpp, 91_packing_ellipsoid.cpp, 92_nut_in_bolt.cpp, 96_random_packing_ellipsoid.cpp, angle_repose_main.cpp, blade_mixing_main.cpp, landslide_main.cpp, and odemetric_comp_main.cpp.

◆ SetDecomposition()

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.

Parameters
num_div_xThe number of divisions in the x-dimension.
num_div_yThe number of divisions in the y-dimension.
num_div_zThe number of divisions in the z-dimension.
Examples
0_geometric_solver.cpp, 0_plane_case.cpp, 1_gjk_solver.cpp, 1_membrane_case.cpp, 2_sdf_solver.cpp, 3_hybrid_solver.cpp, 90_random_packing.cpp, 90_random_packing_trimesh.cpp, 96_random_packing_ellipsoid.cpp, angle_repose_main.cpp, landslide_main.cpp, and odemetric_comp_main.cpp.

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